diff options
Diffstat (limited to 'tools/perf/tests/sw-clock.c')
-rw-r--r-- | tools/perf/tests/sw-clock.c | 18 |
1 files changed, 6 insertions, 12 deletions
diff --git a/tools/perf/tests/sw-clock.c b/tools/perf/tests/sw-clock.c index 6664a7cd828c..983d6b8562a8 100644 --- a/tools/perf/tests/sw-clock.c +++ b/tools/perf/tests/sw-clock.c @@ -45,7 +45,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) evsel = perf_evsel__new(&attr); if (evsel == NULL) { pr_debug("perf_evsel__new\n"); - goto out_free_evlist; + goto out_delete_evlist; } perf_evlist__add(evlist, evsel); @@ -54,7 +54,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) if (!evlist->cpus || !evlist->threads) { err = -ENOMEM; pr_debug("Not enough memory to create thread/cpu maps\n"); - goto out_delete_maps; + goto out_delete_evlist; } if (perf_evlist__open(evlist)) { @@ -63,14 +63,14 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) err = -errno; pr_debug("Couldn't open evlist: %s\nHint: check %s, using %" PRIu64 " in this test.\n", strerror(errno), knob, (u64)attr.sample_freq); - goto out_delete_maps; + goto out_delete_evlist; } err = perf_evlist__mmap(evlist, 128, true); if (err < 0) { pr_debug("failed to mmap event: %d (%s)\n", errno, strerror(errno)); - goto out_close_evlist; + goto out_delete_evlist; } perf_evlist__enable(evlist); @@ -90,7 +90,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) err = perf_evlist__parse_sample(evlist, event, &sample); if (err < 0) { pr_debug("Error during parse sample\n"); - goto out_unmap_evlist; + goto out_delete_evlist; } total_periods += sample.period; @@ -105,13 +105,7 @@ next_event: err = -1; } -out_unmap_evlist: - perf_evlist__munmap(evlist); -out_close_evlist: - perf_evlist__close(evlist); -out_delete_maps: - perf_evlist__delete_maps(evlist); -out_free_evlist: +out_delete_evlist: perf_evlist__delete(evlist); return err; } |