From nobody Wed Jun 17 02:51:56 2026 Received: from akranes.kaiser.cx (akranes.kaiser.cx [152.53.16.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CD2361E5714; Tue, 28 Apr 2026 14:39:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=152.53.16.207 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777387197; cv=none; b=hfp3Busq9gZFKAAXjtCTw7QBR7kC2IeAZRxhJhgGEDDGFSsYDbXBSXxEWTQhi5vfKGQsNxmysliZZIQ+OpYXVHRFnOl3pfY71aDPGOxDDrDUy5gwUE1KcWvWob3OAhqRQ9sm22/qjbKGU3tva5vMoqTtI/bvdpSru+SWQ68wr6s= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777387197; c=relaxed/simple; bh=GOLEyVrhHIIoMm7SMbPONOncTZLNg1mdjwGqJ0TaLHU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=lcypkVNBLgNcetTD8M0hVBdXPmkxoLhi+irNU4F+H/hP8fdMVkxNv8st/9LFOcDNTddKynYoJxBLVRWG9z3sb7XeH6bhWT7PByTLqLQ1Q1VJ05VNSm7Q89H8bO+brSb16ia6bgAw4fzzsG0Fd3zPAUZWMzw8bnaJT5w3sMYyEPM= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kaiser.cx; spf=pass smtp.mailfrom=kaiser.cx; arc=none smtp.client-ip=152.53.16.207 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kaiser.cx Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kaiser.cx Received: from ipservice-092-208-105-007.092.208.pools.vodafone-ip.de ([92.208.105.7] helo=nb282.user.codasip.com) by akranes.kaiser.cx with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wHjbD-00000000sA9-0o74; Tue, 28 Apr 2026 16:39:43 +0200 From: Martin Kaiser To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim Cc: Ian Rogers , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH v2 1/3] perf test: fix nanosleep check in the ftrace test Date: Tue, 28 Apr 2026 16:38:46 +0200 Message-ID: <20260428143920.2466185-2-martin@kaiser.cx> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260428143920.2466185-1-martin@kaiser.cx> References: <20260428143920.2466185-1-martin@kaiser.cx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The perf ftrace test case runs perf ftrace profile --graph-opts depth=3D5 sleep 0.1 and checks that the output contains a *clock_nanosleep function with a count of 1. This fails on a risc-v system that uses musl as its C library. musl's nanosleep syscall wrapper uses either the nanosleep or the clock_nanosleep syscall. Filter for sys_*nanosleep to allow both syscalls. Signed-off-by: Martin Kaiser Acked-by: Namhyung Kim --- v2: - add Acked-by tools/perf/tests/shell/ftrace.sh | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/tools/perf/tests/shell/ftrace.sh b/tools/perf/tests/shell/ftra= ce.sh index 7f8aafcbb761..9f6e590f6437 100755 --- a/tools/perf/tests/shell/ftrace.sh +++ b/tools/perf/tests/shell/ftrace.sh @@ -71,9 +71,10 @@ test_ftrace_profile() { grep ^# "${output}" time_re=3D"[[:space:]]+1[[:digit:]]{5}\.[[:digit:]]{3}" # 100283.000 100283.000 100283.000 1 __x64_sys_clock_nanosl= eep - # Check for one *clock_nanosleep line with a Count of just 1 that take= s a bit more than 0.1 seconds - # Strip the _x64_sys part to work with other architectures - grep -E "^${time_re}${time_re}${time_re}[[:space:]]+1[[:space:]]+.*clo= ck_nanosleep" "${output}" + # Check for one *sys_*nanosleep line with a Count of just 1 that takes= a bit more than 0.1 seconds + # Strip the _x64_ part to work with other architectures, strip the clo= ck part to support + # C libraries that use the nanosleep syscall instead of clock_nanosleep + grep -E "^${time_re}${time_re}${time_re}[[:space:]]+1[[:space:]]+.*sys= _.*nanosleep" "${output}" echo "perf ftrace profile test [Success]" } =20 --=20 2.43.7 From nobody Wed Jun 17 02:51:56 2026 Received: from akranes.kaiser.cx (akranes.kaiser.cx [152.53.16.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8CFF940FDAD; Tue, 28 Apr 2026 14:39:55 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=152.53.16.207 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777387198; cv=none; b=MwNCUdp2tc6F4a38USvFIsGi+PZIX6lwPn35Iav2PbvjSAr3sLaZVqzuIQmTXxKhucfX+d/0xhdPrQI4Im7tBJPLNzAamCUYpryM3OnhfSlYSAXviw2rvBV65BMP/fUaubplU6gAbBx8BJRX1y7SaipFEhC6p7NTOqjU3dzyZQw= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777387198; c=relaxed/simple; bh=R2Y9reQb/KcVnC/L/Hwk1juFmLerAODaIPvz6mqQ4Yk=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=bSt7++Lb6jMh/LXEspL2q/VtWAjsN7TZQdi8jqEbnzqABEXk2lR0T4oBxnUa5qTGvztqdO5wGA/HbMu6OZqXEK8eEMcr5sUHfqUQEQVOCg8nwerscgLv8ww71iJNRhfLYB6w1cWswPM1lwK5yt7UNaQT/3/WXTbRp76uFMt18dg= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kaiser.cx; spf=pass smtp.mailfrom=kaiser.cx; arc=none smtp.client-ip=152.53.16.207 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kaiser.cx Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kaiser.cx Received: from ipservice-092-208-105-007.092.208.pools.vodafone-ip.de ([92.208.105.7] helo=nb282.user.codasip.com) by akranes.kaiser.cx with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wHjbE-00000000sA9-1ZRU; Tue, 28 Apr 2026 16:39:44 +0200 From: Martin Kaiser To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim Cc: Ian Rogers , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH v2 2/3] perf test: fix sys_enter_openat event test for musl Date: Tue, 28 Apr 2026 16:38:47 +0200 Message-ID: <20260428143920.2466185-3-martin@kaiser.cx> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260428143920.2466185-1-martin@kaiser.cx> References: <20260428143920.2466185-1-martin@kaiser.cx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" The "syscalls:sys_enter_openat event fields" test calls openat(AT_FDCWD, "/etc/passwd", O_RDONLY | O_DIRECTORY) and verifies that the flags of the captured event are matching. This fails for musl, where the openat syscall wrapper always adds O_LARGEFILE. Update the check to allow for additional flags, the access mode flags must be unchanged. Signed-off-by: Martin Kaiser Acked-by: Namhyung Kim --- v2: - check that access mode is unchanged tools/perf/tests/openat-syscall-tp-fields.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests= /openat-syscall-tp-fields.c index 2a139d2781a8..5523cf4e9321 100644 --- a/tools/perf/tests/openat-syscall-tp-fields.c +++ b/tools/perf/tests/openat-syscall-tp-fields.c @@ -120,7 +120,10 @@ static int test__syscall_openat_tp_fields(struct test_= suite *test __maybe_unused =20 tp_flags =3D evsel__intval(evsel, &sample, "flags"); perf_sample__exit(&sample); - if (flags !=3D tp_flags) { + /* C library wrapper may set additional flags, + access mode must be unchanged */ + if ((tp_flags & O_ACCMODE) !=3D (flags & O_ACCMODE) || + (tp_flags & flags) !=3D flags) { pr_debug("%s: Expected flags=3D%#x, got %#x\n", __func__, flags, tp_flags); goto out_delete_evlist; --=20 2.43.7 From nobody Wed Jun 17 02:51:56 2026 Received: from akranes.kaiser.cx (akranes.kaiser.cx [152.53.16.207]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 88FBE3FD123; Tue, 28 Apr 2026 14:39:56 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=152.53.16.207 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777387199; cv=none; b=Yl8HtEWRQN53Wpz9ZXy7gOuSfV/3C8O0d03hyBz+44v409UMwCPka0K4im9u96B4LtTY+eULQUDIu5futQr6vavvuibZ44UoLfDA0MGznz8VyUI4fodK2d4HaRrdmyeJZihU7YoDmVCOOFkA9bxEWGXIPGxBdxw6AJoQFwSgvX4= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777387199; c=relaxed/simple; bh=s3VQ/EEBMRgw8u1CpLJ/wyJmX55jlz3z0F8yw4zAbYg=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=PDbZOGbyg8BLm7T5pM1KI7DXGucDD1bjMC9mP9mhA2KgFiYgn++KNLRtB8ydYr+/2vzE2fVzrP7JY1mNN+zs9hZfuqswoPqQfqLXek7/Ynt+9oCv5T4TL5XI/11k32Z4NjPgnvTSNKljCKDwsebUc7n2NlpI5IPfoKT3tWIM2q4= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kaiser.cx; spf=pass smtp.mailfrom=kaiser.cx; arc=none smtp.client-ip=152.53.16.207 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=kaiser.cx Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=kaiser.cx Received: from ipservice-092-208-105-007.092.208.pools.vodafone-ip.de ([92.208.105.7] helo=nb282.user.codasip.com) by akranes.kaiser.cx with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.98.2) (envelope-from ) id 1wHjbF-00000000sA9-2uNQ; Tue, 28 Apr 2026 16:39:45 +0200 From: Martin Kaiser To: Peter Zijlstra , Ingo Molnar , Arnaldo Carvalho de Melo , Namhyung Kim Cc: Ian Rogers , James Clark , linux-perf-users@vger.kernel.org, linux-kernel@vger.kernel.org, Martin Kaiser Subject: [PATCH v2 3/3] perf test: fix "trace summary" test for musl-based systems Date: Tue, 28 Apr 2026 16:38:48 +0200 Message-ID: <20260428143920.2466185-4-martin@kaiser.cx> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260428143920.2466185-1-martin@kaiser.cx> References: <20260428143920.2466185-1-martin@kaiser.cx> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" 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 =3D> /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 */) =3D 1 set_tid_address(0x3fa1f7bf70) =3D 330 mprotect(0x2ad6b8e000, 12288, PROT_READ) =3D 0 exit_group(0) =3D ? +++ 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 Acked-by: Ian Rogers Acked-by: Namhyung Kim --- 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/she= ll/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=3D$(mktemp /tmp/perf_trace_test.XXXXX) =20 test_perf_trace() { args=3D$1 - workload=3D"true" + workload=3D"cat /dev/null" search=3D"^\s*(open|read|close).*[0-9]+%$" =20 echo "testing: perf trace ${args} -- ${workload}" --=20 2.43.7