linux-perf-users.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Thomas Richter <tmricht@linux.ibm.com>
To: linux-kernel@vger.kernel.org, linux-s390@vger.kernel.org,
	linux-perf-users@vger.kernel.org, acme@kernel.org,
	namhyung@kernel.org, irogers@google.com
Cc: agordeev@linux.ibm.com, gor@linux.ibm.com,
	sumanthk@linux.ibm.com, hca@linux.ibm.com, japo@linux.ibm.com,
	Thomas Richter <tmricht@linux.ibm.com>
Subject: [PATCH linux-next] perf tests: Handle s390 metrics in perf all metrics test
Date: Wed, 19 Nov 2025 11:47:51 +0100	[thread overview]
Message-ID: <20251119104751.51960-1-tmricht@linux.ibm.com> (raw)

This test case fails on s390 because some counters metrics
are not available and the metric defined on them fail.
Add s390x specific list of metrics to be skipped.

Add an extra line to display which metric has been skipped.
It is shown with the verbose option turned on.

Also return "Ok" instead of "Skipped" when no errors
have been detected, but some metric have been skipped.
The seems more logical otherwise "Skipped" means all
metric tests have been skipped instead of just a few.

Signed-off-by: Thomas Richter <tmricht@linux.ibm.com>
---
 tools/perf/tests/shell/stat_all_metrics.sh | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/stat_all_metrics.sh b/tools/perf/tests/shell/stat_all_metrics.sh
index a7edf01b3943..b86b36a49228 100755
--- a/tools/perf/tests/shell/stat_all_metrics.sh
+++ b/tools/perf/tests/shell/stat_all_metrics.sh
@@ -7,6 +7,10 @@ ParanoidAndNotRoot()
   [ "$(id -u)" != 0 ] && [ "$(cat /proc/sys/kernel/perf_event_paranoid)" -gt $1 ]
 }
 
+# Ignore metric which are not supported on s390x
+[ "$(uname -m)" = "s390x" ] && ignore="|branch_miss_rate|l1d_miss_rate|llc_miss_rate|\
+		dtlb_miss_rate|itlb_miss_rate|l1i_miss_rate|l1_prefetch_miss_rate"
+
 test_prog="sleep 0.01"
 system_wide_flag="-a"
 if ParanoidAndNotRoot 0
@@ -27,9 +31,10 @@ for m in $(perf list --raw-dump metrics); do
   fi
   if [[ "$result" =~ "Cannot resolve IDs for" || "$result" =~ "No supported events found" ]]
   then
-    if [[ "$m" == @(l1_prefetch_miss_rate|stalled_cycles_per_instruction) ]]
+    if [[ "$m" == @(l1_prefetch_miss_rate|stalled_cycles_per_instruction$ignore) ]]
     then
       # Default metrics that may use unsupported events.
+      echo "Skipped metric $m"
       continue
     fi
     echo "Metric contains missing events"
@@ -106,4 +111,5 @@ for m in $(perf list --raw-dump metrics); do
   err=1
 done
 
+[ "$err" -eq 2 ] && err=0
 exit "$err"
-- 
2.51.1


             reply	other threads:[~2025-11-19 10:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-11-19 10:47 Thomas Richter [this message]
2025-11-19 17:06 ` [PATCH linux-next] perf tests: Handle s390 metrics in perf all metrics test Ian Rogers

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20251119104751.51960-1-tmricht@linux.ibm.com \
    --to=tmricht@linux.ibm.com \
    --cc=acme@kernel.org \
    --cc=agordeev@linux.ibm.com \
    --cc=gor@linux.ibm.com \
    --cc=hca@linux.ibm.com \
    --cc=irogers@google.com \
    --cc=japo@linux.ibm.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-perf-users@vger.kernel.org \
    --cc=linux-s390@vger.kernel.org \
    --cc=namhyung@kernel.org \
    --cc=sumanthk@linux.ibm.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).