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: Victor Kamensky X-Patchwork-Id: 5622461 Return-Path: X-Original-To: patchwork-linux-arm@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 185D09F2ED for ; Tue, 13 Jan 2015 17:02:11 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2355F202F8 for ; Tue, 13 Jan 2015 17:02:08 +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 35A44202F2 for ; Tue, 13 Jan 2015 17:02:07 +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 1YB4oq-00066C-HI; Tue, 13 Jan 2015 16:59:52 +0000 Received: from mail-pa0-f46.google.com ([209.85.220.46]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YB4om-00061v-8j for linux-arm-kernel@lists.infradead.org; Tue, 13 Jan 2015 16:59:48 +0000 Received: by mail-pa0-f46.google.com with SMTP id lf10so4709229pab.5 for ; Tue, 13 Jan 2015 08:59: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; bh=LSXf4Ln0yjyB8Y7pXf1yDZimlyOD8I6unokkT8LpLUA=; b=GkFkwr4uIkYLtOi1M0xPu4EyQ5XKTOJF4lBY1aF6nYex7MDjBmQ0VKJ5F7pDNx0ik3 3/0zaIeJy9l1XIEpCeeG/r1WgPjwlw7/9Toho8KFCQtODPZOW6XAqJpvtnyFPRcRIQBi i9qYGL6JwfzBBdTiI6yFzOingulliEykPgv1mUwbyQRbUWNRnIzRgUCsNKhi9ZGrjHFi ndBw73onhoEBjPIyPxNZX1AhlEevP5y/1GpaP1vLR7pPs+we73D6WPSXGCj7BT1oIzM2 Fl/PCZ2NndGnU6TdbyHictVOfCe5ke/nYAbgVMWE/LoL9SJQI2zxOE9NaCEv+ElWvaUp 0xkg== X-Gm-Message-State: ALoCoQl9XppsOk/CaHWdTl/J7kCyR/1DeubvopQ1ZDIsdoyvDCA3c01MHVdf+23yb/tlkYU0Pmfc 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 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150113_085948_332170_CA6833F7 X-CRM114-Status: UNSURE ( 9.92 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -0.7 (/) Cc: Avi Kivity , Peter Zijlstra , Victor Kamensky , Will Deacon , Adrian Hunter , linux-kernel@vger.kernel.org, Ingo Molnar , Paul Mackerras , Anton Blanchard , David Ahern , 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 --- 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;