Commit e6d7c91c authored by Masami Hiramatsu's avatar Masami Hiramatsu Committed by Arnaldo Carvalho de Melo

perf probe: Fix to get ummapped symbol address on kernel

Fix to get correctly unmapped symbol address on kernel.  This allows us
to probe on syscall symbols which are aliases of SyS_ functions with
using debuginfo.

Without this fix:
  ----
  # ./perf probe -a sys_write
  Failed to find debug information for address 3b0100
  Probe point 'sys_write' not found.
    Error: Failed to add events.
  ----
The address 0x3b0100 is a mapped address, and not usable
in debuginfo.

With this fix:
  ----
  # ./perf probe -a sys_write
  Added new event:
    probe:sys_write      (on sys_write)

  You can now use it in all perf tools, such as:

          perf record -e probe:sys_write -aR sleep 1
  ----
Signed-off-by: default avatarMasami Hiramatsu <masami.hiramatsu.pt@hitachi.com>
Cc: He Kuang <hekuang@huawei.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Wang Nan <wangnan0@huawei.com>
Link: http://lkml.kernel.org/r/20150322114022.32639.19096.stgit@localhost.localdomainSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 228f14f2
......@@ -310,7 +310,10 @@ static int find_alternative_probe_point(struct debuginfo *dinfo,
/* Find the address of given function */
map__for_each_symbol_by_name(map, pp->function, sym) {
address = sym->start;
if (uprobes)
address = sym->start;
else
address = map->unmap_ip(map, sym->start);
break;
}
if (!address) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment