aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>2015-03-02 07:49:46 -0500
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-03-02 10:34:38 -0500
commit0104fe69e0287cf3635657b4c6b26a18e0091697 (patch)
treee20b5f4cccdfb5ccbbbee036671b3c3e64bb4674
parent79702f614187f652a814061e8f5875ddcc9e732d (diff)
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 <masami.hiramatsu.pt@hitachi.com> Cc: David Ahern <dsahern@gmail.com> Cc: Jiri Olsa <jolsa@redhat.com> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Naohiro Aota <naota@elisp.net> Cc: Peter Zijlstra <peterz@infradead.org> Link: http://lkml.kernel.org/r/20150302124946.9191.64085.stgit@localhost.localdomain Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/probe-finder.c5
1 files changed, 1 insertions, 4 deletions
diff --git a/tools/perf/util/probe-finder.c b/tools/perf/util/probe-finder.c
index d14193518e4d..46f009aa486c 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,
1345 const char *fname = NULL, *func = NULL, *basefunc = NULL, *tmp; 1345 const char *fname = NULL, *func = NULL, *basefunc = NULL, *tmp;
1346 int baseline = 0, lineno = 0, ret = 0; 1346 int baseline = 0, lineno = 0, ret = 0;
1347 1347
1348 /* Adjust address with bias */
1349 addr += dbg->bias;
1350
1351 /* Find cu die */ 1348 /* Find cu die */
1352 if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr - dbg->bias, &cudie)) { 1349 if (!dwarf_addrdie(dbg->dbg, (Dwarf_Addr)addr, &cudie)) {
1353 pr_warning("Failed to find debug information for address %lx\n", 1350 pr_warning("Failed to find debug information for address %lx\n",
1354 addr); 1351 addr);
1355 ret = -EINVAL; 1352 ret = -EINVAL;