]> asedeno.scripts.mit.edu Git - linux.git/commitdiff
perf tools: Rename perf_evlist__mmap() to evlist__mmap()
authorJiri Olsa <jolsa@kernel.org>
Sun, 28 Jul 2019 10:45:35 +0000 (12:45 +0200)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Wed, 25 Sep 2019 12:51:44 +0000 (09:51 -0300)
Rename perf_evlist__mmap() to evlist__mmap(), so we don't have a name
clash when we add perf_evlist__mmap() in libperf.

Signed-off-by: Jiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Link: http://lore.kernel.org/lkml/20190913132355.21634-5-jolsa@kernel.org
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
18 files changed:
tools/perf/arch/x86/tests/perf-time-to-tsc.c
tools/perf/builtin-kvm.c
tools/perf/builtin-record.c
tools/perf/builtin-top.c
tools/perf/builtin-trace.c
tools/perf/tests/backward-ring-buffer.c
tools/perf/tests/bpf.c
tools/perf/tests/code-reading.c
tools/perf/tests/keep-tracking.c
tools/perf/tests/mmap-basic.c
tools/perf/tests/openat-syscall-tp-fields.c
tools/perf/tests/perf-record.c
tools/perf/tests/sw-clock.c
tools/perf/tests/switch-tracking.c
tools/perf/tests/task-exit.c
tools/perf/util/evlist.c
tools/perf/util/evlist.h
tools/perf/util/python.c

index c83abb1ed0ff6ebbf2fd708ba5d86c72bbb4c47d..42ae47525a76e88702785974187b4a2c3c936f51 100644 (file)
@@ -90,7 +90,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 
        CHECK__(evlist__open(evlist));
 
-       CHECK__(perf_evlist__mmap(evlist, UINT_MAX));
+       CHECK__(evlist__mmap(evlist, UINT_MAX));
 
        pc = evlist->mmap[0].base;
        ret = perf_read_tsc_conversion(pc, &tc);
index 7354b77e9137e98f231ceb89f16d3820a172a663..72debb7bd20d18bb8aff478cdb99d609adef10c8 100644 (file)
@@ -1060,7 +1060,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
                goto out;
        }
 
