perf evlist: Remove 'overwrite' parameter from perf_evlist__mmap
authorWang Nan <wangnan0@huawei.com>
Sun, 3 Dec 2017 02:00:37 +0000 (02:00 +0000)
committerArnaldo Carvalho de Melo <acme@redhat.com>
Tue, 5 Dec 2017 18:43:53 +0000 (15:43 -0300)
Now all perf_evlist__mmap's users doesn't set 'overwrite'. Remove it
from arguments list.

Signed-off-by: Wang Nan <wangnan0@huawei.com>
Acked-by: Namhyung Kim <namhyung@kernel.org>
Cc: Jiri Olsa <jolsa@redhat.com>
Cc: Kan Liang <kan.liang@intel.com>
Link: http://lkml.kernel.org/r/20171203020044.81680-2-wangnan0@huawei.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
17 files changed:
tools/perf/arch/x86/tests/perf-time-to-tsc.c
tools/perf/builtin-kvm.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 b59678e8c1e284c5a823d76062477abf492188a1..06abe8108b33c5397337312b99e730c124ec929c 100644 (file)
@@ -84,7 +84,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
 
        CHECK__(perf_evlist__open(evlist));
 
-       CHECK__(perf_evlist__mmap(evlist, UINT_MAX, false));
+       CHECK__(perf_evlist__mmap(evlist, UINT_MAX));
 
        pc = evlist->mmap[0].base;
        ret = perf_read_tsc_conversion(pc, &tc);
index 597c7de9bec9401a4bc05ea64e004403a64d9b20..98853162eae94c36b7e642bd358418d7d7d2d7ad 100644 (file)
@@ -1044,7 +1044,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
                goto out;
        }
 
-       if (perf_evlist__mmap(evlist, kvm->opts.mmap_pages, false) < 0) {
+       if (perf_evlist__mmap(evlist, kvm->opts.mmap_pages) < 0) {
                ui__error("Failed to mmap the events: %s\n",
                          str_error_r(errno, sbuf, sizeof(sbuf)));
                perf_evlist__close(evlist);
index 0077724fb24fe70cd1d20feb3995273da13b5228..540461f5e3451f155c8496214de492594b8eabd5 100644 (file)
@@ -907,7 +907,7 @@ try_again:
                }
        }
 
-       if (perf_evlist__mmap(evlist, opts->mmap_pages, false) < 0) {
+       if (perf_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 84debdbad32717ce3f5a00cf646d778527cc6302..7c57898095ea3fc68c8ca9b17f7e4c7ae562b56c 100644 (file)
@@ -2437,7 +2437,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
        if (err < 0)
                goto out_error_apply_filters;
 
-       err = perf_evlist__mmap(evlist, trace->opts.mmap_pages, false);
+       err = perf_evlist__mmap(evlist, trace->opts.mmap_pages);
        if (err < 0)
                goto out_error_mmap;
 
index 43a8c6ac4070e3b50868b39d3de0fdd38cbcfa5c..cf37e43c42f357294580ace7f232182920e45b83 100644 (file)
@@ -59,7 +59,7 @@ static int do_test(struct perf_evlist *evlist, int mmap_pages,
        int err;
        char sbuf[STRERR_BUFSIZE];
 
-       err = perf_evlist__mmap(evlist, mmap_pages, false);
+       err = perf_evlist__mmap(evlist, mmap_pages);
        if (err < 0) {
                pr_debug("perf_evlist__mmap: %s\n",
                         str_error_r(errno, sbuf, sizeof(sbuf)));
index 34c22cdf4d5d9a7c9322f5593fb877bd5b8aff08..c433dd30975a3b13ff08cc680e8782f30ce54cdf 100644 (file)
@@ -167,7 +167,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
                goto out_delete_evlist;
        }
 
-       err = perf_evlist__mmap(evlist, opts.mmap_pages, false);
+       err = perf_evlist__mmap(evlist, opts.mmap_pages);
        if (err < 0) {
                pr_debug("perf_evlist__mmap: %s\n",
                         str_error_r(errno, sbuf, sizeof(sbuf)));
index fcc8984bc329de7b4c4eb2fae74c45b8f5ed2ab4..3bf7b145b82620a6dfe91b3ef98791b110ca6fd2 100644 (file)
@@ -639,7 +639,7 @@ static int do_test_code_reading(bool try_kcore)
                break;
        }
 
-       ret = perf_evlist__mmap(evlist, UINT_MAX, false);
+       ret = perf_evlist__mmap(evlist, UINT_MAX);
        if (ret < 0) {
                pr_debug("perf_evlist__mmap failed\n");
                goto out_put;
index 842d33637a18fb3270b3b449766b584bb8b4da38..c465309189384a0c2b999879ff7323156a54b91c 100644 (file)
@@ -95,7 +95,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
                goto out_err;
        }
 
-       CHECK__(perf_evlist__mmap(evlist, UINT_MAX, false));
+       CHECK__(perf_evlist__mmap(evlist, UINT_MAX));
 
        /*
         * First, test that a 'comm' event can be found when the event is
index 91f10d6d9ae2f17c599b6c597f7e0658d1c83abf..c0e971da965cc9bb6f7d816996bc06c87b85dc05 100644 (file)
@@ -94,7 +94,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, false) < 0) {
+       if (perf_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 d9619d2653149292d5e4dd71d5cf0a5759f1026a..97c9407d02a010689c08e1e7c73903c93687fea5 100644 (file)
@@ -64,7 +64,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
                goto out_delete_evlist;
        }
 
-       err = perf_evlist__mmap(evlist, UINT_MAX, false);
+       err = perf_evlist__mmap(evlist, UINT_MAX);
        if (err < 0) {
                pr_debug("perf_evlist__mmap: %s\n",
                         str_error_r(errno, sbuf, sizeof(sbuf)));
index c34904d3770550a3d379390b8febdbc5c71cc293..0afafab852382527d587b2393b1a0c4d519101f3 100644 (file)
@@ -141,7 +141,7 @@ 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, false);
+       err = perf_evlist__mmap(evlist, opts.mmap_pages);
        if (err < 0) {
                pr_debug("perf_evlist__mmap: %s\n",
                         str_error_r(errno, sbuf, sizeof(sbuf)));
index c6937ed12e6bc6364c91bba77b85ff943719836e..f6c72f915d480728aa481fdf86cc526a61dd9eb4 100644 (file)
@@ -78,7 +78,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
                goto out_delete_evlist;
        }
 
-       err = perf_evlist__mmap(evlist, 128, false);
+       err = perf_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 7d3f4bf9534f4efc585ecf1d05ab2e0ae93415e1..33e00295a972aefe305e220d28f49e34a42a93dd 100644 (file)
@@ -449,7 +449,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
                goto out;
        }
 
-       err = perf_evlist__mmap(evlist, UINT_MAX, false);
+       err = perf_evlist__mmap(evlist, UINT_MAX);
        if (err) {
                pr_debug("perf_evlist__mmap failed!\n");
                goto out_err;
index 5d06ac81f7f12fd5980bb55b52a94a096fa334a2..01b62b81751b6458bea6234a0703f919f3f29b77 100644 (file)
@@ -101,7 +101,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
                goto out_delete_evlist;
        }
 
-       if (perf_evlist__mmap(evlist, 128, false) < 0) {
+       if (perf_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 199bb82efbcdf8ebf028e31dbdd0b598eb708aea..3c1778b500e0a01e297ca0fb3906c1353834fd54 100644 (file)
@@ -1091,10 +1091,9 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
        return perf_evlist__mmap_per_cpu(evlist, &mp);
 }
 
-int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages,
-                     bool overwrite)
+int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages)
 {
-       return perf_evlist__mmap_ex(evlist, pages, overwrite, 0, false);
+       return perf_evlist__mmap_ex(evlist, pages, false, 0, false);
 }
 
 int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
index 4e8131dacbd7d4d66c8a2d1109252ad336b571b8..f0f2c8b2504b6df1670fdce38edafe99b32699bd 100644 (file)
@@ -171,8 +171,7 @@ unsigned long perf_event_mlock_kb_in_pages(void);
 int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
                         bool overwrite, unsigned int auxtrace_pages,
                         bool auxtrace_overwrite);
-int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages,
-                     bool overwrite);
+int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages);
 void perf_evlist__munmap(struct perf_evlist *evlist);
 
 size_t perf_evlist__mmap_size(unsigned long pages);
index 8e49d9cafcfc00c515bd9fe3185490b97c33b12e..b1e999bd21ef9ddcbb210bf6526231a5fac7b4d1 100644 (file)
@@ -864,7 +864,7 @@ static PyObject *pyrf_evlist__mmap(struct pyrf_evlist *pevlist,
                                         &pages, &overwrite))
                return NULL;
 
-       if (perf_evlist__mmap(evlist, pages, overwrite) < 0) {
+       if (perf_evlist__mmap(evlist, pages) < 0) {
                PyErr_SetFromErrno(PyExc_OSError);
                return NULL;
        }