Re: [PATCH] perf symbols: Don't apply the symfs layout to synthesised paths

Zhan Xusheng <[email protected]>
Newsgroups gmane.linux.kernel,gmane.linux.kernel.perf.user
Message-ID <[email protected]>
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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.