diff options
Diffstat (limited to 'tools/perf/tests/backward-ring-buffer.c')
-rw-r--r-- | tools/perf/tests/backward-ring-buffer.c | 22 |
1 files changed, 12 insertions, 10 deletions
diff --git a/tools/perf/tests/backward-ring-buffer.c b/tools/perf/tests/backward-ring-buffer.c index 1a9c3becf5ff..a637a4a90760 100644 --- a/tools/perf/tests/backward-ring-buffer.c +++ b/tools/perf/tests/backward-ring-buffer.c @@ -4,12 +4,14 @@ * beginning */ -#include <perf.h> #include <evlist.h> #include <sys/prctl.h> +#include "record.h" #include "tests.h" #include "debug.h" +#include "parse-events.h" #include <errno.h> +#include <linux/string.h> #define NR_ITERS 111 @@ -25,7 +27,7 @@ static void testcase(void) } } -static int count_samples(struct perf_evlist *evlist, int *sample_count, +static int count_samples(struct evlist *evlist, int *sample_count, int *comm_count) { int i; @@ -55,7 +57,7 @@ static int count_samples(struct perf_evlist *evlist, int *sample_count, return TEST_OK; } -static int do_test(struct perf_evlist *evlist, int mmap_pages, +static int do_test(struct evlist *evlist, int mmap_pages, int *sample_count, int *comm_count) { int err; @@ -68,9 +70,9 @@ static int do_test(struct perf_evlist *evlist, int mmap_pages, return TEST_FAIL; } - perf_evlist__enable(evlist); + evlist__enable(evlist); testcase(); - perf_evlist__disable(evlist); + evlist__disable(evlist); err = count_samples(evlist, sample_count, comm_count); perf_evlist__munmap(evlist); @@ -82,8 +84,8 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m { int ret = TEST_SKIP, err, sample_count = 0, comm_count = 0; char pid[16], sbuf[STRERR_BUFSIZE]; - struct perf_evlist *evlist; - struct perf_evsel *evsel __maybe_unused; + struct evlist *evlist; + struct evsel *evsel __maybe_unused; struct parse_events_error parse_error; struct record_opts opts = { .target = { @@ -99,7 +101,7 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m pid[sizeof(pid) - 1] = '\0'; opts.target.tid = opts.target.pid = pid; - evlist = perf_evlist__new(); + evlist = evlist__new(); if (!evlist) { pr_debug("Not enough memory to create evlist\n"); return TEST_FAIL; @@ -125,7 +127,7 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m perf_evlist__config(evlist, &opts, NULL); - err = perf_evlist__open(evlist); + err = evlist__open(evlist); if (err < 0) { pr_debug("perf_evlist__open: %s\n", str_error_r(errno, sbuf, sizeof(sbuf))); @@ -150,6 +152,6 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m ret = TEST_OK; out_delete_evlist: - perf_evlist__delete(evlist); + evlist__delete(evlist); return ret; } |