From: Rabin Vincent Date: Thu, 29 Oct 2015 07:49:36 +0000 (+0100) Subject: perf unwind: Pass symbol source to libunwind X-Git-Tag: v4.4-rc1~155^2^2 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=7ed4915ad60788d6b846e2cd034f49ee15698143;p=profile%2Fcommon%2Fplatform%2Fkernel%2Flinux-artik7.git 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 Cc: Jiri Olsa Cc: Namhyung Kim Cc: Peter Zijlstra Cc: Rabin Vincent Link: http://lkml.kernel.org/r/1446104978-26429-1-git-send-email-rabin.vincent@axis.com Signed-off-by: Arnaldo Carvalho de Melo --- diff --git a/tools/perf/util/unwind-libunwind.c b/tools/perf/util/unwind-libunwind.c index f729f9e..c83832b 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, int fd = dso__data_get_fd(map->dso, ui->machine); int is_exec = elf_is_exec(fd, map->dso->name); unw_word_t base = is_exec ? 0 : map->start; + const char *symfile; if (fd >= 0) dso__data_put_fd(map->dso); + symfile = map->dso->symsrc_filename ?: map->dso->name; + memset(&di, 0, sizeof(di)); - if (dwarf_find_debug_frame(0, &di, ip, base, map->dso->name, + if (dwarf_find_debug_frame(0, &di, ip, base, symfile, map->start, map->end)) return dwarf_search_unwind_table(as, ip, &di, pi, need_unwind_info, arg);