From patchwork Thu Jan 22 04:52:57 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: vkamensky X-Patchwork-Id: 43489 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wg0-f72.google.com (mail-wg0-f72.google.com [74.125.82.72]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id B5D0D218DB for ; Thu, 22 Jan 2015 04:54:06 +0000 (UTC) Received: by mail-wg0-f72.google.com with SMTP id l18sf9715537wgh.3 for ; Wed, 21 Jan 2015 20:54:06 -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=bsrppp5jO4eQ4pZ1OqlFAr5kIpAP6ogkuh3DIle3Mok=; b=clxEm/4znftXzFPNQ3yvq/jggpJVwh/bGfQZqUK4quL/dkBFdZnKbmbEBiUBpIDhx5 PoBiQJRukZMxocJKLmuLvkg+eIDSIP18tBNY/HwvgFvX9rfEPsV3GcxkfNiutGD50uFe kZNIoG5zgqQM7LO80R627xsd5415CQ6KvjfEpf3YE8pDQONF4Qiul4FoWURjIiSmwQM1 NyIHcG6jQ4bm2ZX3I3NTM/P/j5PESV3lWg2uSc1ssqwTs0z/ASWOAHJewVm0hI3xefzI A4w9ElJevr2kMgeFDX/E6EwCst287Mxh4JlTCARGoACXHME/HbtwtZRRtBwAKOCYXLS0 N9xg== X-Gm-Message-State: ALoCoQmj72VKDOX5gD7YYIvh2UoaPBsXTZcmT7T3TA5R9GZAZ0IOlDcqpeJZWVGcLD9I2wc+tcaT X-Received: by 10.194.201.10 with SMTP id jw10mr26847wjc.3.1421902445961; Wed, 21 Jan 2015 20:54:05 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.29.202 with SMTP id m10ls107451lah.76.gmail; Wed, 21 Jan 2015 20:54:05 -0800 (PST) X-Received: by 10.152.18.135 with SMTP id w7mr46610540lad.47.1421902445693; Wed, 21 Jan 2015 20:54:05 -0800 (PST) Received: from mail-lb0-f174.google.com (mail-lb0-f174.google.com. [209.85.217.174]) by mx.google.com with ESMTPS id u14si4531216laz.93.2015.01.21.20.54.05 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Wed, 21 Jan 2015 20:54:05 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.174 as permitted sender) client-ip=209.85.217.174; Received: by mail-lb0-f174.google.com with SMTP id f15so4203437lbj.5 for ; Wed, 21 Jan 2015 20:54:05 -0800 (PST) X-Received: by 10.152.180.136 with SMTP id do8mr21691251lac.31.1421902445567; Wed, 21 Jan 2015 20:54:05 -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 c8csp136769lbb; Wed, 21 Jan 2015 20:54:03 -0800 (PST) X-Received: by 10.68.231.102 with SMTP id tf6mr68349887pbc.40.1421902442791; Wed, 21 Jan 2015 20:54:02 -0800 (PST) Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id yg1si10759456pbb.119.2015.01.21.20.54.01; Wed, 21 Jan 2015 20:54:02 -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 S1754508AbbAVEx5 (ORCPT + 28 others); Wed, 21 Jan 2015 23:53:57 -0500 Received: from mail-pa0-f50.google.com ([209.85.220.50]:44926 "EHLO mail-pa0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753814AbbAVEx2 (ORCPT ); Wed, 21 Jan 2015 23:53:28 -0500 Received: by mail-pa0-f50.google.com with SMTP id bj1so57578093pad.9 for ; Wed, 21 Jan 2015 20:53:28 -0800 (PST) X-Received: by 10.70.133.35 with SMTP id oz3mr59238381pdb.69.1421902407966; Wed, 21 Jan 2015 20:53:27 -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.26 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 21 Jan 2015 20:53:27 -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 2/3] perf symbols: improve abi compliance in arm mapping symbols handling Date: Wed, 21 Jan 2015 20:52:57 -0800 Message-Id: <1421902378-3634-3-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.174 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: , Both Arm and Aarch64 ELF ABI allow mapping symbols be in from either "$d" or "$d.". But current code that handles mapping symbols only deals with the first, dollar character and a single letter, case. The patch adds handling of the second case with period followed by any characters. Suggested-by: Russell King Suggested-by: Will Deacon Signed-off-by: Victor Kamensky Acked-by: Will Deacon 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: Dave Martin --- tools/perf/util/symbol-elf.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index 1e188dd..7fd35d6 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -857,17 +857,16 @@ int dso__load_sym(struct dso *dso, struct map *map, * don't identify functions, so will confuse the profile * output: */ if (ehdr.e_machine == EM_ARM) { - if (!strcmp(elf_name, "$a") || - !strcmp(elf_name, "$d") || - !strcmp(elf_name, "$t")) + if (elf_name[0] == '$' && strchr("adt", elf_name[1]) + && (elf_name[2] == '\0' || elf_name[2] == '.')) 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")) + if (elf_name[0] == '$' && strchr("dx", elf_name[1]) + && (elf_name[2] == '\0' || elf_name[2] == '.')) continue; }