-       if (perf_evlist__mmap(evlist, kvm->opts.mmap_pages) < 0) {
+       if (evlist__mmap(evlist, kvm->opts.mmap_pages) < 0) {
                ui__error("Failed to mmap the events: %s\n",
                          str_error_r(errno, sbuf, sizeof(sbuf)));
                evlist__close(evlist);
index 1528fb686f96d26545a5188ea5aae366adc5317a..093d9ab5633eb0d2691882aa8d6f002fcccafdcc 100644 (file)
@@ -439,7 +439,7 @@ static int record__mmap_flush_parse(const struct option *opt,
        if (!opts->mmap_flush)
                opts->mmap_flush = MMAP_FLUSH_DEFAULT;
 
-       flush_max = perf_evlist__mmap_size(opts->mmap_pages);
+       flush_max = evlist__mmap_size(opts->mmap_pages);
        flush_max /= 4;
        if (opts->mmap_flush > flush_max)
                opts->mmap_flush = flush_max;
@@ -707,7 +707,7 @@ static int record__mmap_evlist(struct record *rec,
        if (opts->affinity != PERF_AFFINITY_SYS)
                cpu__setup_cpunode_map();
 
-       if (perf_evlist__mmap_ex(evlist, opts->mmap_pages,
+       if (evlist__mmap_ex(evlist, opts->mmap_pages,
                                 opts->auxtrace_mmap_pages,
                                 opts->auxtrace_snapshot_mode,
                                 opts->nr_cblocks, opts->affinity,
@@ -1980,7 +1980,7 @@ static int record__parse_mmap_pages(const struct option *opt,
 
 static void switch_output_size_warn(struct record *rec)
 {
-       u64 wakeup_size = perf_evlist__mmap_size(rec->opts.mmap_pages);
+       u64 wakeup_size = evlist__mmap_size(rec->opts.mmap_pages);
        struct switch_output *s = &rec->switch_output;
 
        wakeup_size /= 2;
index 834a927107c426816b7dd621593880d34eee0eee..771b3ff47dc3b64062a53e38e94bbfd0676810dd 100644 (file)
@@ -1042,7 +1042,7 @@ static int perf_top__start_counters(struct perf_top *top)
                }
        }
 
-       if (perf_evlist__mmap(evlist, opts->mmap_pages) < 0) {
+       if (evlist__mmap(evlist, opts->mmap_pages) < 0) {
                ui__error("Failed to mmap with %d (%s)\n",
                            errno, str_error_r(errno, msg, sizeof(msg)));
                goto out_err;
index 2f853870d68db346536860181be6e5684eb39eb9..ff989351567df27089c80ad48ba524977ebad18c 100644 (file)
@@ -3409,7 +3409,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
        if (trace->dump.map)
                bpf_map__fprintf(trace->dump.map, trace->output);
 
-       err = perf_evlist__mmap(evlist, trace->opts.mmap_pages);
+       err = evlist__mmap(evlist, trace->opts.mmap_pages);
        if (err < 0)
                goto out_error_mmap;
 
index 0a046096e6f449d42153ef265f2d9079fdf51f02..f1eb7e9c1d7d01727ffd79d353ec2e7afc291b37 100644 (file)
@@ -63,9 +63,9 @@ static int do_test(struct evlist *evlist, int mmap_pages,
        int err;
        char sbuf[STRERR_BUFSIZE];
 
-       err = perf_evlist__mmap(evlist, mmap_pages);
+       err = evlist__mmap(evlist, 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)));
                return TEST_FAIL;
        }
index cf9776aceb82e9cca2f0d1af5b0146c177646228..96473191549872b24b2084ec33d417af7fe75fc7 100644 (file)
@@ -167,9 +167,9 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
                goto out_delete_evlist;
        }
 
-       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;
        }
index df96cbb9ffe53d6a5c81de7a88d1600b3dd0ef65..413783b69006f5191ee76d205c2fabea9fc62445 100644 (file)
@@ -685,9 +685,9 @@ static int do_test_code_reading(bool try_kcore)
                break;
        }
 
-       ret = perf_evlist__mmap(evlist, UINT_MAX);
+       ret = evlist__mmap(evlist, UINT_MAX);
        if (ret < 0) {
-               pr_debug("perf_evlist__mmap failed\n");
+               pr_debug("evlist__mmap failed\n");
                goto out_put;
        }
 
index 67a87f507bbdd024461c9743570f96f223b6ffd7..8e2ec5f72042c6ee5d33191855b93a4a6ae9b520 100644 (file)
@@ -104,7 +104,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
                goto out_err;
        }
 
-       CHECK__(perf_evlist__mmap(evlist, UINT_MAX));
+       CHECK__(evlist__mmap(evlist, UINT_MAX));
 
        /*
         * First, test that a 'comm' event can be found when the event is
index accca3d78fa3ad01c9f7bc81357337520dd20b8d..4d42e455feb70f81777a9ca2f4f58312fb6931b6 100644 (file)
@@ -99,7 +99,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
                expected_nr_events[i] = 1 + rand() % 127;
        }
 
-       if (perf_evlist__mmap(evlist, 128) < 0) {
+       if (evlist__mmap(evlist, 128) < 0) {
                pr_debug("failed to mmap events: %d (%s)\n", errno,
                         str_error_r(errno, sbuf, sizeof(sbuf)));
                goto out_delete_evlist;
index e5ef74d4e92512a53ba0341376e678f16dc2030f..5c2576174ae9e38595a9737cf84b4daef6a74171 100644 (file)
@@ -69,9 +69,9 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
                goto out_delete_evlist;
        }
 
-       err = perf_evlist__mmap(evlist, UINT_MAX);
+       err = evlist__mmap(evlist, UINT_MAX);
        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;
        }
index 49d2d4c5956d36ebbbc1360328685ecd97365ec4..669fd88e7f30d54bd33f57ea11eecb92cc6fe401 100644 (file)
@@ -143,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;
        }
index 7abe0b6aabb75ee78b65926c83512409713a6ce0..fbff60815be85b11ede60b91172401b850073f31 100644 (file)
@@ -82,7 +82,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
                goto out_delete_evlist;
        }
 
-       err = perf_evlist__mmap(evlist, 128);
+       err = evlist__mmap(evlist, 128);
        if (err < 0) {
                pr_debug("failed to mmap event: %d (%s)\n", errno,
                         str_error_r(errno, sbuf, sizeof(sbuf)));
index e7888ddd69a342ffdd76ac796f6662df05ff6807..c92e287e0f538a73090d49019d86ee819ad16576 100644 (file)
@@ -460,9 +460,9 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
                goto out;
        }
 
-       err = perf_evlist__mmap(evlist, UINT_MAX);
+       err = evlist__mmap(evlist, UINT_MAX);
        if (err) {
-               pr_debug("perf_evlist__mmap failed!\n");
+               pr_debug("evlist__mmap failed!\n");
                goto out_err;
        }
 
index cff99707cc9d5d0beffc4e9849c0b54331784a25..718838b5e7249cc8eedee604c91b186b0d10ff58 100644 (file)
@@ -106,7 +106,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
                goto out_delete_evlist;
        }
 
-       if (perf_evlist__mmap(evlist, 128) < 0) {
+       if (evlist__mmap(evlist, 128) < 0) {
                pr_debug("failed to mmap events: %d (%s)\n", errno,
                         str_error_r(errno, sbuf, sizeof(sbuf)));
                goto out_delete_evlist;
index ceab9fb7f7f939f5e6915721f90d46df04d61b52..e8afe4fdc1b23361a3ce3f618474cf3311ff515e 100644 (file)
@@ -732,7 +732,7 @@ perf_evlist__should_poll(struct evlist *evlist __maybe_unused,
        return true;
 }
 
-static int perf_evlist__mmap_per_evsel(struct evlist *evlist, int idx,
+static int evlist__mmap_per_evsel(struct evlist *evlist, int idx,
                                       struct mmap_params *mp, int cpu_idx,
                                       int thread, int *_output, int *_output_overwrite)
 {
@@ -810,7 +810,7 @@ static int perf_evlist__mmap_per_evsel(struct evlist *evlist, int idx,
        return 0;
 }
 
-static int perf_evlist__mmap_per_cpu(struct evlist *evlist,
+static int evlist__mmap_per_cpu(struct evlist *evlist,
                                     struct mmap_params *mp)
 {
        int cpu, thread;
@@ -826,7 +826,7 @@ static int perf_evlist__mmap_per_cpu(struct evlist *evlist,
                                              true);
 
                for (thread = 0; thread < nr_threads; thread++) {
-                       if (perf_evlist__mmap_per_evsel(evlist, cpu, mp, cpu,
+                       if (evlist__mmap_per_evsel(evlist, cpu, mp, cpu,
                                                        thread, &output, &output_overwrite))
                                goto out_unmap;
                }
@@ -839,7 +839,7 @@ static int perf_evlist__mmap_per_cpu(struct evlist *evlist,
        return -1;
 }
 
-static int perf_evlist__mmap_per_thread(struct evlist *evlist,
+static int evlist__mmap_per_thread(struct evlist *evlist,
                                        struct mmap_params *mp)
 {
        int thread;
@@ -853,7 +853,7 @@ static int perf_evlist__mmap_per_thread(struct evlist *evlist,
                auxtrace_mmap_params__set_idx(&mp->auxtrace_mp, evlist, thread,
                                              false);
 
-               if (perf_evlist__mmap_per_evsel(evlist, thread, mp, 0, thread,
+               if (evlist__mmap_per_evsel(evlist, thread, mp, 0, thread,
                                                &output, &output_overwrite))
                        goto out_unmap;
        }
@@ -888,7 +888,7 @@ unsigned long perf_event_mlock_kb_in_pages(void)
        return pages;
 }
 
-size_t perf_evlist__mmap_size(unsigned long pages)
+size_t evlist__mmap_size(unsigned long pages)
 {
        if (pages == UINT_MAX)
                pages = perf_event_mlock_kb_in_pages();
@@ -971,7 +971,7 @@ int perf_evlist__parse_mmap_pages(const struct option *opt, const char *str,
 }
 
 /**
- * perf_evlist__mmap_ex - Create mmaps to receive events.
+ * evlist__mmap_ex - Create mmaps to receive events.
  * @evlist: list of events
  * @pages: map length in pages
  * @overwrite: overwrite older events?
@@ -979,7 +979,7 @@ int perf_evlist__parse_mmap_pages(const struct option *opt, const char *str,
  * @auxtrace_overwrite - overwrite older auxtrace data?
  *
  * If @overwrite is %false the user needs to signal event consumption using
- * perf_mmap__write_tail().  Using perf_evlist__mmap_read() does this
+ * perf_mmap__write_tail().  Using evlist__mmap_read() does this
  * automatically.
  *
  * Similarly, if @auxtrace_overwrite is %false the user needs to signal data
@@ -987,7 +987,7 @@ int perf_evlist__parse_mmap_pages(const struct option *opt, const char *str,
  *
  * Return: %0 on success, negative error code otherwise.
  */
-int perf_evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
+int evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
                         unsigned int auxtrace_pages,
                         bool auxtrace_overwrite, int nr_cblocks, int affinity, int flush,
                         int comp_level)
@@ -1011,7 +1011,7 @@ int perf_evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
        if (evlist->pollfd.entries == NULL && perf_evlist__alloc_pollfd(evlist) < 0)
                return -ENOMEM;
 
-       evlist->mmap_len = perf_evlist__mmap_size(pages);
+       evlist->mmap_len = evlist__mmap_size(pages);
        pr_debug("mmap size %zuB\n", evlist->mmap_len);
        mp.mask = evlist->mmap_len - page_size - 1;
 
@@ -1026,14 +1026,14 @@ int perf_evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
        }
 
        if (perf_cpu_map__empty(cpus))
-               return perf_evlist__mmap_per_thread(evlist, &mp);
+               return evlist__mmap_per_thread(evlist, &mp);
 
-       return perf_evlist__mmap_per_cpu(evlist, &mp);
+       return evlist__mmap_per_cpu(evlist, &mp);
 }
 
-int perf_evlist__mmap(struct evlist *evlist, unsigned int pages)
+int evlist__mmap(struct evlist *evlist, unsigned int pages)
 {
-       return perf_evlist__mmap_ex(evlist, pages, 0, false, 0, PERF_AFFINITY_SYS, 1, 0);
+       return evlist__mmap_ex(evlist, pages, 0, false, 0, PERF_AFFINITY_SYS, 1, 0);
 }
 
 int perf_evlist__create_maps(struct evlist *evlist, struct target *target)
@@ -1889,7 +1889,7 @@ int perf_evlist__start_sb_thread(struct evlist *evlist,
                        goto out_delete_evlist;
        }
 
-       if (perf_evlist__mmap(evlist, UINT_MAX))
+       if (evlist__mmap(evlist, UINT_MAX))
                goto out_delete_evlist;
 
        evlist__for_each_entry(evlist, counter) {
index 1297863615720dfa4a673bf0ecf8d9cad0365a8a..aaf06182c1b8342d354add9d6d7d912077ae2a31 100644 (file)
@@ -139,7 +139,7 @@ struct perf_sample_id *perf_evlist__id2sid(struct evlist *evlist, u64 id);
 
 void perf_evlist__toggle_bkw_mmap(struct evlist *evlist, enum bkw_mmap_state state);
 
-void perf_evlist__mmap_consume(struct evlist *evlist, int idx);
+void evlist__mmap_consume(struct evlist *evlist, int idx);
 
 int evlist__open(struct evlist *evlist);
 void evlist__close(struct evlist *evlist);
@@ -170,14 +170,14 @@ int perf_evlist__parse_mmap_pages(const struct option *opt,
 
 unsigned long perf_event_mlock_kb_in_pages(void);
 
-int perf_evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
+int evlist__mmap_ex(struct evlist *evlist, unsigned int pages,
                         unsigned int auxtrace_pages,
                         bool auxtrace_overwrite, int nr_cblocks,
                         int affinity, int flush, int comp_level);
-int perf_evlist__mmap(struct evlist *evlist, unsigned int pages);
+int evlist__mmap(struct evlist *evlist, unsigned int pages);
 void perf_evlist__munmap(struct evlist *evlist);
 
-size_t perf_evlist__mmap_size(unsigned long pages);
+size_t evlist__mmap_size(unsigned long pages);
 
 void evlist__disable(struct evlist *evlist);
 void evlist__enable(struct evlist *evlist);
index 1e1247cffea8bf8a742863cb88b4922c3e389973..b102d174b86867b25e006fbb8b3073f1628fe14e 100644 (file)
@@ -899,7 +899,7 @@ static PyObject *pyrf_evlist__mmap(struct pyrf_evlist *pevlist,
                                         &pages, &overwrite))
                return NULL;
 
-       if (perf_evlist__mmap(evlist, pages) < 0) {
+       if (evlist__mmap(evlist, pages) < 0) {
                PyErr_SetFromErrno(PyExc_OSError);
                return NULL;
        }