Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Rabin Vincent and committed by
Arnaldo Carvalho de Melo
7ed4915a 3af6ed84

+4 -1
+4 -1
tools/perf/util/unwind-libunwind.c
··· 360 360 int fd = dso__data_get_fd(map->dso, ui->machine); 361 361 int is_exec = elf_is_exec(fd, map->dso->name); 362 362 unw_word_t base = is_exec ? 0 : map->start; 363 + const char *symfile; 363 364 364 365 if (fd >= 0) 365 366 dso__data_put_fd(map->dso); 366 367 368 + symfile = map->dso->symsrc_filename ?: map->dso->name; 369 + 367 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 372 map->start, map->end)) 370 373 return dwarf_search_unwind_table(as, ip, &di, pi, 371 374 need_unwind_info, arg);