]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf tools: Add layout support for --symfs option
authorChangbin Du <changbin.du@huawei.com>
Mon, 9 Mar 2026 17:44:12 +0000 (17:44 +0000)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 11 Mar 2026 06:13:30 +0000 (23:13 -0700)
commitf182573e06abb635f320b0fd0e60972c4c2467c5
treed5c1ea33d3b9d933b84e5026150a577774d5d14e
parent86ff690f45cc034ab32246630b3c7d7a46d1ae6b
perf tools: Add layout support for --symfs option

Add support for parsing an optional layout parameter in the --symfs
command line option. The format is:

  --symfs <directory[,layout]>

Where layout can be:
  - 'hierarchy': matches full path (default)
  - 'flat': only matches base name

When debugging symbol files from a copy of the filesystem (e.g., from a
container or remote machine), the debug files are often stored in a
flat directory structure with only filenames, not the full original
paths. In this case, using 'flat' layout allows perf to find debug
symbols by matching only the filename rather than the full path.

For example, given a binary path like:
  /build/output/lib/foo.so

With 'perf report --symfs /debug/files,flat', perf will look for:
  /debug/files/foo.so

Instead of:
  /debug/files/build/output/lib/foo.so

This is particularly useful when:
- Extracting debug files from containers with different directory layouts
- Working with build systems that flatten directory structures

Signed-off-by: Changbin Du <changbin.du@huawei.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
20 files changed:
tools/perf/Documentation/perf-annotate.txt
tools/perf/Documentation/perf-diff.txt
tools/perf/Documentation/perf-kwork.txt
tools/perf/Documentation/perf-probe.txt
tools/perf/Documentation/perf-report.txt
tools/perf/Documentation/perf-sched.txt
tools/perf/Documentation/perf-script.txt
tools/perf/Documentation/perf-timechart.txt
tools/perf/Documentation/tips.txt
tools/perf/builtin-annotate.c
tools/perf/builtin-diff.c
tools/perf/builtin-kwork.c
tools/perf/builtin-probe.c
tools/perf/builtin-report.c
tools/perf/builtin-sched.c
tools/perf/builtin-script.c
tools/perf/builtin-timechart.c
tools/perf/util/symbol.c
tools/perf/util/symbol.h
tools/perf/util/symbol_conf.h