Commit a1cf3a75 authored by Jiri Olsa's avatar Jiri Olsa Committed by Arnaldo Carvalho de Melo

perf evlist: Rename perf_evlist__add() to evlist__add()

Rename perf_evlist__add() to evlist__add(), so we don't have a name
clash when we add perf_evlist__add() in libperf.
Signed-off-by: default avatarJiri Olsa <jolsa@kernel.org>
Cc: Alexander Shishkin <alexander.shishkin@linux.intel.com>
Cc: Alexey Budankov <alexey.budankov@linux.intel.com>
Cc: Andi Kleen <ak@linux.intel.com>
Cc: Michael Petlan <mpetlan@redhat.com>
Cc: Namhyung Kim <namhyung@kernel.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Link: http://lkml.kernel.org/r/20190721112506.12306-13-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent 365c3ae7
...@@ -2616,7 +2616,7 @@ static int trace__record(struct trace *trace, int argc, const char **argv) ...@@ -2616,7 +2616,7 @@ static int trace__record(struct trace *trace, int argc, const char **argv)
static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp); static size_t trace__fprintf_thread_summary(struct trace *trace, FILE *fp);
static bool perf_evlist__add_vfs_getname(struct evlist *evlist) static bool evlist__add_vfs_getname(struct evlist *evlist)
{ {
bool found = false; bool found = false;
struct evsel *evsel, *tmp; struct evsel *evsel, *tmp;
...@@ -2719,8 +2719,8 @@ static int trace__add_syscall_newtp(struct trace *trace) ...@@ -2719,8 +2719,8 @@ static int trace__add_syscall_newtp(struct trace *trace)
perf_evsel__config_callchain(sys_enter, &trace->opts, &callchain_param); perf_evsel__config_callchain(sys_enter, &trace->opts, &callchain_param);
perf_evsel__config_callchain(sys_exit, &trace->opts, &callchain_param); perf_evsel__config_callchain(sys_exit, &trace->opts, &callchain_param);
perf_evlist__add(evlist, sys_enter); evlist__add(evlist, sys_enter);
perf_evlist__add(evlist, sys_exit); evlist__add(evlist, sys_exit);
if (callchain_param.enabled && !trace->kernel_syscallchains) { if (callchain_param.enabled && !trace->kernel_syscallchains) {
/* /*
...@@ -3264,7 +3264,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv) ...@@ -3264,7 +3264,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
goto out_error_raw_syscalls; goto out_error_raw_syscalls;
if (trace->trace_syscalls) if (trace->trace_syscalls)
trace->vfs_getname = perf_evlist__add_vfs_getname(evlist); trace->vfs_getname = evlist__add_vfs_getname(evlist);
} }
if ((trace->trace_pgfaults & TRACE_PFMAJ)) { if ((trace->trace_pgfaults & TRACE_PFMAJ)) {
...@@ -3272,7 +3272,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv) ...@@ -3272,7 +3272,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
if (pgfault_maj == NULL) if (pgfault_maj == NULL)
goto out_error_mem; goto out_error_mem;
perf_evsel__config_callchain(pgfault_maj, &trace->opts, &callchain_param); perf_evsel__config_callchain(pgfault_maj, &trace->opts, &callchain_param);
perf_evlist__add(evlist, pgfault_maj); evlist__add(evlist, pgfault_maj);
} }
if ((trace->trace_pgfaults & TRACE_PFMIN)) { if ((trace->trace_pgfaults & TRACE_PFMIN)) {
...@@ -3280,7 +3280,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv) ...@@ -3280,7 +3280,7 @@ static int trace__run(struct trace *trace, int argc, const char **argv)
if (pgfault_min == NULL) if (pgfault_min == NULL)
goto out_error_mem; goto out_error_mem;
perf_evsel__config_callchain(pgfault_min, &trace->opts, &callchain_param); perf_evsel__config_callchain(pgfault_min, &trace->opts, &callchain_param);
perf_evlist__add(evlist, pgfault_min); evlist__add(evlist, pgfault_min);
} }
if (trace->sched && if (trace->sched &&
......
...@@ -82,7 +82,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse ...@@ -82,7 +82,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
evsels[i]->attr.wakeup_events = 1; evsels[i]->attr.wakeup_events = 1;
perf_evsel__set_sample_id(evsels[i], false); perf_evsel__set_sample_id(evsels[i], false);
perf_evlist__add(evlist, evsels[i]); evlist__add(evlist, evsels[i]);
if (perf_evsel__open(evsels[i], cpus, threads) < 0) { if (perf_evsel__open(evsels[i], cpus, threads) < 0) {
pr_debug("failed to open counter: %s, " pr_debug("failed to open counter: %s, "
......
...@@ -48,7 +48,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest ...@@ -48,7 +48,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
goto out_delete_evlist; goto out_delete_evlist;
} }
perf_evlist__add(evlist, evsel); evlist__add(evlist, evsel);
err = perf_evlist__create_maps(evlist, &opts.target); err = perf_evlist__create_maps(evlist, &opts.target);
if (err < 0) { if (err < 0) {
......
...@@ -54,7 +54,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id) ...@@ -54,7 +54,7 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
pr_debug("perf_evsel__new\n"); pr_debug("perf_evsel__new\n");
goto out_delete_evlist; goto out_delete_evlist;
} }
perf_evlist__add(evlist, evsel); evlist__add(evlist, evsel);
cpus = cpu_map__dummy_new(); cpus = cpu_map__dummy_new();
threads = thread_map__new_by_tid(getpid()); threads = thread_map__new_by_tid(getpid());
......
...@@ -177,7 +177,7 @@ static void perf_evlist__propagate_maps(struct evlist *evlist) ...@@ -177,7 +177,7 @@ static void perf_evlist__propagate_maps(struct evlist *evlist)
__perf_evlist__propagate_maps(evlist, evsel); __perf_evlist__propagate_maps(evlist, evsel);
} }
void perf_evlist__add(struct evlist *evlist, struct evsel *entry) void evlist__add(struct evlist *evlist, struct evsel *entry)
{ {
entry->evlist = evlist; entry->evlist = evlist;
list_add_tail(&entry->node, &evlist->entries); list_add_tail(&entry->node, &evlist->entries);
...@@ -204,7 +204,7 @@ void perf_evlist__splice_list_tail(struct evlist *evlist, ...@@ -204,7 +204,7 @@ void perf_evlist__splice_list_tail(struct evlist *evlist,
__evlist__for_each_entry_safe(list, temp, evsel) { __evlist__for_each_entry_safe(list, temp, evsel) {
list_del_init(&evsel->node); list_del_init(&evsel->node);
perf_evlist__add(evlist, evsel); evlist__add(evlist, evsel);
} }
} }
...@@ -237,7 +237,7 @@ int __perf_evlist__add_default(struct evlist *evlist, bool precise) ...@@ -237,7 +237,7 @@ int __perf_evlist__add_default(struct evlist *evlist, bool precise)
if (evsel == NULL) if (evsel == NULL)
return -ENOMEM; return -ENOMEM;
perf_evlist__add(evlist, evsel); evlist__add(evlist, evsel);
return 0; return 0;
} }
...@@ -253,11 +253,11 @@ int perf_evlist__add_dummy(struct evlist *evlist) ...@@ -253,11 +253,11 @@ int perf_evlist__add_dummy(struct evlist *evlist)
if (evsel == NULL) if (evsel == NULL)
return -ENOMEM; return -ENOMEM;
perf_evlist__add(evlist, evsel); evlist__add(evlist, evsel);
return 0; return 0;
} }
static int perf_evlist__add_attrs(struct evlist *evlist, static int evlist__add_attrs(struct evlist *evlist,
struct perf_event_attr *attrs, size_t nr_attrs) struct perf_event_attr *attrs, size_t nr_attrs)
{ {
struct evsel *evsel, *n; struct evsel *evsel, *n;
...@@ -289,7 +289,7 @@ int __perf_evlist__add_default_attrs(struct evlist *evlist, ...@@ -289,7 +289,7 @@ int __perf_evlist__add_default_attrs(struct evlist *evlist,
for (i = 0; i < nr_attrs; i++) for (i = 0; i < nr_attrs; i++)
event_attr_init(attrs + i); event_attr_init(attrs + i);
return perf_evlist__add_attrs(evlist, attrs, nr_attrs); return evlist__add_attrs(evlist, attrs, nr_attrs);
} }
struct evsel * struct evsel *
...@@ -330,7 +330,7 @@ int perf_evlist__add_newtp(struct evlist *evlist, ...@@ -330,7 +330,7 @@ int perf_evlist__add_newtp(struct evlist *evlist,
return -1; return -1;
evsel->handler = handler; evsel->handler = handler;
perf_evlist__add(evlist, evsel); evlist__add(evlist, evsel);
return 0; return 0;
} }
...@@ -1854,7 +1854,7 @@ int perf_evlist__add_sb_event(struct evlist **evlist, ...@@ -1854,7 +1854,7 @@ int perf_evlist__add_sb_event(struct evlist **evlist,
evsel->side_band.cb = cb; evsel->side_band.cb = cb;
evsel->side_band.data = data; evsel->side_band.data = data;
perf_evlist__add(*evlist, evsel); evlist__add(*evlist, evsel);
return 0; return 0;
out_err: out_err:
......
...@@ -73,7 +73,7 @@ void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus, ...@@ -73,7 +73,7 @@ void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
void perf_evlist__exit(struct evlist *evlist); void perf_evlist__exit(struct evlist *evlist);
void evlist__delete(struct evlist *evlist); void evlist__delete(struct evlist *evlist);
void perf_evlist__add(struct evlist *evlist, struct evsel *entry); void evlist__add(struct evlist *evlist, struct evsel *entry);
void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel); void perf_evlist__remove(struct evlist *evlist, struct evsel *evsel);
int __perf_evlist__add_default(struct evlist *evlist, bool precise); int __perf_evlist__add_default(struct evlist *evlist, bool precise);
......
...@@ -3593,7 +3593,7 @@ int perf_session__read_header(struct perf_session *session) ...@@ -3593,7 +3593,7 @@ int perf_session__read_header(struct perf_session *session)
* Do it before so that if perf_evsel__alloc_id fails, this * Do it before so that if perf_evsel__alloc_id fails, this
* entry gets purged too at evlist__delete(). * entry gets purged too at evlist__delete().
*/ */
perf_evlist__add(session->evlist, evsel); evlist__add(session->evlist, evsel);
nr_ids = f_attr.ids.size / sizeof(u64); nr_ids = f_attr.ids.size / sizeof(u64);
/* /*
...@@ -4025,7 +4025,7 @@ int perf_event__process_attr(struct perf_tool *tool __maybe_unused, ...@@ -4025,7 +4025,7 @@ int perf_event__process_attr(struct perf_tool *tool __maybe_unused,
if (evsel == NULL) if (evsel == NULL)
return -ENOMEM; return -ENOMEM;
perf_evlist__add(evlist, evsel); evlist__add(evlist, evsel);
ids = event->header.size; ids = event->header.size;
ids -= (void *)&event->attr.id - (void *)event; ids -= (void *)&event->attr.id - (void *)event;
......
...@@ -974,7 +974,7 @@ static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist, ...@@ -974,7 +974,7 @@ static PyObject *pyrf_evlist__add(struct pyrf_evlist *pevlist,
Py_INCREF(pevsel); Py_INCREF(pevsel);
evsel = &((struct pyrf_evsel *)pevsel)->evsel; evsel = &((struct pyrf_evsel *)pevsel)->evsel;
evsel->idx = evlist->nr_entries; evsel->idx = evlist->nr_entries;
perf_evlist__add(evlist, evsel); evlist__add(evlist, evsel);
return Py_BuildValue("i", evlist->nr_entries); return Py_BuildValue("i", evlist->nr_entries);
} }
......
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