aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRabin Vincent <rabin.vincent@axis.com>2015-10-29 03:49:36 -0400
committerArnaldo Carvalho de Melo <acme@redhat.com>2015-10-29 16:48:38 -0400
commit7ed4915ad60788d6b846e2cd034f49ee15698143 (patch)
tree81cc1a59203c393286dba3e76daa343f5c35b127
parent3af6ed84eb43c587beb5f3252222e39e65d08c61 (diff)
perf unwind: Pass symbol source to libunwind
Even if --symfs is used to point to the debug binaries, we send in the non-debug filenames to libunwind, which leads to libunwind not finding the debug frame. Fix this by preferring the file in --symfs, if it is available. Signed-off-by: Rabin Vincent <rabin.vincent@axis.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Peter Zijlstra <a.p.zijlstra@chello.nl> Cc: Rabin Vincent <rabinv@axis.com> Link: http://lkml.kernel.org/r/1446104978-26429-1-git-send-email-rabin.vincent@axis.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
-rw-r--r--tools/perf/util/unwind-libunwind.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c
index f729f9e99f99..c83832b555e5 100644
--- a/tools/perf/util/unwind-libunwind.c
+++ b/tools/perf/util/unwind-libunwind.c
@@ -360,12 +360,15 @@ find_proc_info(unw_addr_space_t as, unw_word_t ip, unw_proc_info_t *pi,
360 int fd = dso__data_get_fd(map->dso, ui->machine); 360 int fd = dso__data_get_fd(map->dso, ui->machine);
361 int is_exec = elf_is_exec(fd, map->dso->name); 361 int is_exec = elf_is_exec(fd, map->dso->name);
362 unw_word_t base = is_exec ? 0 : map->start; 362 unw_word_t base = is_exec ? 0 : map->start;
363 const char *symfile;
363 364
364 if (fd >= 0) 365 if (fd >= 0)
365 dso__data_put_fd(map->dso); 366 dso__data_put_fd(map->dso);
366 367
368 symfile = map->dso->symsrc_filename ?: map->dso->name;
369
367 memset(&di, 0, sizeof(di)); 370 memset(&di, 0, sizeof(di));
368 if (dwarf_find_debug_frame(0, &di, ip, base, map->dso->name, 371 if (dwarf_find_debug_frame(0, &di, ip, base, symfile,
369 map->start, map->end)) 372 map->start, map->end))
370 return dwarf_search_unwind_table(as, ip, &di, pi, 373 return dwarf_search_unwind_table(as, ip, &di, pi,
371 need_unwind_info, arg); 374 need_unwind_info, arg);