]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
perf test: Add kallsyms split test
authorNamhyung Kim <namhyung@kernel.org>
Tue, 2 Dec 2025 23:57:18 +0000 (15:57 -0800)
committerNamhyung Kim <namhyung@kernel.org>
Wed, 3 Dec 2025 05:59:15 +0000 (21:59 -0800)
commit34e271ae55382fbdb04f3e13e856457d8e0dee45
tree74733c2538f5d56c975f6e3930422ab6c4b893ed
parent4fba95fc383f9231ba486512ee1c9d60b8f4a9a4
perf test: Add kallsyms split test

Create a fake root directory for /proc/{version,modules,kallsyms} in
/tmp for testing.  The kallsyms has a bad symbol in the module and it
causes the main map splitted.  The test ensures it only has two maps -
kernel and the module and it finds the initial map after the module
without creating the split maps like [kernel].0 and so on.

  $ perf test -vv "split kallsyms"
   69: split kallsyms:
  --- start ---
  test child forked, pid 1016196
  try to create fake root directory
  create kernel maps from the fake root directory
  maps__set_modules_path_dir: cannot open /tmp/perf-test.Zrv6Sy/lib/modules/X.Y.Z dir
  Problems setting modules path maps, continuing anyway...
  Failed to open /tmp/perf-test.Zrv6Sy/proc/kcore. Note /proc/kcore requires CAP_SYS_RAWIO capability to access.
  Using /tmp/perf-test.Zrv6Sy/proc/kallsyms for symbols
  kernel map loaded - check symbol and map
  ---- end(0) ----
   69: split kallsyms                                                  : Ok

Reviewed-by: Ian Rogers <irogers@google.com>
Signed-off-by: Namhyung Kim <namhyung@kernel.org>
tools/perf/tests/Build
tools/perf/tests/builtin-test.c
tools/perf/tests/kallsyms-split.c [new file with mode: 0644]
tools/perf/tests/tests.h