提交 0f98b11c 编写于 作者: J Jiri Olsa 提交者: Arnaldo Carvalho de Melo

perf evlist: Rename perf_evlist__new() to evlist__new()

Rename perf_evlist__new() to evlist__new(), so we don't have a name
clash when we add perf_evlist__new() in libperf.
Signed-off-by: NJiri 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-9-jolsa@kernel.orgSigned-off-by: NArnaldo Carvalho de Melo <acme@redhat.com>
上级 52c86bca
......@@ -146,7 +146,7 @@ static int ppc__setup_book3s_hv(struct perf_kvm_stat *kvm,
/* Wrapper to setup kvm tracepoints */
static int ppc__setup_kvm_tp(struct perf_kvm_stat *kvm)
{
struct evlist *evlist = perf_evlist__new();
struct evlist *evlist = evlist__new();
if (evlist == NULL)
return -ENOMEM;
......
......@@ -51,7 +51,7 @@ int test__intel_cqm_count_nmi_context(struct test *test __maybe_unused, int subt
flag = perf_event_open_cloexec_flag();
evlist = perf_evlist__new();
evlist = evlist__new();
if (!evlist) {
pr_debug("perf_evlist__new failed\n");
return TEST_FAIL;
......
......@@ -68,7 +68,7 @@ int test__perf_time_to_tsc(struct test *test __maybe_unused, int subtest __maybe
cpus = cpu_map__new(NULL);
CHECK_NOT_NULL__(cpus);
evlist = perf_evlist__new();
evlist = evlist__new();
CHECK_NOT_NULL__(evlist);
perf_evlist__set_maps(evlist, cpus, threads);
......
......@@ -495,7 +495,7 @@ int cmd_ftrace(int argc, const char **argv)
goto out_delete_filters;
}
ftrace.evlist = perf_evlist__new();
ftrace.evlist = evlist__new();
if (ftrace.evlist == NULL) {
ret = -ENOMEM;
goto out_delete_filters;
......
......@@ -1290,7 +1290,7 @@ static struct evlist *kvm_live_event_list(void)
int err = -1;
const char * const *events_tp;
evlist = perf_evlist__new();
evlist = evlist__new();
if (evlist == NULL)
return NULL;
......
......@@ -2265,7 +2265,7 @@ int cmd_record(int argc, const char **argv)
CPU_ZERO(&rec->affinity_mask);
rec->opts.affinity = PERF_AFFINITY_SYS;
rec->evlist = perf_evlist__new();
rec->evlist = evlist__new();
if (rec->evlist == NULL)
return -ENOMEM;
......
......@@ -1702,7 +1702,7 @@ int cmd_stat(int argc, const char **argv)
setlocale(LC_ALL, "");
evsel_list = perf_evlist__new();
evsel_list = evlist__new();
if (evsel_list == NULL)
return -ENOMEM;
......
......@@ -1524,7 +1524,7 @@ int cmd_top(int argc, const char **argv)
top.annotation_opts.min_pcnt = 5;
top.annotation_opts.context = 4;
top.evlist = perf_evlist__new();
top.evlist = evlist__new();
if (top.evlist == NULL)
return -ENOMEM;
......
......@@ -4169,7 +4169,7 @@ int cmd_trace(int argc, const char **argv)
signal(SIGSEGV, sighandler_dump_stack);
signal(SIGFPE, sighandler_dump_stack);
trace.evlist = perf_evlist__new();
trace.evlist = evlist__new();
trace.sctbl = syscalltbl__new();
if (trace.evlist == NULL || trace.sctbl == NULL) {
......
......@@ -99,7 +99,7 @@ int test__backward_ring_buffer(struct test *test __maybe_unused, int subtest __m
pid[sizeof(pid) - 1] = '\0';
opts.target.tid = opts.target.pid = pid;
evlist = perf_evlist__new();
evlist = evlist__new();
if (!evlist) {
pr_debug("Not enough memory to create evlist\n");
return TEST_FAIL;
......
......@@ -140,7 +140,7 @@ static int do_test(struct bpf_object *obj, int (*func)(void),
opts.target.tid = opts.target.pid = pid;
/* Instead of perf_evlist__new_default, don't add default events */
evlist = perf_evlist__new();
evlist = evlist__new();
if (!evlist) {
pr_debug("Not enough memory to create evlist\n");
return TEST_FAIL;
......
......@@ -622,7 +622,7 @@ static int do_test_code_reading(bool try_kcore)
while (1) {
const char *str;
evlist = perf_evlist__new();
evlist = evlist__new();
if (!evlist) {
pr_debug("perf_evlist__new failed\n");
goto out_put;
......
......@@ -166,7 +166,7 @@ static int test_times(int (attach)(struct evlist *),
struct evsel *evsel;
int err = -1, i;
evlist = perf_evlist__new();
evlist = evlist__new();
if (!evlist) {
pr_debug("failed to create event list\n");
goto out_err;
......
......@@ -12,7 +12,7 @@ static int perf_evsel__roundtrip_cache_name_test(void)
char name[128];
int type, op, err = 0, ret = 0, i, idx;
struct evsel *evsel;
struct evlist *evlist = perf_evlist__new();
struct evlist *evlist = evlist__new();
if (evlist == NULL)
return -ENOMEM;
......@@ -68,7 +68,7 @@ static int __perf_evsel__name_array_test(const char *names[], int nr_names)
{
int i, err;
struct evsel *evsel;
struct evlist *evlist = perf_evlist__new();
struct evlist *evlist = evlist__new();
if (evlist == NULL)
return -ENOMEM;
......
......@@ -695,7 +695,7 @@ int test__hists_cumulate(struct test *test __maybe_unused, int subtest __maybe_u
struct machines machines;
struct machine *machine;
struct evsel *evsel;
struct evlist *evlist = perf_evlist__new();
struct evlist *evlist = evlist__new();
size_t i;
test_fn_t testcases[] = {
test1,
......
......@@ -109,7 +109,7 @@ int test__hists_filter(struct test *test __maybe_unused, int subtest __maybe_unu
struct machines machines;
struct machine *machine;
struct evsel *evsel;
struct evlist *evlist = perf_evlist__new();
struct evlist *evlist = evlist__new();
TEST_ASSERT_VAL("No memory", evlist);
......
......@@ -272,7 +272,7 @@ int test__hists_link(struct test *test __maybe_unused, int subtest __maybe_unuse
struct machines machines;
struct machine *machine = NULL;
struct evsel *evsel, *first;
struct evlist *evlist = perf_evlist__new();
struct evlist *evlist = evlist__new();
if (evlist == NULL)
return -ENOMEM;
......
......@@ -581,7 +581,7 @@ int test__hists_output(struct test *test __maybe_unused, int subtest __maybe_unu
struct machines machines;
struct machine *machine;
struct evsel *evsel;
struct evlist *evlist = perf_evlist__new();
struct evlist *evlist = evlist__new();
size_t i;
test_fn_t testcases[] = {
test1,
......
......@@ -78,7 +78,7 @@ int test__keep_tracking(struct test *test __maybe_unused, int subtest __maybe_un
cpus = cpu_map__new(NULL);
CHECK_NOT_NULL__(cpus);
evlist = perf_evlist__new();
evlist = evlist__new();
CHECK_NOT_NULL__(evlist);
perf_evlist__set_maps(evlist, cpus, threads);
......
......@@ -61,7 +61,7 @@ int test__basic_mmap(struct test *test __maybe_unused, int subtest __maybe_unuse
goto out_free_cpus;
}
evlist = perf_evlist__new();
evlist = evlist__new();
if (evlist == NULL) {
pr_debug("perf_evlist__new\n");
goto out_free_cpus;
......
......@@ -32,7 +32,7 @@ int test__syscall_openat_tp_fields(struct test *test __maybe_unused, int subtest
};
const char *filename = "/etc/passwd";
int flags = O_RDONLY | O_DIRECTORY;
struct evlist *evlist = perf_evlist__new();
struct evlist *evlist = evlist__new();
struct evsel *evsel;
int err = -1, i, nr_events = 0, nr_polls = 0;
char sbuf[STRERR_BUFSIZE];
......
......@@ -1777,7 +1777,7 @@ static int test_event(struct evlist_test *e)
return 0;
}
evlist = perf_evlist__new();
evlist = evlist__new();
if (evlist == NULL)
return -ENOMEM;
......
......@@ -43,9 +43,9 @@ static int __test__sw_clock_freq(enum perf_sw_ids clock_id)
attr.sample_freq = 500;
evlist = perf_evlist__new();
evlist = evlist__new();
if (evlist == NULL) {
pr_debug("perf_evlist__new\n");
pr_debug("evlist__new\n");
return -1;
}
......
......@@ -347,9 +347,9 @@ int test__switch_tracking(struct test *test __maybe_unused, int subtest __maybe_
goto out_err;
}
evlist = perf_evlist__new();
evlist = evlist__new();
if (!evlist) {
pr_debug("perf_evlist__new failed!\n");
pr_debug("evlist__new failed!\n");
goto out_err;
}
......
......@@ -55,7 +55,7 @@ void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
evlist->bkw_mmap_state = BKW_MMAP_NOTREADY;
}
struct evlist *perf_evlist__new(void)
struct evlist *evlist__new(void)
{
struct evlist *evlist = zalloc(sizeof(*evlist));
......@@ -67,7 +67,7 @@ struct evlist *perf_evlist__new(void)
struct evlist *perf_evlist__new_default(void)
{
struct evlist *evlist = perf_evlist__new();
struct evlist *evlist = evlist__new();
if (evlist && perf_evlist__add_default(evlist)) {
perf_evlist__delete(evlist);
......@@ -79,7 +79,7 @@ struct evlist *perf_evlist__new_default(void)
struct evlist *perf_evlist__new_dummy(void)
{
struct evlist *evlist = perf_evlist__new();
struct evlist *evlist = evlist__new();
if (evlist && perf_evlist__add_dummy(evlist)) {
perf_evlist__delete(evlist);
......@@ -1839,7 +1839,7 @@ int perf_evlist__add_sb_event(struct evlist **evlist,
bool new_evlist = (*evlist) == NULL;
if (*evlist == NULL)
*evlist = perf_evlist__new();
*evlist = evlist__new();
if (*evlist == NULL)
return -1;
......
......@@ -65,7 +65,7 @@ struct evsel_str_handler {
void *handler;
};
struct evlist *perf_evlist__new(void);
struct evlist *evlist__new(void);
struct evlist *perf_evlist__new_default(void);
struct evlist *perf_evlist__new_dummy(void);
void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus,
......
......@@ -3535,7 +3535,7 @@ int perf_session__read_header(struct perf_session *session)
int nr_attrs, nr_ids, i, j;
int fd = perf_data__fd(data);
session->evlist = perf_evlist__new();
session->evlist = evlist__new();
if (session->evlist == NULL)
return -ENOMEM;
......@@ -4016,7 +4016,7 @@ int perf_event__process_attr(struct perf_tool *tool __maybe_unused,
struct evlist *evlist = *pevlist;
if (evlist == NULL) {
*pevlist = evlist = perf_evlist__new();
*pevlist = evlist = evlist__new();
if (evlist == NULL)
return -ENOMEM;
}
......
......@@ -19,7 +19,7 @@ static int perf_do_probe_api(setup_probe_fn_t fn, int cpu, const char *str)
int err = -EAGAIN, fd;
static pid_t pid = -1;
evlist = perf_evlist__new();
evlist = evlist__new();
if (!evlist)
return -ENOMEM;
......@@ -264,7 +264,7 @@ bool perf_evlist__can_select_event(struct evlist *evlist, const char *str)
bool ret = false;
pid_t pid = -1;
temp_evlist = perf_evlist__new();
temp_evlist = evlist__new();
if (!temp_evlist)
return false;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册