]> asedeno.scripts.mit.edu Git - linux.git/blobdiff - tools/perf/tests/perf-record.c
perf tools: Rename perf_evlist__mmap() to evlist__mmap()
[linux.git] / tools / perf / tests / perf-record.c
index 07f6bd8ed719d9320dd106690a6b3bf92d415cc3..669fd88e7f30d54bd33f57ea11eecb92cc6fe401 100644 (file)
@@ -1,14 +1,15 @@
 // SPDX-License-Identifier: GPL-2.0
 #include <errno.h>
 #include <inttypes.h>
+#include <linux/string.h>
 /* For the CLR_() macros */
 #include <pthread.h>
 
 #include <sched.h>
 #include "evlist.h"
 #include "evsel.h"
-#include "perf.h"
 #include "debug.h"
+#include "record.h"
 #include "tests.h"
 
 static int sched__get_first_possible_cpu(pid_t pid, cpu_set_t *maskp)
@@ -50,8 +51,8 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
        };
        cpu_set_t cpu_mask;
        size_t cpu_mask_size = sizeof(cpu_mask);
-       struct perf_evlist *evlist = perf_evlist__new_dummy();
-       struct perf_evsel *evsel;
+       struct evlist *evlist = perf_evlist__new_dummy();
+       struct evsel *evsel;
        struct perf_sample sample;
        const char *cmd = "sleep";
        const char *argv[] = { cmd, "1", NULL, };
@@ -130,7 +131,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
         * Call sys_perf_event_open on all the fds on all the evsels,
         * grouping them if asked to.
         */
-       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)));
@@ -142,9 +143,9 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
         * fds in the same CPU to be injected in the same mmap ring buffer
         * (using ioctl(PERF_EVENT_IOC_SET_OUTPUT)).
         */
-       err = perf_evlist__mmap(evlist, opts.mmap_pages);
+       err = evlist__mmap(evlist, opts.mmap_pages);
        if (err < 0) {
-               pr_debug("perf_evlist__mmap: %s\n",
+               pr_debug("evlist__mmap: %s\n",
                         str_error_r(errno, sbuf, sizeof(sbuf)));
                goto out_delete_evlist;
        }
@@ -153,7 +154,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
         * Now that all is properly set up, enable the events, they will
         * count just on workload.pid, which will start...
         */
-       perf_evlist__enable(evlist);
+       evlist__enable(evlist);
 
        /*
         * Now!
@@ -165,7 +166,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
 
                for (i = 0; i < evlist->nr_mmaps; i++) {
                        union perf_event *event;
-                       struct perf_mmap *md;
+                       struct mmap *md;
 
                        md = &evlist->mmap[i];
                        if (perf_mmap__read_init(md) < 0)
@@ -325,7 +326,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus
                ++errs;
        }
 out_delete_evlist:
-       perf_evlist__delete(evlist);
+       evlist__delete(evlist);
 out:
        return (err < 0 || errs > 0) ? -1 : 0;
 }