Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

perf evlist: Use the right prefix for 'struct evlist' 'find' methods

perf_evlist__ is for 'struct perf_evlist' methods, in tools/lib/perf/,
go on completing this split.

Cc: Adrian Hunter <adrian.hunter@intel.com>
Cc: Ian Rogers <irogers@google.com>
Cc: Jiri Olsa <jolsa@kernel.org>
Cc: Namhyung Kim <namhyung@kernel.org>
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>

+21 -43
+2 -5
tools/perf/builtin-kmem.c
··· 1960 1960 ret = -1; 1961 1961 1962 1962 if (kmem_slab) { 1963 - if (!perf_evlist__find_tracepoint_by_name(session->evlist, 1964 - "kmem:kmalloc")) { 1963 + if (!evlist__find_tracepoint_by_name(session->evlist, "kmem:kmalloc")) { 1965 1964 pr_err(errmsg, "slab", "slab"); 1966 1965 goto out_delete; 1967 1966 } 1968 1967 } 1969 1968 1970 1969 if (kmem_page) { 1971 - struct evsel *evsel; 1970 + struct evsel *evsel = evlist__find_tracepoint_by_name(session->evlist, "kmem:mm_page_alloc"); 1972 1971 1973 - evsel = perf_evlist__find_tracepoint_by_name(session->evlist, 1974 - "kmem:mm_page_alloc"); 1975 1972 if (evsel == NULL) { 1976 1973 pr_err(errmsg, "page", "page"); 1977 1974 goto out_delete;
+2 -4
tools/perf/builtin-sched.c
··· 3036 3036 setup_pager(); 3037 3037 3038 3038 /* prefer sched_waking if it is captured */ 3039 - if (perf_evlist__find_tracepoint_by_name(session->evlist, 3040 - "sched:sched_waking")) 3039 + if (evlist__find_tracepoint_by_name(session->evlist, "sched:sched_waking")) 3041 3040 handlers[1].handler = timehist_sched_wakeup_ignore; 3042 3041 3043 3042 /* setup per-evsel handlers */ ··· 3044 3045 goto out; 3045 3046 3046 3047 /* sched_switch event at a minimum needs to exist */ 3047 - if (!perf_evlist__find_tracepoint_by_name(session->evlist, 3048 - "sched:sched_switch")) { 3048 + if (!evlist__find_tracepoint_by_name(session->evlist, "sched:sched_switch")) { 3049 3049 pr_err("No sched_switch events found. Have you run 'perf sched record'?\n"); 3050 3050 goto out; 3051 3051 }
+5 -9
tools/perf/builtin-trace.c
··· 4227 4227 if (err) 4228 4228 goto out; 4229 4229 4230 - evsel = perf_evlist__find_tracepoint_by_name(session->evlist, 4231 - "raw_syscalls:sys_enter"); 4230 + evsel = evlist__find_tracepoint_by_name(session->evlist, "raw_syscalls:sys_enter"); 4232 4231 /* older kernels have syscalls tp versus raw_syscalls */ 4233 4232 if (evsel == NULL) 4234 - evsel = perf_evlist__find_tracepoint_by_name(session->evlist, 4235 - "syscalls:sys_enter"); 4233 + evsel = evlist__find_tracepoint_by_name(session->evlist, "syscalls:sys_enter"); 4236 4234 4237 4235 if (evsel && 4238 4236 (evsel__init_raw_syscall_tp(evsel, trace__sys_enter) < 0 || ··· 4239 4241 goto out; 4240 4242 } 4241 4243 4242 - evsel = perf_evlist__find_tracepoint_by_name(session->evlist, 4243 - "raw_syscalls:sys_exit"); 4244 + evsel = evlist__find_tracepoint_by_name(session->evlist, "raw_syscalls:sys_exit"); 4244 4245 if (evsel == NULL) 4245 - evsel = perf_evlist__find_tracepoint_by_name(session->evlist, 4246 - "syscalls:sys_exit"); 4246 + evsel = evlist__find_tracepoint_by_name(session->evlist, "syscalls:sys_exit"); 4247 4247 if (evsel && 4248 4248 (evsel__init_raw_syscall_tp(evsel, trace__sys_exit) < 0 || 4249 4249 perf_evsel__init_sc_tp_uint_field(evsel, ret))) { ··· 4901 4905 if (evsel) { 4902 4906 trace.syscalls.events.augmented = evsel; 4903 4907 4904 - evsel = perf_evlist__find_tracepoint_by_name(trace.evlist, "raw_syscalls:sys_enter"); 4908 + evsel = evlist__find_tracepoint_by_name(trace.evlist, "raw_syscalls:sys_enter"); 4905 4909 if (evsel == NULL) { 4906 4910 pr_err("ERROR: raw_syscalls:sys_enter not found in the augmented BPF object\n"); 4907 4911 goto out;
+1 -2
tools/perf/util/bpf-loader.c
··· 1058 1058 struct parse_events_term *term, 1059 1059 struct evlist *evlist) 1060 1060 { 1061 - struct evsel *evsel; 1062 1061 const struct bpf_map_def *def; 1063 1062 struct bpf_map_op *op; 1064 1063 const char *map_name = bpf_map__name(map); 1064 + struct evsel *evsel = evlist__find_evsel_by_str(evlist, term->val.str); 1065 1065 1066 - evsel = perf_evlist__find_evsel_by_str(evlist, term->val.str); 1067 1066 if (!evsel) { 1068 1067 pr_debug("Event (for '%s') '%s' doesn't exist\n", 1069 1068 map_name, term->val.str);
+4 -10
tools/perf/util/evlist.c
··· 191 191 int __evlist__set_tracepoints_handlers(struct evlist *evlist, 192 192 const struct evsel_str_handler *assocs, size_t nr_assocs) 193 193 { 194 - struct evsel *evsel; 195 194 size_t i; 196 195 int err; 197 196 198 197 for (i = 0; i < nr_assocs; i++) { 199 198 // Adding a handler for an event not in this evlist, just ignore it. 200 - evsel = perf_evlist__find_tracepoint_by_name(evlist, assocs[i].name); 199 + struct evsel *evsel = evlist__find_tracepoint_by_name(evlist, assocs[i].name); 201 200 if (evsel == NULL) 202 201 continue; 203 202 ··· 293 294 return evlist__add_attrs(evlist, attrs, nr_attrs); 294 295 } 295 296 296 - struct evsel * 297 - perf_evlist__find_tracepoint_by_id(struct evlist *evlist, int id) 297 + struct evsel *evlist__find_tracepoint_by_id(struct evlist *evlist, int id) 298 298 { 299 299 struct evsel *evsel; 300 300 ··· 306 308 return NULL; 307 309 } 308 310 309 - struct evsel * 310 - perf_evlist__find_tracepoint_by_name(struct evlist *evlist, 311 - const char *name) 311 + struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name) 312 312 { 313 313 struct evsel *evsel; 314 314 ··· 1590 1594 tracking_evsel->tracking = true; 1591 1595 } 1592 1596 1593 - struct evsel * 1594 - perf_evlist__find_evsel_by_str(struct evlist *evlist, 1595 - const char *str) 1597 + struct evsel *evlist__find_evsel_by_str(struct evlist *evlist, const char *str) 1596 1598 { 1597 1599 struct evsel *evsel; 1598 1600
+3 -8
tools/perf/util/evlist.h
··· 147 147 int evlist__append_tp_filter_pid(struct evlist *evlist, pid_t pid); 148 148 int evlist__append_tp_filter_pids(struct evlist *evlist, size_t npids, pid_t *pids); 149 149 150 - struct evsel * 151 - perf_evlist__find_tracepoint_by_id(struct evlist *evlist, int id); 152 - 153 - struct evsel * 154 - perf_evlist__find_tracepoint_by_name(struct evlist *evlist, 155 - const char *name); 150 + struct evsel *evlist__find_tracepoint_by_id(struct evlist *evlist, int id); 151 + struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name); 156 152 157 153 int evlist__add_pollfd(struct evlist *evlist, int fd); 158 154 int evlist__filter_pollfd(struct evlist *evlist, short revents_and_mask); ··· 334 338 bool evsel__cpu_iter_skip(struct evsel *ev, int cpu); 335 339 bool evsel__cpu_iter_skip_no_inc(struct evsel *ev, int cpu); 336 340 337 - struct evsel * 338 - perf_evlist__find_evsel_by_str(struct evlist *evlist, const char *str); 341 + struct evsel *evlist__find_evsel_by_str(struct evlist *evlist, const char *str); 339 342 340 343 struct evsel *perf_evlist__event2evsel(struct evlist *evlist, 341 344 union perf_event *event);
+2 -2
tools/perf/util/evswitch.c
··· 41 41 int evswitch__init(struct evswitch *evswitch, struct evlist *evlist, FILE *fp) 42 42 { 43 43 if (evswitch->on_name) { 44 - evswitch->on = perf_evlist__find_evsel_by_str(evlist, evswitch->on_name); 44 + evswitch->on = evlist__find_evsel_by_str(evlist, evswitch->on_name); 45 45 if (evswitch->on == NULL) { 46 46 evswitch__fprintf_enoent(fp, "on", evswitch->on_name); 47 47 return -ENOENT; ··· 50 50 } 51 51 52 52 if (evswitch->off_name) { 53 - evswitch->off = perf_evlist__find_evsel_by_str(evlist, evswitch->off_name); 53 + evswitch->off = evlist__find_evsel_by_str(evlist, evswitch->off_name); 54 54 if (evswitch->off == NULL) { 55 55 evswitch__fprintf_enoent(fp, "off", evswitch->off_name); 56 56 return -ENOENT;
+2 -3
tools/perf/util/header.c
··· 2263 2263 return 0; 2264 2264 } 2265 2265 2266 - static struct evsel * 2267 - perf_evlist__find_by_index(struct evlist *evlist, int idx) 2266 + static struct evsel *evlist__find_by_index(struct evlist *evlist, int idx) 2268 2267 { 2269 2268 struct evsel *evsel; 2270 2269 ··· 2284 2285 if (!event->name) 2285 2286 return; 2286 2287 2287 - evsel = perf_evlist__find_by_index(evlist, event->idx); 2288 + evsel = evlist__find_by_index(evlist, event->idx); 2288 2289 if (!evsel) 2289 2290 return; 2290 2291