From nobody Wed Jun 17 07:22:09 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 5E2013AF66E; Mon, 27 Apr 2026 09:38:04 +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=1777282686; cv=none; b=mX/FmnRToq2MOF2HJlYBKfBJYUTGLv7H2+f4wkz0jiF7V/Lht65isPk0EHnRvA+lk2uLPcTO8pmK0hFuxdM8ePDTdb70QZ2mUb3uRLKMXh7NBWFz9PpgFGMigSsHj4yNGX9TuJtAc45vGZGnw5FFYUYYp1NXE0xTe094erQCjoU= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777282686; c=relaxed/simple; bh=jEea6Sol4jrwqNMNxceLTISe1gWE205iDYoKM70fdMU=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=cLHYTwCimDEpPzTk/JWrVM/zoAA/KbD7ZJdwxsBD4iOMCkpPzZGRTumJB+XIx7FWNduiBVhII32xav1vGRFOyMkocGyGZ781GbCxwenA0KjE/I6eu6QTZl9G/3cBgcsHL/ly2Ubxg5LaKqjCyXCLMezg4vJrcCEJ6WCobt/WtDs= 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 1wHHrV-00000000jJc-1uPt; Mon, 27 Apr 2026 11:02:41 +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 1/3] perf test: fix nanosleep check in the ftrace test Date: Mon, 27 Apr 2026 11:01:41 +0200 Message-ID: <20260427090225.794482-2-martin@kaiser.cx> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260427090225.794482-1-martin@kaiser.cx> References: <20260427090225.794482-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 --- 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 07:22:09 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 3AB573A1D01; Mon, 27 Apr 2026 09:38:16 +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=1777282697; cv=none; b=X03ErPj8XFZkC2/t1JNGikPlwiiEVYx8YVYsk+GdMcUDaSBxJ2cIOPK423BoE809YX/z+10S/ln+AwwNAscmaGyIQNAsxXF50bFje288Apzx2B7ZHHCZwSIXCCVGWQHMhTZLmSxp5LaeKxk/DZRz9xgvNneaE27fCMZURNbzs9w= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777282697; c=relaxed/simple; bh=tdlII85rl4FSfMOozmCfV2xnCZaKltxoi01AqY0fmsE=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=XyWNIfADUjOVSe0mCWiBx4zkSZXabyayK7zz5jwK1EVtsDjvxuUBZ2dRE6SeRDEEx1TQhU3PDAUx3JWJ5b4N822vxwVCguNjxkfZXL3BnL6idLPwfHo6y+RrozYFA7mTXzqf+xNcrSa2t9Km0HhgeDJHAAMU1kkmYocKX1Th1tE= 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 1wHHrW-00000000jJc-2NT1; Mon, 27 Apr 2026 11:02:42 +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 2/3] perf test: fix sys_enter_openat event test for musl Date: Mon, 27 Apr 2026 11:01:42 +0200 Message-ID: <20260427090225.794482-3-martin@kaiser.cx> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260427090225.794482-1-martin@kaiser.cx> References: <20260427090225.794482-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. Fail the test only if one of our flags is missing. Signed-off-by: Martin Kaiser --- tools/perf/tests/openat-syscall-tp-fields.c | 3 ++- 1 file changed, 2 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..366b3bf39def 100644 --- a/tools/perf/tests/openat-syscall-tp-fields.c +++ b/tools/perf/tests/openat-syscall-tp-fields.c @@ -120,7 +120,8 @@ static int test__syscall_openat_tp_fields(struct test_s= uite *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 */ + if ((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 07:22:09 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 8794C3B27EF; Mon, 27 Apr 2026 09:38:27 +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=1777282708; cv=none; b=DpUBAsiHgArm9K5MpXaSMwbt4mJHl0NYTgzr4ywg863uUwBSQjP36e2sooLrJcaNsFMSrcbg7Q6R7z3bWqs6cviXw7pNOjPqPbcsvQRma0G4NIXPNWkNl14ZBIBYWN3yZK0IEZQQUR3vpDg6cHjPgyF8QE4aMcDZOddZJ7jnWSo= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1777282708; c=relaxed/simple; bh=tf9YPH2r8X9YQTzXi6q2vwF2yny9h95Q4y6ed6Pq9Z0=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=ZRU1YOdJ4RDrHZxrpH1hsdqhh5vSAbsX40DUwEme9+u67bb69fgsH5DOb5yIHazlFxMUeyWhSM1x1QV+jXj9rtTNpkH4OFTfdY4L+5dMc9pmkcQOjQ2xRE+1Ku+s5i3KzTh3DwCV8lNpke2jCLp5IledemU8x4j77BvN1zD4LZM= 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 1wHHrY-00000000jJc-0IYs; Mon, 27 Apr 2026 11:02: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 3/3] perf test: fix "trace summary" test for musl-based systems Date: Mon, 27 Apr 2026 11:01:43 +0200 Message-ID: <20260427090225.794482-4-martin@kaiser.cx> X-Mailer: git-send-email 2.43.7 In-Reply-To: <20260427090225.794482-1-martin@kaiser.cx> References: <20260427090225.794482-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 "ps --help" instead of "true". ps needs at least libprocps and we'll get the events that are needed for the test. Signed-off-by: Martin Kaiser --- 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..03be213bb7bf 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"ps --help" search=3D"^\s*(open|read|close).*[0-9]+%$" =20 echo "testing: perf trace ${args} -- ${workload}" --=20 2.43.7