Skip to content

Commit 498c7a5

Browse files
ahunter6acmel
authored andcommitted
perf tests: Stop Convert perf time to TSC test opening events twice
Do not call evlist__open() twice. Fixes: 5bb017d ("perf test: Fix error message for test case 71 on s390, where it is not supported") Reviewed-by: Kan Liang <kan.liang@linux.intel.com> Signed-off-by: Adrian Hunter <adrian.hunter@intel.com> Cc: Ian Rogers <irogers@google.com> Cc: Jiri Olsa <jolsa@kernel.org> Cc: Namhyung Kim <namhyung@kernel.org> Cc: Thomas Richter <tmricht@linux.ibm.com> Link: https://lore.kernel.org/r/20220713123459.24145-2-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
1 parent 91d248c commit 498c7a5

File tree

1 file changed

+6
-3
lines changed

1 file changed

+6
-3
lines changed

tools/perf/tests/perf-time-to-tsc.c

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -123,11 +123,14 @@ static int test__perf_time_to_tsc(struct test_suite *test __maybe_unused, int su
123123
evsel->core.attr.enable_on_exec = 0;
124124
}
125125

126-
if (evlist__open(evlist) == -ENOENT) {
127-
err = TEST_SKIP;
126+
ret = evlist__open(evlist);
127+
if (ret < 0) {
128+
if (ret == -ENOENT)
129+
err = TEST_SKIP;
130+
else
131+
pr_debug("evlist__open() failed\n");
128132
goto out_err;
129133
}
130-
CHECK__(evlist__open(evlist));
131134

132135
CHECK__(evlist__mmap(evlist, UINT_MAX));
133136

0 commit comments

Comments
 (0)