From patchwork Thu Jan 22 04:52:56 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Victor Kamensky X-Patchwork-Id: 5682111 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 1AD7DC058D for ; Thu, 22 Jan 2015 04:55:47 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 4B79720353 for ; Thu, 22 Jan 2015 04:55:46 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.9]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 4538120351 for ; Thu, 22 Jan 2015 04:55:45 +0000 (UTC) Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1YE9mM-0002Ae-50; Thu, 22 Jan 2015 04:54:02 +0000 Received: from mail-pa0-f52.google.com ([209.85.220.52]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YE9m7-0001IL-7K for linux-arm-kernel@lists.infradead.org; Thu, 22 Jan 2015 04:53:48 +0000 Received: by mail-pa0-f52.google.com with SMTP id kx10so26968954pab.11 for ; Wed, 21 Jan 2015 20:53:26 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=gdCa5Hc8hMKezxXcQ8gj1rWsD4vn3hj/r5EW5lr/uyk=; b=WLHp6xlSo2bkFQV/KNEk32xo4kI8IzdZg6hjfoXrT/oHEfgZW4pHKSMCPnzdIHYzHS hpvpJp7B4Cll4OePl5i0+QZV9X6qFR26F/g7lVXmFk2yUpNvt+aIzCaVHJ1ro07u+3mP xOqK+5kBTP5++JlMYjWB58iYXqUhESjT3RYlJFTJmeg9xxdaoyOa4s4F5tuHHUH/VvxY 1DkPU2sT1C9qRGxbnUAcyPNbxP8hkgv7Rn2Ns9e1Ho9w6lGjNOBKeOm4l8/JjHxtzOEg ENqluHH81PfehICAudBEkzPgJLDXUQ3ixT7ystPZWMPc9AussOwWZaTHOvy8PThtH5C/ li+g== X-Gm-Message-State: ALoCoQnZlZ4Hu9xn1etvKpjYknAFESpDxwL51+hVVMy7TQQu9nySE8TfwYr7rcrskkOLRSMeYs+j X-Received: by 10.70.89.129 with SMTP id bo1mr20259691pdb.23.1421902406093; Wed, 21 Jan 2015 20:53:26 -0800 (PST) Received: from kamensky-w530.hsd1.ca.comcast.net ([24.6.73.122]) by mx.google.com with ESMTPSA id or4sm7800278pab.30.2015.01.21.20.53.24 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jan 2015 20:53:25 -0800 (PST) From: Victor Kamensky To: Arnaldo Carvalho de Melo , Namhyung Kim , David Ahern , Will Deacon Subject: [PATCH V2 1/3] perf symbols: Ignore mapping symbols on aarch64 Date: Wed, 21 Jan 2015 20:52:56 -0800 Message-Id: <1421902378-3634-2-git-send-email-victor.kamensky@linaro.org> X-Mailer: git-send-email 1.8.1.4 In-Reply-To: <1421902378-3634-1-git-send-email-victor.kamensky@linaro.org> References: <1421902378-3634-1-git-send-email-victor.kamensky@linaro.org> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150121_205347_310752_80CECCBB X-CRM114-Status: GOOD ( 10.60 ) X-Spam-Score: -0.7 (/) Cc: Avi Kivity , Russell King , Peter Zijlstra , Victor Kamensky , Adrian Hunter , linux-kernel@vger.kernel.org, Ingo Molnar , Paul Mackerras , Anton Blanchard , Masami Hiramatsu , Jiri Olsa , Dave Martin , linux-arm-kernel@lists.infradead.org X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_MED, T_RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 Acked-by: Will Deacon --- 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;