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

perf evsel: Rename perf_evsel__delete() to evsel__delete()

Remame perf_evsel__delete() to evsel__delete(), so we don't have a name
clash when we add perf_evsel__delete() in libperf.

Also renaming perf_evsel__delete_priv() to evsel__delete_priv().
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-11-jolsa@kernel.orgSigned-off-by: default avatarArnaldo Carvalho de Melo <acme@redhat.com>
parent c12995a5
...@@ -623,7 +623,7 @@ static void strip_fini(struct perf_inject *inject) ...@@ -623,7 +623,7 @@ static void strip_fini(struct perf_inject *inject)
ok_to_remove(evlist, evsel)) { ok_to_remove(evlist, evsel)) {
pr_debug("Deleting %s\n", perf_evsel__name(evsel)); pr_debug("Deleting %s\n", perf_evsel__name(evsel));
perf_evlist__remove(evlist, evsel); perf_evlist__remove(evlist, evsel);
perf_evsel__delete(evsel); evsel__delete(evsel);
} }
} }
} }
...@@ -725,7 +725,7 @@ static int __cmd_inject(struct perf_inject *inject) ...@@ -725,7 +725,7 @@ static int __cmd_inject(struct perf_inject *inject)
pr_debug("Deleting %s\n", pr_debug("Deleting %s\n",
perf_evsel__name(evsel)); perf_evsel__name(evsel));
perf_evlist__remove(session->evlist, evsel); perf_evlist__remove(session->evlist, evsel);
perf_evsel__delete(evsel); evsel__delete(evsel);
} }
if (inject->strip) if (inject->strip)
strip_fini(inject); strip_fini(inject);
......
...@@ -274,10 +274,10 @@ static int perf_evsel__init_tp_ptr_field(struct evsel *evsel, ...@@ -274,10 +274,10 @@ static int perf_evsel__init_tp_ptr_field(struct evsel *evsel,
({ struct syscall_tp *sc = evsel->priv;\ ({ struct syscall_tp *sc = evsel->priv;\
perf_evsel__init_tp_ptr_field(evsel, &sc->name, #name); }) perf_evsel__init_tp_ptr_field(evsel, &sc->name, #name); })
static void perf_evsel__delete_priv(struct evsel *evsel) static void evsel__delete_priv(struct evsel *evsel)
{ {
zfree(&evsel->priv); zfree(&evsel->priv);
perf_evsel__delete(evsel); evsel__delete(evsel);
} }
static int perf_evsel__init_syscall_tp(struct evsel *evsel) static int perf_evsel__init_syscall_tp(struct evsel *evsel)
...@@ -368,7 +368,7 @@ static struct evsel *perf_evsel__raw_syscall_newtp(const char *direction, void * ...@@ -368,7 +368,7 @@ static struct evsel *perf_evsel__raw_syscall_newtp(const char *direction, void *
return evsel; return evsel;
out_delete: out_delete:
perf_evsel__delete_priv(evsel); evsel__delete_priv(evsel);
return NULL; return NULL;
} }
...@@ -2638,7 +2638,7 @@ static bool perf_evlist__add_vfs_getname(struct evlist *evlist) ...@@ -2638,7 +2638,7 @@ static bool perf_evlist__add_vfs_getname(struct evlist *evlist)
list_del_init(&evsel->node); list_del_init(&evsel->node);
evsel->evlist = NULL; evsel->evlist = NULL;
perf_evsel__delete(evsel); evsel__delete(evsel);
} }
return found; return found;
...@@ -2739,9 +2739,9 @@ static int trace__add_syscall_newtp(struct trace *trace) ...@@ -2739,9 +2739,9 @@ static int trace__add_syscall_newtp(struct trace *trace)
return ret; return ret;
out_delete_sys_exit: out_delete_sys_exit:
perf_evsel__delete_priv(sys_exit); evsel__delete_priv(sys_exit);
out_delete_sys_enter: out_delete_sys_enter:
perf_evsel__delete_priv(sys_enter); evsel__delete_priv(sys_enter);
goto out; goto out;
} }
......
...@@ -64,7 +64,7 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes ...@@ -64,7 +64,7 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes
if (perf_evsel__test_field(evsel, "next_prio", 4, true)) if (perf_evsel__test_field(evsel, "next_prio", 4, true))
ret = -1; ret = -1;
perf_evsel__delete(evsel); evsel__delete(evsel);
evsel = perf_evsel__newtp("sched", "sched_wakeup"); evsel = perf_evsel__newtp("sched", "sched_wakeup");
...@@ -85,6 +85,6 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes ...@@ -85,6 +85,6 @@ int test__perf_evsel__tp_sched_test(struct test *test __maybe_unused, int subtes
if (perf_evsel__test_field(evsel, "target_cpu", 4, true)) if (perf_evsel__test_field(evsel, "target_cpu", 4, true))
ret = -1; ret = -1;
perf_evsel__delete(evsel); evsel__delete(evsel);
return ret; return ret;
} }
...@@ -118,7 +118,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int ...@@ -118,7 +118,7 @@ int test__openat_syscall_event_on_all_cpus(struct test *test __maybe_unused, int
out_close_fd: out_close_fd:
perf_evsel__close_fd(evsel); perf_evsel__close_fd(evsel);
out_evsel_delete: out_evsel_delete:
perf_evsel__delete(evsel); evsel__delete(evsel);
out_cpu_map_delete: out_cpu_map_delete:
cpu_map__put(cpus); cpu_map__put(cpus);
out_thread_map_delete: out_thread_map_delete:
......
...@@ -59,7 +59,7 @@ int test__openat_syscall_event(struct test *test __maybe_unused, int subtest __m ...@@ -59,7 +59,7 @@ int test__openat_syscall_event(struct test *test __maybe_unused, int subtest __m
out_close_fd: out_close_fd:
perf_evsel__close_fd(evsel); perf_evsel__close_fd(evsel);
out_evsel_delete: out_evsel_delete:
perf_evsel__delete(evsel); evsel__delete(evsel);
out_thread_map_delete: out_thread_map_delete:
thread_map__put(threads); thread_map__put(threads);
return err; return err;
......
...@@ -121,7 +121,7 @@ static void perf_evlist__purge(struct evlist *evlist) ...@@ -121,7 +121,7 @@ static void perf_evlist__purge(struct evlist *evlist)
evlist__for_each_entry_safe(evlist, n, pos) { evlist__for_each_entry_safe(evlist, n, pos) {
list_del_init(&pos->node); list_del_init(&pos->node);
pos->evlist = NULL; pos->evlist = NULL;
perf_evsel__delete(pos); evsel__delete(pos);
} }
evlist->nr_entries = 0; evlist->nr_entries = 0;
...@@ -277,7 +277,7 @@ static int perf_evlist__add_attrs(struct evlist *evlist, ...@@ -277,7 +277,7 @@ static int perf_evlist__add_attrs(struct evlist *evlist,
out_delete_partial_list: out_delete_partial_list:
__evlist__for_each_entry_safe(&head, n, evsel) __evlist__for_each_entry_safe(&head, n, evsel)
perf_evsel__delete(evsel); evsel__delete(evsel);
return -1; return -1;
} }
......
...@@ -316,7 +316,7 @@ struct evsel *perf_evsel__new_cycles(bool precise) ...@@ -316,7 +316,7 @@ struct evsel *perf_evsel__new_cycles(bool precise)
out: out:
return evsel; return evsel;
error_free: error_free:
perf_evsel__delete(evsel); evsel__delete(evsel);
evsel = NULL; evsel = NULL;
goto out; goto out;
} }
...@@ -1333,7 +1333,7 @@ void perf_evsel__exit(struct evsel *evsel) ...@@ -1333,7 +1333,7 @@ void perf_evsel__exit(struct evsel *evsel)
perf_evsel__object.fini(evsel); perf_evsel__object.fini(evsel);
} }
void perf_evsel__delete(struct evsel *evsel) void evsel__delete(struct evsel *evsel)
{ {
perf_evsel__exit(evsel); perf_evsel__exit(evsel);
free(evsel); free(evsel);
......
...@@ -240,7 +240,7 @@ struct tep_event *event_format__new(const char *sys, const char *name); ...@@ -240,7 +240,7 @@ struct tep_event *event_format__new(const char *sys, const char *name);
void evsel__init(struct evsel *evsel, struct perf_event_attr *attr, int idx); void evsel__init(struct evsel *evsel, struct perf_event_attr *attr, int idx);
void perf_evsel__exit(struct evsel *evsel); void perf_evsel__exit(struct evsel *evsel);
void perf_evsel__delete(struct evsel *evsel); void evsel__delete(struct evsel *evsel);
struct callchain_param; struct callchain_param;
......
...@@ -662,7 +662,7 @@ static int add_bpf_event(const char *group, const char *event, int fd, struct bp ...@@ -662,7 +662,7 @@ static int add_bpf_event(const char *group, const char *event, int fd, struct bp
group, event); group, event);
list_for_each_entry_safe(evsel, tmp, &new_evsels, node) { list_for_each_entry_safe(evsel, tmp, &new_evsels, node) {
list_del_init(&evsel->node); list_del_init(&evsel->node);
perf_evsel__delete(evsel); evsel__delete(evsel);
} }
return err; return err;
} }
...@@ -2334,7 +2334,7 @@ static bool is_event_supported(u8 type, unsigned config) ...@@ -2334,7 +2334,7 @@ static bool is_event_supported(u8 type, unsigned config)
evsel->attr.exclude_kernel = 1; evsel->attr.exclude_kernel = 1;
ret = perf_evsel__open(evsel, NULL, tmap) >= 0; ret = perf_evsel__open(evsel, NULL, tmap) >= 0;
} }
perf_evsel__delete(evsel); evsel__delete(evsel);
} }
thread_map__put(tmap); thread_map__put(tmap);
......
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