perf test: Skip the extra metric line for stalled_cycles_per_instruction
PATCH 1/1 perf test: Skip the extra metric line for stalled_cycles_per_instruction
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.
--- tools/perf/tests/shell/stat+std_output.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
tools/perf/tests/shell/stat+std_output.sh +1 -1
@@ -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
Signature · 1 line
2.53.0
[email protected]
AI reviewSashiko has reviewed this patch and found no issues.
Quoted 12 lines
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_instructionis computed asmax(stalled-cycles-frontend, stalled-cycles-backend)/ instructions, so its event set differs from the one behindbackend_cycles_idleand 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. expectedbackend_cycles_idlein ...".Metrics printed on their own line are already skipped (skip_metric=("tma_" "TopdownL1")); add this one to that list.
Quoted 7 lines
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 LLMSigned-off-by TAKANO Mitsuhiro <[email protected]>
Sashiko has reviewed this patch and found no issues.
Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1