History

perf test: Fix error message for test case 71 on s390, where it is not supported

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! $ Committer testing: Continues to work on x86_64: $ perf test 71 71: Convert perf time to TSC : 71.1: TSC support : Ok 71.2: Perf time to TSC : Ok $

Thomas Richter committed 4 years ago

Commit 5bb017d1 parent ccb17ca1 file · +4 −0Browse files

Unified · Split

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 · 122 unmodified lines
123 evsel->core.attr.enable_on_exec = 0;123 evsel->core.attr.enable_on_exec = 0;
124 }124 }
125 125
126 if (evlist__open(evlist) == -ENOENT) {
127 err = TEST_SKIP;
128 goto out_err;
129 }
126 CHECK__(evlist__open(evlist));130 CHECK__(evlist__open(evlist));
127 131
128 CHECK__(evlist__mmap(evlist, UINT_MAX));132 CHECK__(evlist__mmap(evlist, UINT_MAX));

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t