aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/tests/switch-tracking.c
diff options
context:
space:
mode:
authorGravatar Adrian Hunter <adrian.hunter@intel.com> 2022-08-09 11:07:02 +0300
committerGravatar Arnaldo Carvalho de Melo <acme@redhat.com> 2022-08-10 14:30:09 -0300
commit806731a9465b42aaf887cbaf8bfee7eccc9417de (patch)
tree7a1cf71e17d762a0f7dffd5c473b999d20147ff6 /tools/perf/tests/switch-tracking.c
parentperf tests: Fix Track with sched_switch test for hybrid case (diff)
downloadlinux-806731a9465b42aaf887cbaf8bfee7eccc9417de.tar.gz
linux-806731a9465b42aaf887cbaf8bfee7eccc9417de.tar.bz2
linux-806731a9465b42aaf887cbaf8bfee7eccc9417de.zip
perf tools: Do not pass NULL to parse_events()
Many cases do not use the extra error information provided by parse_events and instead pass NULL as the struct parse_events_error pointer. Add a wrapper for those cases so that the pointer is never NULL. 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> Link: https://lore.kernel.org/r/20220809080702.6921-4-adrian.hunter@intel.com Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Diffstat (limited to 'tools/perf/tests/switch-tracking.c')
-rw-r--r--tools/perf/tests/switch-tracking.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/tools/perf/tests/switch-tracking.c b/tools/perf/tests/switch-tracking.c
index 6f53bee33f7c..2d46af9ef935 100644
--- a/tools/perf/tests/switch-tracking.c
+++ b/tools/perf/tests/switch-tracking.c
@@ -364,7 +364,7 @@ static int test__switch_tracking(struct test_suite *test __maybe_unused, int sub
perf_evlist__set_maps(&evlist->core, cpus, threads);
/* First event */
- err = parse_events(evlist, "cpu-clock:u", NULL);
+ err = parse_event(evlist, "cpu-clock:u");
if (err) {
pr_debug("Failed to parse event dummy:u\n");
goto out_err;
@@ -375,14 +375,14 @@ static int test__switch_tracking(struct test_suite *test __maybe_unused, int sub
/* Second event */
if (perf_pmu__has_hybrid()) {
cycles = "cpu_core/cycles/u";
- err = parse_events(evlist, cycles, NULL);
+ err = parse_event(evlist, cycles);
if (err) {
cycles = "cpu_atom/cycles/u";
pr_debug("Trying %s\n", cycles);
- err = parse_events(evlist, cycles, NULL);
+ err = parse_event(evlist, cycles);
}
} else {
- err = parse_events(evlist, cycles, NULL);
+ err = parse_event(evlist, cycles);
}
if (err) {
pr_debug("Failed to parse event %s\n", cycles);
@@ -398,7 +398,7 @@ static int test__switch_tracking(struct test_suite *test __maybe_unused, int sub
goto out;
}
- err = parse_events(evlist, sched_switch, NULL);
+ err = parse_event(evlist, sched_switch);
if (err) {
pr_debug("Failed to parse event %s\n", sched_switch);
goto out_err;
@@ -428,7 +428,7 @@ static int test__switch_tracking(struct test_suite *test __maybe_unused, int sub
evsel__set_sample_bit(cycles_evsel, TIME);
/* Fourth event */
- err = parse_events(evlist, "dummy:u", NULL);
+ err = parse_event(evlist, "dummy:u");
if (err) {
pr_debug("Failed to parse event dummy:u\n");
goto out_err;