summaryrefslogtreecommitdiffstats
path: root/tools/perf/tests/backward-ring-buffer.c
diff options
context:
space:
mode:
Diffstat (limited to 'tools/perf/tests/backward-ring-buffer.c')
-rw-r--r--tools/perf/tests/backward-ring-buffer.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c
index 338cd9faa835..15cea518f5ad 100644
--- a/tools/perf/tests/backward-ring-buffer.c
+++ b/tools/perf/tests/backward-ring-buffer.c
@@ -13,6 +13,7 @@
#include "util/mmap.h"
#include <errno.h>
#include <linux/string.h>
+#include <perf/mmap.h>
#define NR_ITERS 111
@@ -37,8 +38,8 @@ static int count_samples(struct evlist *evlist, int *sample_count,
struct mmap *map = &evlist->overwrite_mmap[i];
union perf_event *event;
- perf_mmap__read_init(map);
- while ((event = perf_mmap__read_event(map)) != NULL) {
+ perf_mmap__read_init(&map->core);
+ while ((event = perf_mmap__read_event(&map->core)) != NULL) {
const u32 type = event->header.type;
switch (type) {
@@ -53,7 +54,7 @@ static int count_samples(struct evlist *evlist, int *sample_count,
return TEST_FAIL;
}
}
- perf_mmap__read_done(map);
+ perf_mmap__read_done(&map->core);
}
return TEST_OK;
}
@@ -147,6 +148,15 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m
goto out_delete_evlist;
}
+ evlist__close(evlist);
+
+ err = evlist__open(evlist);
+ if (err < 0) {
+ pr_debug("perf_evlist__open: %s\n",
+ str_error_r(errno, sbuf, sizeof(sbuf)));
+ goto out_delete_evlist;
+ }
+
err = do_test(evlist, 1, &sample_count, &comm_count);
if (err != TEST_OK)
goto out_delete_evlist;