perf/test: test case 71 fails on s390
PATCH 1/1 perf/test: test case 71 fails on s390
Test case 71 'Convert perf time to TSC' is not supported on s390. Subtest 71.1 is skipped with the correct message, but subtest 71.2 is not skipped and fails.
The root cause is function evlist__open() called from test__perf_time_to_tsc(). evlist__open() returns -ENOENT because the event cycles:u is not supported by the selected PMU, for example platform s390 on z/VM or an x86_64 virtual machine.
The PMU driver returns -ENOENT in this case. This error is leads to the failure.
Fix this by returning TEST_SKIP on -ENOENT.
Output before:
71: Convert perf time to TSC:
71.1: TSC support: Skip (This architecture does not support)
71.2: Perf time to TSC: FAILED!
Output after:
71: Convert perf time to TSC:
71.1: TSC support: Skip (This architecture does not support)
71.2: Perf time to TSC: Skip (perf_read_tsc_conversion is not supported)
This also happens on an x86_64 virtual machine:
# uname -m
x86_64
$ ./perf test -F 71
71: Convert perf time to TSC :
71.1: TSC support : Ok
71.2: Perf time to TSC : FAILED!
$ --- tools/perf/tests/perf-time-to-tsc.c | 4 ++++ 1 file changed, 4 insertions(+)
tools/perf/tests/perf-time-to-tsc.c +4 -0
@@ -123,6 +123,10 @@ static int test__perf_time_to_tsc(struct test_suite *test __maybe_unused, int su evsel->core.attr.enable_on_exec =0 ; } +if (evlist__open (evlist) == -ENOENT ) { + err =TEST_SKIP ; + goto out_err; + }CHECK__ (evlist__open (evlist));CHECK__ (evlist__mmap (evlist,UINT_MAX ));
Signature · 1 line
2.35.1
Arnaldo Carvalho de Melo
maintainerEm Wed, Apr 20, 2022 at 08:29:21AM +0200, Thomas Richter escreveu:
Quoted 11 lines
Test case 71 'Convert perf time to TSC' is not supported on s390. Subtest 71.1 is skipped with the correct message, but subtest 71.2 is not skipped and fails.
The root cause is function
evlist__open()called fromtest__perf_time_to_tsc().evlist__open()returns-ENOENTbecause the event cycles:u is not supported by the selected PMU, for example platform s390 on z/VM or anx86_64virtual machine.
The PMU driver returns-ENOENTin this case. This error is leads to the failure.
Fix this by returningTEST_SKIPon-ENOENT.
Thanks, applied and tested it on x86_64, where it continues to work.
- Arnaldo
Quoted 43 lines
Output before:
71: Convert perf time to TSC:
71.1: TSC support: Skip (This architecture does not support)
71.2: Perf time to TSC: FAILED!Output after:
71: Convert perf time to TSC:
71.1: TSC support: Skip (This architecture does not support)
71.2: Perf time to TSC: Skip (perf_read_tsc_conversionis not supported)This also happens on an
x86_64virtual machine:# uname -m x86_64 $ ./perf test -F 71 71: Convert perf time to TSC : 71.1: TSC support : Ok 71.2: Perf time to TSC : FAILED! $Fixes 290fa68bdc45 ("perf test tsc: Fix error message when not supported")Signed-off-by Thomas Richter <[email protected]>Acked-by Sumanth Korikkar <[email protected]>--- tools/perf/tests/perf-time-to-tsc.c | 4 ++++ 1 file changed, 4 insertions(+)tools/perf/tests/perf-time-to-tsc.c +4
-0@@ -123,6 +123,10 @@ static int test__perf_time_to_tsc(struct test_suite *test __maybe_unused, int su evsel->core.attr.enable_on_exec =0 ; } +if (evlist__open (evlist) == -ENOENT ) { + err =TEST_SKIP ; + goto out_err; + }CHECK__ (evlist__open (evlist));CHECK__ (evlist__mmap (evlist,UINT_MAX ));Signature · 1 line
2.35.1
Signature · 1 line
- Arnaldo