public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/1 v6.16] perf test event_uniquifying: Skip test on platforms without 'clockticks' events
@ 2025-06-05 19:22 Arnaldo Carvalho de Melo
  2025-06-06 17:52 ` Namhyung Kim
  0 siblings, 1 reply; 6+ messages in thread
From: Arnaldo Carvalho de Melo @ 2025-06-05 19:22 UTC (permalink / raw)
  To: Chun-Tse Shao
  Cc: Adrian Hunter, Alexander Shishkin, Andi Kleen,
	Dr. David Alan Gilbert, Howard Chu, Ian Rogers, Ingo Molnar,
	James Clark, Jiri Olsa, Kan Liang, Levi Yun, Mark Rutland,
	Namhyung Kim, Peter Zijlstra, Weilin Wang,
	Linux Kernel Mailing List, linux-perf-users

I'll add this to perf-tools for v6.16, please check.

- Arnaldo

---

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@intel.com>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Chun-Tse Shao <ctshao@google.com>
Cc: Dr. David Alan Gilbert <linux@treblig.org>
Cc: Howard Chu <howardchu95@gmail.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: James Clark <james.clark@linaro.org>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Kan Liang <kan.liang@linux.intel.com>
Cc: Levi Yun <yeoreum.yun@arm.com>
Cc: Mark Rutland <mark.rutland@arm.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Weilin Wang <weilin.wang@intel.com>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
---
 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


^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2025-06-09 15:18 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-06-05 19:22 [PATCH 1/1 v6.16] perf test event_uniquifying: Skip test on platforms without 'clockticks' events Arnaldo Carvalho de Melo
2025-06-06 17:52 ` Namhyung Kim
2025-06-06 20:18   ` Arnaldo Carvalho de Melo
2025-06-06 20:25     ` Arnaldo Carvalho de Melo
2025-06-07  2:55       ` Chun-Tse Shao
2025-06-09 15:18         ` Arnaldo Carvalho de Melo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox