Linux Perf Users
 help / color / mirror / Atom feed
* [PATCH] perf test: Skip the extra metric line for stalled_cycles_per_instruction
@ 2026-10-22  2:49 TAKANO Mitsuhiro
  2026-10-22  2:58 ` sashiko-bot
  0 siblings, 1 reply; 2+ messages in thread
From: TAKANO Mitsuhiro @ 2026-10-22  2:49 UTC (permalink / raw)
  To: linux-perf-users, Arnaldo Carvalho de Melo
  Cc: Namhyung Kim, Ian Rogers, TAKANO Mitsuhiro

The STD output linter maps one metric to each default event and stops at
the first line that shows a different one.  stalled_cycles_per_instruction
is computed as max(stalled-cycles-frontend, stalled-cycles-backend) /
instructions, so its event set differs from the one behind
backend_cycles_idle and perf stat prints it on a line of its own: a
second stalled-cycles-backend line carrying that metric.  The linter
rejects it with "wrong event metric. expected backend_cycles_idle in
...".

Metrics printed on their own line are already skipped
(skip_metric=("tma_" "TopdownL1")); add this one to that list.

Verified on an Ampere Altra (arm64, Neoverse-N1): `perf test "perf stat
STD output linter"` fails before the change and passes after it.  Only
the linter is changed; the perf stat output is untouched.

Fixes: c7adeb0974f1 ("perf jevents: Add set of common metrics based on default ones")
Assisted-by: LLM
Signed-off-by: TAKANO Mitsuhiro <takano32@gmail.com>
---
 tools/perf/tests/shell/stat+std_output.sh | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/tools/perf/tests/shell/stat+std_output.sh b/tools/perf/tests/shell/stat+std_output.sh
index 9c4b92ecf448..d9610f2c92a6 100755
--- a/tools/perf/tests/shell/stat+std_output.sh
+++ b/tools/perf/tests/shell/stat+std_output.sh
@@ -13,7 +13,7 @@ stat_output=$(mktemp /tmp/__perf_test.stat_output.std.XXXXX)
 
 event_name=(cpu-clock task-clock context-switches cpu-migrations page-faults stalled-cycles-frontend stalled-cycles-backend cycles instructions branches branch-misses)
 event_metric=("CPUs_utilized" "CPUs_utilized" "cs/sec" "migrations/sec" "faults/sec" "frontend_cycles_idle" "backend_cycles_idle" "GHz" "insn_per_cycle" "/sec" "branch_miss_rate")
-skip_metric=("tma_" "TopdownL1")
+skip_metric=("tma_" "TopdownL1" "stalled_cycles_per_instruction")
 
 cleanup() {
   rm -f "${stat_output}"

base-commit: f47d223627f80cb7a1eb14c585fe6cb35de5e984
-- 
2.53.0


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

end of thread, other threads:[~2026-10-22  2:58 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-10-22  2:49 [PATCH] perf test: Skip the extra metric line for stalled_cycles_per_instruction TAKANO Mitsuhiro
2026-10-22  2:58 ` sashiko-bot

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