From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755364AbbCCG1V (ORCPT ); Tue, 3 Mar 2015 01:27:21 -0500 Received: from terminus.zytor.com ([198.137.202.10]:49379 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752698AbbCCG1T (ORCPT ); Tue, 3 Mar 2015 01:27:19 -0500 Date: Mon, 2 Mar 2015 22:26:08 -0800 From: tip-bot for Masami Hiramatsu Message-ID: Cc: masami.hiramatsu.pt@hitachi.com, tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org, dsahern@gmail.com, linux-kernel@vger.kernel.org, hpa@zytor.com, jolsa@redhat.com, naota@elisp.net, acme@redhat.com, namhyung@kernel.org Reply-To: masami.hiramatsu.pt@hitachi.com, tglx@linutronix.de, peterz@infradead.org, mingo@kernel.org, dsahern@gmail.com, jolsa@redhat.com, hpa@zytor.com, linux-kernel@vger.kernel.org, namhyung@kernel.org, naota@elisp.net, acme@redhat.com In-Reply-To: <20150302124946.9191.64085.stgit@localhost.localdomain> References: <20150302124946.9191.64085.stgit@localhost.localdomain> To: linux-tip-commits@vger.kernel.org Subject: [tip:perf/core] perf probe: Remove bias offset to find probe point by address Git-Commit-ID: 0104fe69e0287cf3635657b4c6b26a18e0091697 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: 0104fe69e0287cf3635657b4c6b26a18e0091697 Gitweb: http://git.kernel.org/tip/0104fe69e0287cf3635657b4c6b26a18e0091697 Author: Masami Hiramatsu AuthorDate: Mon, 2 Mar 2015 21:49:46 +0900 Committer: Arnaldo Carvalho de Melo CommitDate: Mon, 2 Mar 2015 12:34:38 -0300 perf probe: Remove bias offset to find probe point by address Remove bias offset to find probe point by address. Without this patch, probe points on kernel and executables are shown correctly, but do not work with libraries: # ./perf probe -l probe:do_fork (on do_fork@kernel/fork.c) probe_libc:malloc (on malloc in /usr/lib64/libc-2.17.so) probe_perf:strlist__new (on strlist__new@util/strlist.c in /home/mhiramat/ksrc/linux-3/tools/perf/perf) Removing bias allows it to show it as real place: # ./perf probe -l probe:do_fork (on do_fork@kernel/fork.c) probe_libc:malloc (on __libc_malloc@malloc/malloc.c in /usr/lib64/libc-2.17.so) probe_perf:strlist__new (on strlist__new@util/strlist.c in /home/mhiramat/ksrc/linux-3/tools/perf/perf) Signed-off-by: Masami Hiramatsu Cc: David Ahern Cc: Jiri Olsa Cc: Namhyung Kim Cc: Naohiro Aota Cc: Peter Zijlstra Link: http://lkml.kernel.org/r/20150302124946.9191.64085.stgit@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo --- tools/perf/util/probe-finder.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c index d141935..46f009a 100644 --- a/tools/perf/util/probe-finder.c +++ b/tools/perf/util/probe-finder.c @@ -1345,11 +1345,8 @@ int debuginfo__find_probe_point(struct debuginfo *dbg, unsigned long addr, const char *fname = NULL, *func = NULL, *basefunc = NULL, *tmp; int baseline = 0, lineno = 0, ret = 0; - /* Adjust address with bias */ - addr += dbg->bias; - /* Find cu die */ - if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr - dbg->bias, &cudie)) { + if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr, &cudie)) { pr_warning("Failed to find debug information for address %lx\n", addr); ret = -EINVAL;