Skip to content

Commit

Permalink
perf tests: Stop Convert perf time to TSC test opening events twice
Browse files Browse the repository at this point in the history
[ Upstream commit 498c7a5 ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
  • Loading branch information
ahunter6 authored and gregkh committed Jul 29, 2022
1 parent 3697b58 commit fc23fa2
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions tools/perf/tests/perf-time-to-tsc.c
Original file line number Diff line number Diff line change
Expand Up @@ -123,11 +123,14 @@ 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;
ret = evlist__open(evlist);
if (ret < 0) {
if (ret == -ENOENT)
err = TEST_SKIP;
else
pr_debug("evlist__open() failed\n");
goto out_err;
}
CHECK__(evlist__open(evlist));

CHECK__(evlist__mmap(evlist, UINT_MAX));

Expand Down

0 comments on commit fc23fa2

Please sign in to comment.