Re: [PATCH] perf symbols: Don't apply the symfs layout to synthesised paths
From: Zhan Xusheng
Date: Mon Aug 17 2026 - 22:08:52 EST
On Mon, 17 Aug 2026 14:42:26 -0700, Ian Rogers wrote:
> Would it be possible to provide a before and after the
> patch so we can better appreciate the issue you are fixing?
Two builds of 8d3ae59288f1 differing only by the patch, empty /tmp/s:
perf record -o pd.data -- sleep 0.3
strace -f -e trace=openat,newfstatat \
perf report -i pd.data --symfs /tmp/s,flat --stdio
15 paths get tried under /tmp/s. Four of them differ. Before:
/tmp/s/debug/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
/tmp/s/debug/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
/tmp/s/debug/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2.debug
/tmp/s/f5/8808c9c8a388055b126492a1706d732761f86e.debug
After:
/tmp/s//usr/lib/debug/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
/tmp/s//usr/lib/debug/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2
/tmp/s//usr/lib/debug/usr/lib/x86_64-linux-gnu/ld-linux-x86-64.so.2.debug
/tmp/s//usr/lib/debug/.build-id/f5/8808c9c8a388055b126492a1706d732761f86e.debug
The first three are FEDORA, UBUNTU and MIXEDUP_UBUNTU, the fourth
BUILDID_DEBUGINFO. What the old ones have in common is the shape: the
prefix perf supplied is flattened while dso__long_name() is still appended
whole, so they follow neither 'flat' nor 'hierarchy'.
Among the 11 unchanged paths are the basename lookups the option exists
for, so it keeps working:
/tmp/s/ld-linux-x86-64.so.2
/tmp/s/sleep
/tmp/s/vmlinux
The same trace with ,hierarchy is identical between the two builds. The
doubled slash is path__join() on a component starting with '/', present
without the patch too, in 7 of the 15.
I will add this to the changelog in v2.
Thanks,
Zhan Xusheng