]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/commitdiff
perf unwind: Pass symbol source to libunwind
authorRabin Vincent <rabin.vincent@axis.com>
Thu, 29 Oct 2015 07:49:36 +0000 (08:49 +0100)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Thu, 29 Oct 2015 20:48:38 +0000 (17:48 -0300)
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>
tools/perf/util/unwind-libunwind.c

index f729f9e99f9979bc5802deb8a57136277c7f6e7c..c83832b555e580a771c1a831e1d18b3b5df135ac 100644 (file)
@@ -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);