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: Victor Kamensky X-Patchwork-Id: 5682121 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 737489F357 for ; Thu, 22 Jan 2015 04:56:27 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id E3FCD20353 for ; Thu, 22 Jan 2015 04:56:23 +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 D0D5920351 for ; Thu, 22 Jan 2015 04:56:22 +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 1YE9mj-0002aE-4X; Thu, 22 Jan 2015 04:54:25 +0000 Received: from mail-pa0-f50.google.com ([209.85.220.50]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1YE9m9-0001Lc-TL for linux-arm-kernel@lists.infradead.org; Thu, 22 Jan 2015 04:53:51 +0000 Received: by mail-pa0-f50.google.com with SMTP id bj1so57578086pad.9 for ; Wed, 21 Jan 2015 20:53:28 -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=BlMdc7O0xE1L8jF/ol+LH6qFtU/AId2k7Ir0oy1bgu4=; b=MZMEKyuU9MMWaYCXczMeS/rHhywHRrkXVB9w4ZtfZeo4Jl89OlLi9GB9bJwHSyJnk3 Tw6pA/AC3zREdqqYj43COiwk0at5Y/XDSTtLEqbSPvxrnIqb0aOQj7ut3QFR5PkNHkb9 OSH6G/3wSI3+TKUKEMXtBONCxGSaJmxcma4kqT++bB6uwaJbP83c1cLe2pW3eh71tT44 JwXvVWUZ7tQfzpLdTz//4oWe6velS9q+VBLm0dds1UiHM02CL6f8LXMiJocBQ1FmPw1U BiGEY0R+dDXeDeWdylWfvWF0prB4s7q29N+kE7tArpCOjTMzcSOgY4TqdA6q2wa4nC3j DIzA== X-Gm-Message-State: ALoCoQmggWy8xgv924u4wTmBh+tPm6mqwa1mzqi43370TZLjFTJNjKjPjtkZvgDptPkwZW91H+Yb 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 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> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20150121_205350_001373_B0C9B687 X-CRM114-Status: GOOD ( 10.76 ) 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 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; }