Commit f74b9d3a authored by Wang Nan's avatar Wang Nan Committed by Arnaldo Carvalho de Melo

perf evlist: Remove 'overwrite' parameter from perf_evlist__mmap

Now all perf_evlist__mmap's users doesn't set 'overwrite'. Remove it
from arguments list.
Signed-off-by: default avatarWang Nan <wangnan0@huawei.com>
Acked-by: default avatarNamhyung 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.comSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c6707fde
...@@ -84,7 +84,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe ...@@ -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__open(evlist));
CHECK__(perf_evlist__mmap(evlist, UINT_MAX, false)); CHECK__(perf_evlist__mmap(evlist, UINT_MAX));
pc = evlist->mmap[0].base; pc = evlist->mmap[0].base;
ret = perf_read_tsc_conversion(pc, &tc); ret = perf_read_tsc_conversion(pc, &tc);
......
...@@ -1044,7 +1044,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm) ...@@ -1044,7 +1044,7 @@ static int kvm_live_open_events(struct perf_kvm_stat *kvm)
goto out; 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", ui__error("Failed to mmap the events: %s\n",
str_error_r(errno, sbuf, sizeof(sbuf))); str_error_r(errno, sbuf, sizeof(sbuf)));
perf_evlist__close(evlist); perf_evlist__close(evlist);
......
...@@ -907,7 +907,7 @@ static int perf_top__start_counters(struct perf_top *top) ...@@ -907,7 +907,7 @@ static int perf_top__start_counters(struct perf_top *top)
} }
} }
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", ui__error("Failed to mmap with %d (%s)\n",
errno, str_error_r(errno, msg, sizeof(msg))); errno, str_error_r(errno, msg, sizeof(msg)));
goto out_err; goto out_err;
......
...@@ -2437,7 +2437,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv) ...@@ -2437,7 +2437,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
if (err < 0) if (err < 0)
goto out_error_apply_filters; 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) if (err < 0)
goto out_error_mmap; goto out_error_mmap;
......
...@@ -59,7 +59,7 @@ static int do_test(struct perf_evlist *evlist, int mmap_pages, ...@@ -59,7 +59,7 @@ static int do_test(struct perf_evlist *evlist, int mmap_pages,
int err; int err;
char sbuf[STRERR_BUFSIZE]; char sbuf[STRERR_BUFSIZE];
err = perf_evlist__mmap(evlist, mmap_pages, false); err = perf_evlist__mmap(evlist, mmap_pages);
if (err < 0) { if (err < 0) {
pr_debug("perf_evlist__mmap: %s\n", pr_debug("perf_evlist__mmap: %s\n",
str_error_r(errno, sbuf, sizeof(sbuf))); str_error_r(errno, sbuf, sizeof(sbuf)));
......
...@@ -167,7 +167,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void), ...@@ -167,7 +167,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
goto out_delete_evlist; goto out_delete_evlist;
} }
err = perf_evlist__mmap(evlist, opts.mmap_pages, false); err = perf_evlist__mmap(evlist, opts.mmap_pages);
if (err < 0) { if (err < 0) {
pr_debug("perf_evlist__mmap: %s\n", pr_debug("perf_evlist__mmap: %s\n",
str_error_r(errno, sbuf, sizeof(sbuf))); str_error_r(errno, sbuf, sizeof(sbuf)));
......
...@@ -639,7 +639,7 @@ static int do_test_code_reading(bool try_kcore) ...@@ -639,7 +639,7 @@ static int do_test_code_reading(bool try_kcore)
break; break;
} }
ret = perf_evlist__mmap(evlist, UINT_MAX, false); ret = perf_evlist__mmap(evlist, UINT_MAX);
if (ret < 0) { if (ret < 0) {
pr_debug("perf_evlist__mmap failed\n"); pr_debug("perf_evlist__mmap failed\n");
goto out_put; goto out_put;
......
...@@ -95,7 +95,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un ...@@ -95,7 +95,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
goto out_err; 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 * First, test that a 'comm' event can be found when the event is
......
...@@ -94,7 +94,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse ...@@ -94,7 +94,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
expected_nr_events[i] = 1 + rand() % 127; 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, pr_debug("failed to mmap events: %d (%s)\n", errno,
str_error_r(errno, sbuf, sizeof(sbuf))); str_error_r(errno, sbuf, sizeof(sbuf)));
goto out_delete_evlist; goto out_delete_evlist;
......
...@@ -64,7 +64,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest ...@@ -64,7 +64,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
goto out_delete_evlist; goto out_delete_evlist;
} }
err = perf_evlist__mmap(evlist, UINT_MAX, false); err = perf_evlist__mmap(evlist, UINT_MAX);
if (err < 0) { if (err < 0) {
pr_debug("perf_evlist__mmap: %s\n", pr_debug("perf_evlist__mmap: %s\n",
str_error_r(errno, sbuf, sizeof(sbuf))); str_error_r(errno, sbuf, sizeof(sbuf)));
......
...@@ -141,7 +141,7 @@ int test__PERF_RECORD(struct test *test __maybe_unused, int subtest __maybe_unus ...@@ -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 * fds in the same CPU to be injected in the same mmap ring buffer
* (using ioctl(PERF_EVENT_IOC_SET_OUTPUT)). * (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) { if (err < 0) {
pr_debug("perf_evlist__mmap: %s\n", pr_debug("perf_evlist__mmap: %s\n",
str_error_r(errno, sbuf, sizeof(sbuf))); str_error_r(errno, sbuf, sizeof(sbuf)));
......
...@@ -78,7 +78,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) ...@@ -78,7 +78,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
goto out_delete_evlist; goto out_delete_evlist;
} }
err = perf_evlist__mmap(evlist, 128, false); err = perf_evlist__mmap(evlist, 128);
if (err < 0) { if (err < 0) {
pr_debug("failed to mmap event: %d (%s)\n", errno, pr_debug("failed to mmap event: %d (%s)\n", errno,
str_error_r(errno, sbuf, sizeof(sbuf))); str_error_r(errno, sbuf, sizeof(sbuf)));
......
...@@ -449,7 +449,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_ ...@@ -449,7 +449,7 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
goto out; goto out;
} }
err = perf_evlist__mmap(evlist, UINT_MAX, false); err = perf_evlist__mmap(evlist, UINT_MAX);
if (err) { if (err) {
pr_debug("perf_evlist__mmap failed!\n"); pr_debug("perf_evlist__mmap failed!\n");
goto out_err; goto out_err;
......
...@@ -101,7 +101,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused ...@@ -101,7 +101,7 @@ int test__task_exit(struct test *test __maybe_unused, int subtest __maybe_unused
goto out_delete_evlist; 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, pr_debug("failed to mmap events: %d (%s)\n", errno,
str_error_r(errno, sbuf, sizeof(sbuf))); str_error_r(errno, sbuf, sizeof(sbuf)));
goto out_delete_evlist; goto out_delete_evlist;
......
...@@ -1091,10 +1091,9 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages, ...@@ -1091,10 +1091,9 @@ int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
return perf_evlist__mmap_per_cpu(evlist, &mp); return perf_evlist__mmap_per_cpu(evlist, &mp);
} }
int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages)
bool overwrite)
{ {
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) int perf_evlist__create_maps(struct perf_evlist *evlist, struct target *target)
......
...@@ -171,8 +171,7 @@ unsigned long perf_event_mlock_kb_in_pages(void); ...@@ -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, int perf_evlist__mmap_ex(struct perf_evlist *evlist, unsigned int pages,
bool overwrite, unsigned int auxtrace_pages, bool overwrite, unsigned int auxtrace_pages,
bool auxtrace_overwrite); bool auxtrace_overwrite);
int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages, int perf_evlist__mmap(struct perf_evlist *evlist, unsigned int pages);
bool overwrite);
void perf_evlist__munmap(struct perf_evlist *evlist); void perf_evlist__munmap(struct perf_evlist *evlist);
size_t perf_evlist__mmap_size(unsigned long pages); size_t perf_evlist__mmap_size(unsigned long pages);
......
...@@ -864,7 +864,7 @@ static PyObject *pyrf_evlist__mmap(struct pyrf_evlist *pevlist, ...@@ -864,7 +864,7 @@ static PyObject *pyrf_evlist__mmap(struct pyrf_evlist *pevlist,
&pages, &overwrite)) &pages, &overwrite))
return NULL; return NULL;
if (perf_evlist__mmap(evlist, pages, overwrite) < 0) { if (perf_evlist__mmap(evlist, pages) < 0) {
PyErr_SetFromErrno(PyExc_OSError); PyErr_SetFromErrno(PyExc_OSError);
return NULL; return NULL;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment