diff options
Diffstat (limited to 'tools/perf/tests/openat-syscall-tp-fields.c')
-rw-r--r-- | tools/perf/tests/openat-syscall-tp-fields.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/tools/perf/tests/openat-syscall-tp-fields.c b/tools/perf/tests/openat-syscall-tp-fields.c index 43519267b93b..344dc3ac2469 100644 --- a/tools/perf/tests/openat-syscall-tp-fields.c +++ b/tools/perf/tests/openat-syscall-tp-fields.c @@ -86,8 +86,13 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest 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; int tp_flags; struct perf_sample sample; @@ -95,7 +100,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest ++nr_events; if (type != PERF_RECORD_SAMPLE) { - perf_evlist__mmap_consume(evlist, i); + perf_mmap__consume(md); continue; } @@ -115,6 +120,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest goto out_ok; } + perf_mmap__read_done(md); } if (nr_events == before) |