Re: [PATCH 1/1 v6.16] perf test event_uniquifying: Skip test on platforms without 'clockticks' events
From: Namhyung Kim
Date: Fri Jun 06 2025 - 13:52:15 EST
On Thu, Jun 05, 2025 at 04:22:40PM -0300, Arnaldo Carvalho de Melo wrote:
> I'll add this to perf-tools for v6.16, please check.
Plesae see
https://lore.kernel.org/linux-perf-users/20250521224513.1104129-1-ctshao@xxxxxxxxxx/
Thanks,
Namhyung
> ---
>
> This test assumes the 'clockticks' event is generally available, which
> isn't the case, for instance, on AMD systems such as:
>
> root@number:~# grep -m1 "model name" /proc/cpuinfo
> model name : AMD Ryzen 9 9950X3D 16-Core Processor
> root@number:~# perf list clockticks
>
> List of pre-defined events (to be used in -e or -M):
>
> root@number:~#
>
> So skip this test when 'clockticks' isn't available.
>
> This should be improved to find other events that are available in
> multiple PMUs so that the intent of the test is achieved in more
> platforms.
>
> Fixes: cb422594d62066a5 ("perf test: Add stat uniquifying test")
> Cc: Adrian Hunter <adrian.hunter@xxxxxxxxx>
> Cc: Alexander Shishkin <alexander.shishkin@xxxxxxxxxxxxxxx>
> Cc: Andi Kleen <ak@xxxxxxxxxxxxxxx>
> Cc: Chun-Tse Shao <ctshao@xxxxxxxxxx>
> Cc: Dr. David Alan Gilbert <linux@xxxxxxxxxxx>
> Cc: Howard Chu <howardchu95@xxxxxxxxx>
> Cc: Ian Rogers <irogers@xxxxxxxxxx>
> Cc: Ingo Molnar <mingo@xxxxxxxxxx>
> Cc: James Clark <james.clark@xxxxxxxxxx>
> Cc: Jiri Olsa <jolsa@xxxxxxxxxx>
> Cc: Kan Liang <kan.liang@xxxxxxxxxxxxxxx>
> Cc: Levi Yun <yeoreum.yun@xxxxxxx>
> Cc: Mark Rutland <mark.rutland@xxxxxxx>
> Cc: Namhyung Kim <namhyung@xxxxxxxxxx>
> Cc: Peter Zijlstra <peterz@xxxxxxxxxxxxx>
> Cc: Weilin Wang <weilin.wang@xxxxxxxxx>
> Signed-off-by: Arnaldo Carvalho de Melo <acme@xxxxxxxxxx>
> ---
> tools/perf/tests/shell/stat+event_uniquifying.sh | 6 ++++++
> 1 file changed, 6 insertions(+)
>
> diff --git a/tools/perf/tests/shell/stat+event_uniquifying.sh b/tools/perf/tests/shell/stat+event_uniquifying.sh
> index 5ec35c52b7d9651e..20498b6eadb57702 100755
> --- a/tools/perf/tests/shell/stat+event_uniquifying.sh
> +++ b/tools/perf/tests/shell/stat+event_uniquifying.sh
> @@ -49,6 +49,12 @@ test_event_uniquifying() {
> uniquified_event_array+=("${uniquified_event}")
> done < <(${perf_tool} list -v ${event} | grep "\[Kernel PMU event\]")
>
> + if [ ${#uniquified_event_array[@]} -eq 0 ]; then
> + echo "'clocktick' event not available on this machine"
> + err=2
> + return
> + fi
> +
> perf_command="${perf_tool} stat -e $event -A -o ${stat_output} -- true"
> $perf_command
>
> --
> 2.49.0
>