]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
perf test: Fix "trace summary" test for musl-based systems
authorMartin Kaiser <martin@kaiser.cx>
Tue, 28 Apr 2026 14:38:48 +0000 (16:38 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Mon, 11 May 2026 17:16:38 +0000 (14:16 -0300)
commite1c19cd376a30cbc893c76eaaa31f0e2fe972ebd
treebf1182f9bdd651e5b1fcaa78bf2844c6842d42dd
parent9a4a67dddc3d88e2e9d3cff462b943f40ea439e4
perf test: Fix "trace summary" test for musl-based systems

The trace summary test calls /bin/true and filters for open, read and
close events. These events are coming from shared library loads.

On a musl system, the loader and libc may point to the same file. true
needs only libc, no further shared libraries are loaded at startup. The
test fails since no open, read and close events are captured.

  root@host:~# ldd /bin/true
/lib/ld-musl-riscv64.so.1 (0x3fb8882000)
libc.so => /lib/ld-musl-riscv64.so.1 (0x3fb8882000)

  root@host:~# file /lib/ld-musl-riscv64.so.1
  /lib/ld-musl-riscv64.so.1: symbolic link to /usr/lib/libc.so

  root@host:~# strace -f /bin/true
  execve("/bin/true", ["/bin/true", ...], ... /* 18 vars */) = 1
  set_tid_address(0x3fa1f7bf70)           = 330
  mprotect(0x2ad6b8e000, 12288, PROT_READ) = 0
  exit_group(0)                           = ?
  +++ exited with 0 +++

Run "cat /dev/null" instead of "true". This creates the required events
regardless of the C library and it works for cat from busybox or from
coreutils.

Signed-off-by: Martin Kaiser <martin@kaiser.cx>
Acked-by: Ian Rogers <irogers@google.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
tools/perf/tests/shell/trace_summary.sh