* [PATCH] perf test: Skip stat uniquifying test if unavailable
@ 2025-06-10 14:45 Thomas Richter
2025-06-10 15:58 ` Chun-Tse Shao
0 siblings, 1 reply; 2+ messages in thread
From: Thomas Richter @ 2025-06-10 14:45 UTC (permalink / raw)
To: linux-kernel, linux-s390, linux-perf-users, acme, namhyung,
ctshao
Cc: agordeev, gor, sumanthk, hca, japo, Thomas Richter
Commit cb422594d6206 ("perf test: Add stat uniquifying test")
introduced a new test case which uses an event named clockticks
which is exported as sysfs file .../uncore_imc_0/clockticks.
This file does not exist on s390 and causes the test case to
always fail.
Check for the existence of file clockticks and skip this
test if the event does not exist.
Output before:
# perf test 87
87: perf stat events uniquifying : FAILED!
# ./perf stat -e clockticks -A
event syntax error: 'clockticks'
\___ Bad event name
...
#
Output after:
# perf test 87
87: perf stat events uniquifying : Skip
#
Fixes: cb422594d6206 ("perf test: Add stat uniquifying test")
Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
Cc: Chun-Tse Shao <ctshao@google.com>
---
tools/perf/tests/shell/stat+event_uniquifying.sh | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/tools/perf/tests/shell/stat+event_uniquifying.sh b/tools/perf/tests/shell/stat+event_uniquifying.sh
index 5ec35c52b7d9..485ee6e8f574 100755
--- a/tools/perf/tests/shell/stat+event_uniquifying.sh
+++ b/tools/perf/tests/shell/stat+event_uniquifying.sh
@@ -49,6 +49,11 @@ test_event_uniquifying() {
uniquified_event_array+=("${uniquified_event}")
done < <(${perf_tool} list -v ${event} | grep "\[Kernel PMU event\]")
+ if [ -z "$uniquified_event" ]
+ then
+ err=2
+ return
+ fi
perf_command="${perf_tool} stat -e $event -A -o ${stat_output} -- true"
$perf_command
--
2.49.0
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] perf test: Skip stat uniquifying test if unavailable
2025-06-10 14:45 [PATCH] perf test: Skip stat uniquifying test if unavailable Thomas Richter
@ 2025-06-10 15:58 ` Chun-Tse Shao
0 siblings, 0 replies; 2+ messages in thread
From: Chun-Tse Shao @ 2025-06-10 15:58 UTC (permalink / raw)
To: Thomas Richter
Cc: linux-kernel, linux-s390, linux-perf-users, acme, namhyung,
agordeev, gor, sumanthk, hca, japo
Hi Thomas,
Thanks for the fix. Arnaldo also had a fix and should fix this issue.
https://lore.kernel.org/all/aEHugAPinlWLuTAS@x1/
Thanks,
CT
On Tue, Jun 10, 2025 at 7:45 AM Thomas Richter <tmricht@linux.ibm.com> wrote:
>
> Commit cb422594d6206 ("perf test: Add stat uniquifying test")
> introduced a new test case which uses an event named clockticks
> which is exported as sysfs file .../uncore_imc_0/clockticks.
> This file does not exist on s390 and causes the test case to
> always fail.
>
> Check for the existence of file clockticks and skip this
> test if the event does not exist.
>
> Output before:
> # perf test 87
> 87: perf stat events uniquifying : FAILED!
> # ./perf stat -e clockticks -A
> event syntax error: 'clockticks'
> \___ Bad event name
> ...
> #
>
> Output after:
> # perf test 87
> 87: perf stat events uniquifying : Skip
> #
>
> Fixes: cb422594d6206 ("perf test: Add stat uniquifying test")
> Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
> Acked-by: Sumanth Korikkar <sumanthk@linux.ibm.com>
> Cc: Chun-Tse Shao <ctshao@google.com>
> ---
> tools/perf/tests/shell/stat+event_uniquifying.sh | 5 +++++
> 1 file changed, 5 insertions(+)
>
> diff --git a/tools/perf/tests/shell/stat+event_uniquifying.sh b/tools/perf/tests/shell/stat+event_uniquifying.sh
> index 5ec35c52b7d9..485ee6e8f574 100755
> --- a/tools/perf/tests/shell/stat+event_uniquifying.sh
> +++ b/tools/perf/tests/shell/stat+event_uniquifying.sh
> @@ -49,6 +49,11 @@ test_event_uniquifying() {
> uniquified_event_array+=("${uniquified_event}")
> done < <(${perf_tool} list -v ${event} | grep "\[Kernel PMU event\]")
>
> + if [ -z "$uniquified_event" ]
> + then
> + err=2
> + return
> + fi
> perf_command="${perf_tool} stat -e $event -A -o ${stat_output} -- true"
> $perf_command
>
> --
> 2.49.0
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2025-06-10 15:58 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-10 14:45 [PATCH] perf test: Skip stat uniquifying test if unavailable Thomas Richter
2025-06-10 15:58 ` Chun-Tse Shao
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).