Skip to contentSkip to conversation

perf: unwind: Fix symfs with libdw

PATCH Superseded Vincent Whitchurch 1 participant 1 message Nov 25, 2022 perf events

v1 of 2 Superseded Latest is v2 →

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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'"

---
 tools/perf/util/unwind-libdw.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)
tools/perf/util/unwind-libdw.c +6 -2
index 94aa40f6e348..1915c9769dbe 100644
@@ -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,
 				      al->map->start - al->map->pgoff, false);
+	}
 	if (!mod) {
 		char filename[PATH_MAX];
 
Signature · 1 line
2.34.1