Linux Perf Users
 help / color / mirror / Atom feed
From: Martin Kaiser <martin@kaiser.cx>
To: Peter Zijlstra <peterz@infradead.org>,
	Ingo Molnar <mingo@redhat.com>,
	Arnaldo Carvalho de Melo <acme@kernel.org>,
	Namhyung Kim <namhyung@kernel.org>
Cc: Ian Rogers <irogers@google.com>,
	James Clark <james.clark@linaro.org>,
	linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org,
	Martin Kaiser <martin@kaiser.cx>
Subject: [PATCH v2 3/3] perf test: fix "trace summary" test for musl-based systems
Date: Tue, 28 Apr 2026 16:38:48 +0200	[thread overview]
Message-ID: <20260428143920.2466185-4-martin@kaiser.cx> (raw)
In-Reply-To: <20260428143920.2466185-1-martin@kaiser.cx>

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>
---
v2:
- use cat /dev/null, this works for busybox and coreutils

 tools/perf/tests/shell/trace_summary.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/trace_summary.sh b/tools/perf/tests/shell/trace_summary.sh
index 22e2651d5919..b80dea77cec6 100755
--- a/tools/perf/tests/shell/trace_summary.sh
+++ b/tools/perf/tests/shell/trace_summary.sh
@@ -14,7 +14,7 @@ OUTPUT=$(mktemp /tmp/perf_trace_test.XXXXX)
 
 test_perf_trace() {
     args=$1
-    workload="true"
+    workload="cat /dev/null"
     search="^\s*(open|read|close).*[0-9]+%$"
 
     echo "testing: perf trace ${args} -- ${workload}"
-- 
2.43.7


  parent reply	other threads:[~2026-04-28 14:39 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-04-28 14:38 [PATCH v2 0/3] perf: fix some tests for musl Martin Kaiser
2026-04-28 14:38 ` [PATCH v2 1/3] perf test: fix nanosleep check in the ftrace test Martin Kaiser
2026-04-28 14:38 ` [PATCH v2 2/3] perf test: fix sys_enter_openat event test for musl Martin Kaiser
2026-04-29 16:55   ` Ian Rogers
2026-04-30  7:15     ` Martin Kaiser
2026-04-28 14:38 ` Martin Kaiser [this message]
2026-04-29 16:57   ` [PATCH v2 3/3] perf test: fix "trace summary" test for musl-based systems Ian Rogers
2026-04-28 23:09 ` [PATCH v2 0/3] perf: fix some tests for musl Namhyung Kim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260428143920.2466185-4-martin@kaiser.cx \
    --to=martin@kaiser.cx \
    --cc=acme@kernel.org \
    --cc=irogers@google.com \
    --cc=james.clark@linaro.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung@kernel.org \
    --cc=peterz@infradead.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox