From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756196AbbCNHEG (ORCPT ); Sat, 14 Mar 2015 03:04:06 -0400 Received: from terminus.zytor.com ([198.137.202.10]:40198 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751194AbbCNHD4 (ORCPT ); Sat, 14 Mar 2015 03:03:56 -0400 Date: Sat, 14 Mar 2015 00:03:24 -0700 From: tip-bot for Namhyung Kim Message-ID: Cc: namhyung@kernel.org, masami.hiramatsu.pt@hitachi.com, hpa@zytor.com, peterz@infradead.org, dsahern@gmail.com, mingo@kernel.org, jolsa@redhat.com, tglx@linutronix.de, naota@elisp.net, acme@redhat.com, linux-kernel@vger.kernel.org Reply-To: tglx@linutronix.de, naota@elisp.net, acme@redhat.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, masami.hiramatsu.pt@hitachi.com, hpa@zytor.com, peterz@infradead.org, mingo@kernel.org, dsahern@gmail.com, jolsa@redhat.com In-Reply-To: <20150306073127.6904.3232.stgit@localhost.localdomain> References: <20150306073127.6904.3232.stgit@localhost.localdomain> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf symbols: Allow symbol alias when loading map for symbol name Git-Commit-ID: 680d926a8cb08dd9cf173e2bb93d4a4477771949 X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: 680d926a8cb08dd9cf173e2bb93d4a4477771949 Gitweb: http://git.kernel.org/tip/680d926a8cb08dd9cf173e2bb93d4a4477771949 Author: Namhyung Kim AuthorDate: Fri, 6 Mar 2015 16:31:27 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Thu, 12 Mar 2015 12:39:54 -0300 perf symbols: Allow symbol alias when loading map for symbol name When perf probe tries to add a probe in a binary using symbol name, it sometimes failed since some symbols were discard during loading dso. When it resolves an address to symbol, it'd be better to have just one symbol at given address. But for finding address from symbol, it'd be better to keep all names (including aliases). So allow tools to state that they want to allow aliases via symbol_conf.allow_aliases. Signed-off-by: Namhyung Kim Acked-by: Masami Hiramatsu Cc: David Ahern Cc: Ingo Molnar Cc: Jiri Olsa Cc: Naohiro Aota Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20150306073127.6904.3232.stgit@localhost.localdomain [ Original patch passwd allow_alias to many functions, use symbol_conf.allow_aliases instead ] Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/probe-event.c | 1 + tools/perf/util/symbol-elf.c | 3 ++- tools/perf/util/symbol.h | 1 + 3 files changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/util/probe-event.c b/tools/perf/util/probe-event.c index c379ea0..9feba0e 100644 --- a/tools/perf/util/probe-event.c +++ b/tools/perf/util/probe-event.c @@ -80,6 +80,7 @@ static int init_symbol_maps(bool user_only) int ret; symbol_conf.sort_by_name = true; + symbol_conf.allow_aliases = true; ret = symbol__init(NULL); if (ret < 0) { pr_debug("Failed to init symbol map.\n"); diff --git a/tools/perf/util/symbol-elf.c b/tools/perf/util/symbol-elf.c index ada1676..62742e4 100644 --- a/tools/perf/util/symbol-elf.c +++ b/tools/perf/util/symbol-elf.c @@ -1048,7 +1048,8 @@ new_symbol: * For misannotated, zeroed, ASM function sizes. */ if (nr > 0) { - symbols__fixup_duplicate(&dso->symbols[map->type]); + if (!symbol_conf.allow_aliases) + symbols__fixup_duplicate(&dso->symbols[map->type]); symbols__fixup_end(&dso->symbols[map->type]); if (kmap) { /* diff --git a/tools/perf/util/symbol.h b/tools/perf/util/symbol.h index 1650dcb..efdaaa5 100644 --- a/tools/perf/util/symbol.h +++ b/tools/perf/util/symbol.h @@ -87,6 +87,7 @@ struct symbol_conf { ignore_vmlinux_buildid, show_kernel_path, use_modules, + allow_aliases, sort_by_name, show_nr_samples, show_total_period,