From patchwork Tue Jan 13 16:59:03 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 43070 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f198.google.com (mail-lb0-f198.google.com [209.85.217.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 3418820DE8 for ; Tue, 13 Jan 2015 16:59:34 +0000 (UTC) Received: by mail-lb0-f198.google.com with SMTP id p9sf2341579lbv.1 for ; Tue, 13 Jan 2015 08:59:33 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:sender:precedence:list-id:x-original-sender :x-original-authentication-results:mailing-list:list-post:list-help :list-archive:list-unsubscribe; bh=fy0Q1Rg5BiZjdKiXQgP0NdtYrEgFclMz8x8VNuf/k+M=; b=V7TeaQZpee6ADJEstAyie7e06KxlI3/KwJ0j5sRLYXxyn6z6Q0KX0nMngyl2/Bmchp /GeJYGT9m/8BM3XrU/Xs3yf6t01JoJxguFwc0q7nU9SEUpJD9UsGqhoUVeEtFrT7aATC 64Nch7K8iu/KiYerp5v6ulDu5KOFk+OGMDvzZJpwJZ13JmKtz4JToIgEXwZX/LivYhPg pa67y0ZeSvlDbxG90y/2laVZeMUs/PKqM7or66RyblTQuqSUArDPxShGMpSn6O1RpKwK 9x4f35Qpw43w68+tHJa8FDQCQ5vetVWWOAPCiNMPa8SMsc0BPMNeUJffGBNG5LUIqHYr j4RA== X-Gm-Message-State: ALoCoQkGdkssiClWSfOboEwOP99LHmG44fon6S77ZR3mI4fdHGlPqmjy2fG46PkKzVy1JhN/K2CE X-Received: by 10.152.10.233 with SMTP id l9mr4620580lab.0.1421168373179; Tue, 13 Jan 2015 08:59:33 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.19.39 with SMTP id b7ls19846lae.93.gmail; Tue, 13 Jan 2015 08:59:33 -0800 (PST) X-Received: by 10.152.3.195 with SMTP id e3mr43521961lae.8.1421168372997; Tue, 13 Jan 2015 08:59:32 -0800 (PST) Received: from mail-la0-f42.google.com (mail-la0-f42.google.com. [209.85.215.42]) by mx.google.com with ESMTPS id o2si3462538lao.40.2015.01.13.08.59.32 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Tue, 13 Jan 2015 08:59:32 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) client-ip=209.85.215.42; Received: by mail-la0-f42.google.com with SMTP id gd6so3745848lab.1 for ; Tue, 13 Jan 2015 08:59:32 -0800 (PST) X-Received: by 10.112.30.71 with SMTP id q7mr43482492lbh.41.1421168372809; Tue, 13 Jan 2015 08:59:32 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.9.200 with SMTP id c8csp1441350lbb; Tue, 13 Jan 2015 08:59:31 -0800 (PST) X-Received: by 10.70.35.7 with SMTP id d7mr51886957pdj.41.1421168370938; Tue, 13 Jan 2015 08:59:30 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id ol6si27607728pbb.116.2015.01.13.08.59.30; Tue, 13 Jan 2015 08:59:30 -0800 (PST) Received-SPF: none (google.com: linux-kernel-owner@vger.kernel.org does not designate permitted sender hosts) client-ip=209.132.180.67; Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752524AbbAMQ72 (ORCPT + 27 others); Tue, 13 Jan 2015 11:59:28 -0500 Received: from mail-pd0-f171.google.com ([209.85.192.171]:47047 "EHLO mail-pd0-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751757AbbAMQ70 (ORCPT ); Tue, 13 Jan 2015 11:59:26 -0500 Received: by mail-pd0-f171.google.com with SMTP id y13so4444540pdi.2 for ; Tue, 13 Jan 2015 08:59:26 -0800 (PST) X-Received: by 10.70.129.48 with SMTP id nt16mr51759640pdb.113.1421168366425; Tue, 13 Jan 2015 08:59:26 -0800 (PST) Received: from kamensky-w530.cisco.com (128-107-239-233.cisco.com. [128.107.239.233]) by mx.google.com with ESMTPSA id t13sm10203590pdj.61.2015.01.13.08.59.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 13 Jan 2015 08:59:25 -0800 (PST) From: Victor Kamensky To: Arnaldo Carvalho de Melo , Namhyung Kim Cc: Peter Zijlstra , Paul Mackerras , Ingo Molnar , Adrian Hunter , Jiri Olsa , Avi Kivity , Masami Hiramatsu , Anton Blanchard , David Ahern , Will Deacon , Dave Martin , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Victor Kamensky Subject: [PATCH 1/2] perf symbols: Ignore mapping symbols on aarch64 Date: Tue, 13 Jan 2015 08:59:03 -0800 Message-Id: <1421168344-5363-1-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 Sender: linux-kernel-owner@vger.kernel.org Precedence: list List-ID: X-Mailing-List: linux-kernel@vger.kernel.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: victor.kamensky@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.42 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Aarch64 ELF files use mapping symbols with special names $x, $d to identify regions of Aarch64 code (see Aarch64 ELF ABI - "ARM IHI 0056B", section "4.5.4 Mapping symbols"). The patch filters out these symbols at load time, similar to "696b97a perf symbols: Ignore mapping symbols on ARM" changes done for ARM before V8. Signed-off-by: Victor Kamensky Cc: Peter Zijlstra Cc: Paul Mackerras Cc: Ingo Molnar Cc: Arnaldo Carvalho de Melo Cc: Adrian Hunter Cc: Jiri Olsa Cc: Namhyung Kim Cc: Avi Kivity Cc: Masami Hiramatsu Cc: Anton Blanchard Cc: David Ahern Cc: Will Deacon Cc: Dave Martin --- tools/perf/util/symbol-elf.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 06fcd1b..1e188dd 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -862,6 +862,14 @@ int dso__load_sym(struct dso *dso, struct map *map, !strcmp(elf_name, "$t")) continue; } + /* Reject Aarch64 ELF "mapping symbols": these aren't unique and + * don't identify functions, so will confuse the profile + * output: */ + if (ehdr.e_machine == EM_AARCH64) { + if (!strcmp(elf_name, "$x") || + !strcmp(elf_name, "$d")) + continue; + } if (runtime_ss->opdsec && sym.st_shndx == runtime_ss->opdidx) { u32 offset = sym.st_value - syms_ss->opdshdr.sh_addr;