perf tests: Fix Track with sched_switch test for hybrid case
commit 1da1d60774014137d776d0400fdf2f1779d8d4d5 upstream.
If cpu_core PMU event fails to parse, try also cpu_atom PMU event when
parsing cycles event.
Fixes: 43eb05d066 ("perf tests: Support 'Track with sched_switch' test for hybrid")
Signed-off-by: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jin Yao <yao.jin@linux.intel.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Link: https://lore.kernel.org/r/20220809080702.6921-3-adrian.hunter@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
5958ef867b
commit
f39b424b43
@@ -324,6 +324,7 @@ out_free_nodes:
|
|||||||
int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_unused)
|
int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_unused)
|
||||||
{
|
{
|
||||||
const char *sched_switch = "sched:sched_switch";
|
const char *sched_switch = "sched:sched_switch";
|
||||||
|
const char *cycles = "cycles:u";
|
||||||
struct switch_tracking switch_tracking = { .tids = NULL, };
|
struct switch_tracking switch_tracking = { .tids = NULL, };
|
||||||
struct record_opts opts = {
|
struct record_opts opts = {
|
||||||
.mmap_pages = UINT_MAX,
|
.mmap_pages = UINT_MAX,
|
||||||
@@ -372,12 +373,19 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
|
|||||||
cpu_clocks_evsel = evlist__last(evlist);
|
cpu_clocks_evsel = evlist__last(evlist);
|
||||||
|
|
||||||
/* Second event */
|
/* Second event */
|
||||||
if (perf_pmu__has_hybrid())
|
if (perf_pmu__has_hybrid()) {
|
||||||
err = parse_events(evlist, "cpu_core/cycles/u", NULL);
|
cycles = "cpu_core/cycles/u";
|
||||||
else
|
err = parse_events(evlist, cycles, NULL);
|
||||||
err = parse_events(evlist, "cycles:u", NULL);
|
if (err) {
|
||||||
|
cycles = "cpu_atom/cycles/u";
|
||||||
|
pr_debug("Trying %s\n", cycles);
|
||||||
|
err = parse_events(evlist, cycles, NULL);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
err = parse_events(evlist, cycles, NULL);
|
||||||
|
}
|
||||||
if (err) {
|
if (err) {
|
||||||
pr_debug("Failed to parse event cycles:u\n");
|
pr_debug("Failed to parse event %s\n", cycles);
|
||||||
goto out_err;
|
goto out_err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user