diff options
Diffstat (limited to 'tools/perf/tests/bpf.c')
-rw-r--r-- | tools/perf/tests/bpf.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/perf/tests/bpf.c b/tools/perf/tests/bpf.c index e8399beca62b..79b54f8ddebf 100644 --- a/tools/perf/tests/bpf.c +++ b/tools/perf/tests/bpf.c @@ -176,13 +176,19 @@ static int do_test(struct bpf_object *obj, int (*func)(void), for (i = 0; i < evlist->nr_mmaps; i++) { union perf_event *event; + struct perf_mmap *md; - while ((event = perf_evlist__mmap_read(evlist, i)) != NULL) { + md = &evlist->mmap[i]; + if (perf_mmap__read_init(md) < 0) + continue; + + while ((event = perf_mmap__read_event(md)) != NULL) { const u32 type = event->header.type; if (type == PERF_RECORD_SAMPLE) count ++; } + perf_mmap__read_done(md); } if (count != expect) { |