Skip to contentSkip to conversation

perf test: perf stat tests fails on s390

PATCH Applied Thomas Richter 4 participants 4 messages Sep 3 – Sep 8

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH v2 1/1 perf test: perf stat tests fails on s390

The test case 'perf stat tests' fails on s390 z/VM machines. The root cause is the unsupported CPU measurement facility on z/VM. Therefore the events cycles and instructions do not exist and are unsupported. This cause the subtest
Hide zero events stat test
to fail.

Output before:

 # perf test 116
 116: perf stat tests  : FAILED!

=== Test Summary ===
Passed main tests : 0

 Passed subtests   : 0
 Skipped tests     : 0
 Failed tests      : 1

List of failed tests:
116: perf stat tests
#

Output after:

 # ./perf test 116
 116: perf stat tests  : Ok

=== Test Summary ===
Passed main tests : 1

 Passed subtests   : 0
 Skipped tests     : 0
 Failed tests      : 0

#

Fixes 64724095a33f ("perf stat: Add --hide-zero-events option to suppress zero-count events")
Cc Aaron Tomlin <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Namhyung Kim <[email protected]>
---
 tools/perf/tests/shell/stat.sh | 5 +++++
 1 file changed, 5 insertions(+)
tools/perf/tests/shell/stat.sh +5 -0
index 298ce454b45a..1f5d4cc05807 100755
@@ -583,6 +583,11 @@ test_hide_zero_events_stat() {
   # Check that --metric-only works with --hide-zero-events
   if ! perf stat --hide-zero-events --metric-only -e instructions,cycles true > "${stat_output}" 2>&1
   then
+    if grep -sq 'No supported events found' "${stat_output}"
+    then
+      echo "Hide zero events stat test [Skipped - events not supported]"
+      return
+    fi
     echo "Hide zero events stat test [Failed - metric-only command failed]"
     err=1
     return
Signature · 1 line
2.55.0
#1 lore raw
Sashiko has reviewed this patch and found no issues. It looks great!
Quoted 15 lines

The test case 'perf stat tests' fails on s390 z/VM machines. The root cause is the unsupported CPU measurement facility on z/VM. Therefore the events cycles and instructions do not exist and are unsupported. This cause the subtest
Hide zero events stat test
to fail.

Output before:

 # perf test 116
 116: perf stat tests  : FAILED!

=== Test Summary ===
Passed main tests : 0
Passed subtests : 0
Skipped tests : 0

Quoted 6 lines
[ ... ]
Fixes 64724095a33f ("perf stat: Add --hide-zero-events option to suppress zero-count events")
Cc Aaron Tomlin <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Namhyung Kim <[email protected]>

Sashiko has reviewed this patch and found no issues. It looks great!

Signature · 1 line
Sashiko AI review · https://sashiko.dev/#/patchset/[email protected]?part=1
reviewer Reviewed-by on v2 1/1
#2 lore raw
In reply to Thomas Richter
Quoted 30 lines · Thomas Richter

The test case 'perf stat tests' fails on s390 z/VM machines. The root cause is the unsupported CPU measurement facility on z/VM. Therefore the events cycles and instructions do not exist and are unsupported. This cause the subtest
Hide zero events stat test
to fail.

Output before:

 # perf test 116
 116: perf stat tests  : FAILED!

=== Test Summary ===
Passed main tests : 0

 Passed subtests   : 0
 Skipped tests     : 0
 Failed tests      : 1

List of failed tests:
116: perf stat tests
#

Output after:

 # ./perf test 116
 116: perf stat tests  : Ok

=== Test Summary ===
Passed main tests : 1

 Passed subtests   : 0
 Skipped tests     : 0
 Failed tests      : 0
Quoted 8 lines

#

Fixes 64724095a33f ("perf stat: Add --hide-zero-events option to suppress zero-count events")
Cc Aaron Tomlin <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Namhyung Kim <[email protected]>

Thanks,
Ian

Quoted 23 lines
---
 tools/perf/tests/shell/stat.sh | 5 +++++
 1 file changed, 5 insertions(+)
tools/perf/tests/shell/stat.sh +5 -1
index 298ce454b45a..1f5d4cc05807 100755
@@ -583,6 +583,11 @@ test_hide_zero_events_stat() {
   # Check that --metric-only works with --hide-zero-events
   if ! perf stat --hide-zero-events --metric-only -e instructions,cycles true > "${stat_output}" 2>&1
   then
+    if grep -sq 'No supported events found' "${stat_output}"
+    then
+      echo "Hide zero events stat test [Skipped - events not supported]"
+      return
+    fi
     echo "Hide zero events stat test [Failed - metric-only command failed]"
     err=1
     return
--

2.55.0

maintainer Applied
#3 lore raw
Quoted 33 lines · Ian Rogers
Quoted 32 lines · Thomas Richter

The test case 'perf stat tests' fails on s390 z/VM machines. The root cause is the unsupported CPU measurement facility on z/VM. Therefore the events cycles and instructions do not exist and are unsupported. This cause the subtest
Hide zero events stat test
to fail.

Output before:

 # perf test 116
 116: perf stat tests  : FAILED!

=== Test Summary ===
Passed main tests : 0

 Passed subtests   : 0
 Skipped tests     : 0
 Failed tests      : 1

List of failed tests:
116: perf stat tests
#

Output after:

 # ./perf test 116
 116: perf stat tests  : Ok

=== Test Summary ===
Passed main tests : 1

 Passed subtests   : 0
 Skipped tests     : 0
 Failed tests      : 0

#

Quoted 8 lines
Quoted 6 lines
Fixes 64724095a33f ("perf stat: Add --hide-zero-events option to suppress zero-count events")
Cc Aaron Tomlin <[email protected]>
Cc Ian Rogers <[email protected]>
Cc Namhyung Kim <[email protected]>

Thanks, applied to perf-tools-next, for v7.4.

- Arnaldo