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: vkamensky X-Patchwork-Id: 43490 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-we0-f198.google.com (mail-we0-f198.google.com [74.125.82.198]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 561BD218DB for ; Thu, 22 Jan 2015 04:54:14 +0000 (UTC) Received: by mail-we0-f198.google.com with SMTP id q59sf3481035wes.1 for ; Wed, 21 Jan 2015 20:54:13 -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:in-reply-to:references:sender:precedence:list-id :x-original-sender:x-original-authentication-results:mailing-list :list-post:list-help:list-archive:list-unsubscribe; bh=Z4zI4bRdZbxsh+MjoJHhR4UipDettf43MCKmfyz2wnM=; b=cPjykdvgpnQxEfpAGFTzHbT1Tqe5MvpGeBJpqzEYi412V9Ove97ccJnzW+3HRPdgUg 3twSCTuhy/UGsgznj1OK+oI54d1i7IOZV0+lP6vXIzesY67f4cHBxTmj3aRInj4Dpmwh 9LJEQJnyLu5FHcTLv9GsgegreejJixwtlSqBbV6UBYjFg+oUoFU5J00YvwK4gznKNO+k Pje9zwWqJrBwNgiXG1aFCnOqCYAN4D0eJwrSF7xqo4SQLqxy31xUoGJre6vDdvSzPrUl 7dXlxWGMRqtlOe/PWZEF93FlzmeUWxOjMBgd3OoiSB8T7a6r7q2+/BEMlT7TawGiTxSt Mrlg== X-Gm-Message-State: ALoCoQn2oTVxprk0m6XCO/PBWH8QTCjs1fpX3DHwTaRvR2rVLwJ/SCsAceJnoZfKnvPnr6kqOd8w X-Received: by 10.180.13.83 with SMTP id f19mr87582wic.7.1421902453674; Wed, 21 Jan 2015 20:54:13 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.36.100 with SMTP id p4ls135063laj.24.gmail; Wed, 21 Jan 2015 20:54:13 -0800 (PST) X-Received: by 10.112.162.226 with SMTP id yd2mr41599374lbb.1.1421902453476; Wed, 21 Jan 2015 20:54:13 -0800 (PST) Received: from mail-lb0-f170.google.com (mail-lb0-f170.google.com. [209.85.217.170]) by mx.google.com with ESMTPS id wm7si19710355lbb.72.2015.01.21.20.54.13 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 20:54:13 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.170 as permitted sender) client-ip=209.85.217.170; Received: by mail-lb0-f170.google.com with SMTP id w7so4201012lbi.1 for ; Wed, 21 Jan 2015 20:54:13 -0800 (PST) X-Received: by 10.152.27.8 with SMTP id p8mr41436155lag.69.1421902453369; Wed, 21 Jan 2015 20:54:13 -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 c8csp136799lbb; Wed, 21 Jan 2015 20:54:12 -0800 (PST) X-Received: by 10.70.135.165 with SMTP id pt5mr66908672pdb.37.1421902451471; Wed, 21 Jan 2015 20:54:11 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id d5si3813465pdp.58.2015.01.21.20.54.10; Wed, 21 Jan 2015 20:54:11 -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 S1754559AbbAVEyH (ORCPT + 28 others); Wed, 21 Jan 2015 23:54:07 -0500 Received: from mail-pd0-f170.google.com ([209.85.192.170]:37054 "EHLO mail-pd0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753480AbbAVEx0 (ORCPT ); Wed, 21 Jan 2015 23:53:26 -0500 Received: by mail-pd0-f170.google.com with SMTP id p10so42586359pdj.1 for ; Wed, 21 Jan 2015 20:53:26 -0800 (PST) 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 Cc: Russell King , Peter Zijlstra , Paul Mackerras , Ingo Molnar , Adrian Hunter , Jiri Olsa , Avi Kivity , Masami Hiramatsu , Anton Blanchard , Dave Martin , linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, Victor Kamensky 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> 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.217.170 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 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;