aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tools/perf/util/unwind-libdw.c
diff options
context:
space:
mode:
authorVincent Whitchurch <vincent.whitchurch@axis.com>2023-06-30 11:11:48 +0200
committerNamhyung Kim <namhyung@kernel.org>2023-07-01 11:12:22 -0700
commit5f06267b6e6a10dd0cac4eb248fcc51f18c260cc (patch)
tree6ea70dfb269785290e5c4cd7fbe9799a90a5b377 /tools/perf/util/unwind-libdw.c
parentperf symbol: Fix uninitialized return value in symbols__find_by_name() (diff)
downloadwireguard-linux-5f06267b6e6a10dd0cac4eb248fcc51f18c260cc.tar.xz
wireguard-linux-5f06267b6e6a10dd0cac4eb248fcc51f18c260cc.zip
perf: unwind: Fix symfs with libdw
Pass the full path including the symfs (if any) to libdw. Without this unwinding fails with errors like this when a symfs is used: unwind: failed with 'No such file or directory'" Signed-off-by: Vincent Whitchurch <vincent.whitchurch@axis.com> Acked-by: Namhyung Kim <namhyung@kernel.org> Cc: Mark Rutland <mark.rutland@arm.com> Cc: kernel@axis.com Cc: Ian Rogers <irogers@google.com> Cc: Peter Zijlstra <peterz@infradead.org> Cc: Adrian Hunter <adrian.hunter@intel.com> Cc: Arnaldo Carvalho de Melo <acme@kernel.org> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com> Cc: Ingo Molnar <mingo@redhat.com> Link: https://lore.kernel.org/r/20230630-perf-libdw-symfs-v2-1-469760dd4d5b@axis.com Signed-off-by: Namhyung Kim <namhyung@kernel.org>
Diffstat (limited to 'tools/perf/util/unwind-libdw.c')
-rw-r--r--tools/perf/util/unwind-libdw.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/tools/perf/util/unwind-libdw.c b/tools/perf/util/unwind-libdw.c
index 83eea968482e..2a96df4c8d42 100644
--- a/tools/perf/util/unwind-libdw.c
+++ b/tools/perf/util/unwind-libdw.c
@@ -66,9 +66,13 @@ static int __report_module(struct addr_location *al, u64 ip,
mod = 0;
}
- if (!mod)
- mod = dwfl_report_elf(ui->dwfl, dso->short_name, dso->long_name, -1,
+ if (!mod) {
+ char filename[PATH_MAX];
+
+ __symbol__join_symfs(filename, sizeof(filename), dso->long_name);
+ mod = dwfl_report_elf(ui->dwfl, dso->short_name, filename, -1,
map__start(al->map) - map__pgoff(al->map), false);
+ }
if (!mod) {
char filename[PATH_MAX];