Lines Matching refs:evsel

114 		struct evsel *evsel;  in evlist__new_default()  local
116 evlist__for_each_entry(evlist, evsel) in evlist__new_default()
117 evsel__set_sample_id(evsel, /*can_sample_identifier=*/false); in evlist__new_default()
144 struct evsel *first = evlist__first(evlist); in evlist__set_id_pos()
152 struct evsel *evsel; in evlist__update_id_pos() local
154 evlist__for_each_entry(evlist, evsel) in evlist__update_id_pos()
155 evsel__calc_id_pos(evsel); in evlist__update_id_pos()
162 struct evsel *pos, *n; in evlist__purge()
195 void evlist__add(struct evlist *evlist, struct evsel *entry) in evlist__add()
205 void evlist__remove(struct evlist *evlist, struct evsel *evsel) in evlist__remove() argument
207 evsel->evlist = NULL; in evlist__remove()
208 perf_evlist__remove(&evlist->core, &evsel->core); in evlist__remove()
214 struct evsel *evsel, *temp, *leader = NULL; in evlist__splice_list_tail() local
216 __evlist__for_each_entry_safe(list, temp, evsel) { in evlist__splice_list_tail()
217 list_del_init(&evsel->core.node); in evlist__splice_list_tail()
218 evlist__add(evlist, evsel); in evlist__splice_list_tail()
219 leader = evsel; in evlist__splice_list_tail()
223 __evlist__for_each_entry_safe(list, temp, evsel) { in evlist__splice_list_tail()
224 if (evsel__has_leader(evsel, leader)) { in evlist__splice_list_tail()
225 list_del_init(&evsel->core.node); in evlist__splice_list_tail()
226 evlist__add(evlist, evsel); in evlist__splice_list_tail()
240 struct evsel *evsel = evlist__find_tracepoint_by_name(evlist, assocs[i].name); in __evlist__set_tracepoints_handlers() local
241 if (evsel == NULL) in __evlist__set_tracepoints_handlers()
245 if (evsel->handler != NULL) in __evlist__set_tracepoints_handlers()
247 evsel->handler = assocs[i].handler; in __evlist__set_tracepoints_handlers()
260 static struct evsel *evlist__dummy_event(struct evlist *evlist) in evlist__dummy_event()
276 struct evsel *evsel = evlist__dummy_event(evlist); in evlist__add_dummy() local
278 if (evsel == NULL) in evlist__add_dummy()
281 evlist__add(evlist, evsel); in evlist__add_dummy()
285 struct evsel *evlist__add_aux_dummy(struct evlist *evlist, bool system_wide) in evlist__add_aux_dummy()
287 struct evsel *evsel = evlist__dummy_event(evlist); in evlist__add_aux_dummy() local
289 if (!evsel) in evlist__add_aux_dummy()
292 evsel->core.attr.exclude_kernel = 1; in evlist__add_aux_dummy()
293 evsel->core.attr.exclude_guest = 1; in evlist__add_aux_dummy()
294 evsel->core.attr.exclude_hv = 1; in evlist__add_aux_dummy()
295 evsel->core.system_wide = system_wide; in evlist__add_aux_dummy()
296 evsel->no_aux_samples = true; in evlist__add_aux_dummy()
297 evsel->name = strdup("dummy:u"); in evlist__add_aux_dummy()
299 evlist__add(evlist, evsel); in evlist__add_aux_dummy()
300 return evsel; in evlist__add_aux_dummy()
304 struct evsel *evlist__add_sched_switch(struct evlist *evlist, bool system_wide) in evlist__add_sched_switch()
306 struct evsel *evsel = evsel__newtp_idx("sched", "sched_switch", 0, in evlist__add_sched_switch() local
309 if (IS_ERR(evsel)) in evlist__add_sched_switch()
310 return evsel; in evlist__add_sched_switch()
312 evsel__set_sample_bit(evsel, CPU); in evlist__add_sched_switch()
313 evsel__set_sample_bit(evsel, TIME); in evlist__add_sched_switch()
315 evsel->core.system_wide = system_wide; in evlist__add_sched_switch()
316 evsel->no_aux_samples = true; in evlist__add_sched_switch()
318 evlist__add(evlist, evsel); in evlist__add_sched_switch()
319 return evsel; in evlist__add_sched_switch()
323 struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name) in evlist__find_tracepoint_by_name()
325 struct evsel *evsel; in evlist__find_tracepoint_by_name() local
327 evlist__for_each_entry(evlist, evsel) { in evlist__find_tracepoint_by_name()
328 if ((evsel->core.attr.type == PERF_TYPE_TRACEPOINT) && in evlist__find_tracepoint_by_name()
329 (strcmp(evsel->name, name) == 0)) in evlist__find_tracepoint_by_name()
330 return evsel; in evlist__find_tracepoint_by_name()
339 struct evsel *evsel = evsel__newtp(sys, name); in evlist__add_newtp() local
341 if (IS_ERR(evsel)) in evlist__add_newtp()
344 evsel->handler = handler; in evlist__add_newtp()
345 evlist__add(evlist, evsel); in evlist__add_newtp()
354 .evsel = NULL, in evlist__cpu_begin()
366 itr.evsel = evlist__first(evlist); in evlist__cpu_begin()
370 itr.cpu_map_idx = perf_cpu_map__idx(itr.evsel->core.cpus, itr.cpu); in evlist__cpu_begin()
384 while (evlist_cpu_itr->evsel != evlist__last(evlist_cpu_itr->container)) { in evlist_cpu_iterator__next()
385 evlist_cpu_itr->evsel = evsel__next(evlist_cpu_itr->evsel); in evlist_cpu_iterator__next()
387 perf_cpu_map__idx(evlist_cpu_itr->evsel->core.cpus, in evlist_cpu_iterator__next()
394 evlist_cpu_itr->evsel = evlist__first(evlist_cpu_itr->container); in evlist_cpu_iterator__next()
401 perf_cpu_map__idx(evlist_cpu_itr->evsel->core.cpus, in evlist_cpu_iterator__next()
417 static int evsel__strcmp(struct evsel *pos, char *evsel_name) in evsel__strcmp()
428 struct evsel *pos; in evlist__is_enabled()
442 struct evsel *pos; in __evlist__disable()
457 pos = evlist_cpu_itr.evsel; in __evlist__disable()
512 struct evsel *pos; in __evlist__enable()
524 pos = evlist_cpu_itr.evsel; in __evlist__enable()
612 struct evsel *evlist__id2evsel(struct evlist *evlist, u64 id) in evlist__id2evsel()
621 return container_of(sid->evsel, struct evsel, core); in evlist__id2evsel()
629 struct evsel *evlist__id2evsel_strict(struct evlist *evlist, u64 id) in evlist__id2evsel_strict()
638 return container_of(sid->evsel, struct evsel, core); in evlist__id2evsel_strict()
663 struct evsel *evlist__event2evsel(struct evlist *evlist, union perf_event *event) in evlist__event2evsel()
665 struct evsel *first = evlist__first(evlist); in evlist__event2evsel()
690 return container_of(sid->evsel, struct evsel, core); in evlist__event2evsel()
788 struct evsel *evsel = container_of(_evsel, struct evsel, core); in perf_evlist__mmap_cb_idx() local
790 auxtrace_mmap_params__set_idx(&mp->auxtrace_mp, evlist, evsel, idx); in perf_evlist__mmap_cb_idx()
1038 int evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel, in evlist__apply_filters()
1041 struct evsel *evsel; in evlist__apply_filters() local
1044 evlist__for_each_entry(evlist, evsel) { in evlist__apply_filters()
1049 if (evsel->filter) { in evlist__apply_filters()
1050 err = perf_evsel__apply_filter(&evsel->core, evsel->filter); in evlist__apply_filters()
1052 *err_evsel = evsel; in evlist__apply_filters()
1060 if (!list_empty(&evsel->bpf_filters)) { in evlist__apply_filters()
1061 err = perf_bpf_filter__prepare(evsel, target); in evlist__apply_filters()
1063 *err_evsel = evsel; in evlist__apply_filters()
1074 struct evsel *evsel; in evlist__set_tp_filter() local
1080 evlist__for_each_entry(evlist, evsel) { in evlist__set_tp_filter()
1081 if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) in evlist__set_tp_filter()
1084 err = evsel__set_filter(evsel, filter); in evlist__set_tp_filter()
1094 struct evsel *evsel; in evlist__append_tp_filter() local
1100 evlist__for_each_entry(evlist, evsel) { in evlist__append_tp_filter()
1101 if (evsel->core.attr.type != PERF_TYPE_TRACEPOINT) in evlist__append_tp_filter()
1104 err = evsel__append_tp_filter(evsel, filter); in evlist__append_tp_filter()
1163 struct evsel *pos; in evlist__valid_sample_type()
1182 struct evsel *evsel; in __evlist__combined_sample_type() local
1187 evlist__for_each_entry(evlist, evsel) in __evlist__combined_sample_type()
1188 evlist->combined_sample_type |= evsel->core.attr.sample_type; in __evlist__combined_sample_type()
1201 struct evsel *evsel; in evlist__combined_branch_type() local
1204 evlist__for_each_entry(evlist, evsel) in evlist__combined_branch_type()
1205 branch_type |= evsel->core.attr.branch_sample_type; in evlist__combined_branch_type()
1209 static struct evsel *
1210 evlist__find_dup_event_from_prev(struct evlist *evlist, struct evsel *event) in evlist__find_dup_event_from_prev()
1212 struct evsel *pos; in evlist__find_dup_event_from_prev()
1257 struct evsel *evsel, *dup; in evlist__update_br_cntr() local
1260 evlist__for_each_entry(evlist, evsel) { in evlist__update_br_cntr()
1261 if (evsel->core.attr.branch_sample_type & PERF_SAMPLE_BRANCH_COUNTERS) { in evlist__update_br_cntr()
1262 evsel->br_cntr_idx = i++; in evlist__update_br_cntr()
1263 evsel__leader(evsel)->br_cntr_nr++; in evlist__update_br_cntr()
1265 dup = evlist__find_dup_event_from_prev(evlist, evsel); in evlist__update_br_cntr()
1267 memcpy(evsel->abbr_name, dup->abbr_name, 3 * sizeof(char)); in evlist__update_br_cntr()
1269 evlist__new_abbr_name(evsel->abbr_name); in evlist__update_br_cntr()
1277 struct evsel *first = evlist__first(evlist), *pos = first; in evlist__valid_read_format()
1299 struct evsel *first = evlist__first(evlist); in evlist__id_hdr_size()
1306 struct evsel *first = evlist__first(evlist), *pos = first; in evlist__valid_sample_id_all()
1318 struct evsel *first = evlist__first(evlist); in evlist__sample_id_all()
1322 void evlist__set_selected(struct evlist *evlist, struct evsel *evsel) in evlist__set_selected() argument
1324 evlist->selected = evsel; in evlist__set_selected()
1329 struct evsel *evsel; in evlist__close() local
1339 evlist__for_each_entry_reverse(evlist, evsel) in evlist__close()
1340 evsel__close(evsel); in evlist__close()
1348 perf_evsel__close_cpu(&evlist_cpu_itr.evsel->core, in evlist__close()
1353 evlist__for_each_entry_reverse(evlist, evsel) { in evlist__close()
1354 perf_evsel__free_fd(&evsel->core); in evlist__close()
1355 perf_evsel__free_id(&evsel->core); in evlist__close()
1392 struct evsel *evsel; in evlist__open() local
1407 evlist__for_each_entry(evlist, evsel) { in evlist__open()
1408 err = evsel__open(evsel, evsel->core.cpus, evsel->core.threads); in evlist__open()
1575 struct evsel *evsel = evlist__event2evsel(evlist, event); in evlist__parse_sample() local
1578 if (!evsel) in evlist__parse_sample()
1580 ret = evsel__parse_sample(evsel, event, sample); in evlist__parse_sample()
1596 struct evsel *evsel = evlist__event2evsel(evlist, event); in evlist__parse_sample_timestamp() local
1598 if (!evsel) in evlist__parse_sample_timestamp()
1600 return evsel__parse_sample_timestamp(evsel, event, timestamp); in evlist__parse_sample_timestamp()
1631 struct evsel *first = evlist__first(evlist); in evlist__strerror_open()
1687 void evlist__to_front(struct evlist *evlist, struct evsel *move_evsel) in evlist__to_front()
1689 struct evsel *evsel, *n; in evlist__to_front() local
1695 evlist__for_each_entry_safe(evlist, n, evsel) { in evlist__to_front()
1696 if (evsel__leader(evsel) == evsel__leader(move_evsel)) in evlist__to_front()
1697 list_move_tail(&evsel->core.node, &move); in evlist__to_front()
1703 struct evsel *evlist__get_tracking_event(struct evlist *evlist) in evlist__get_tracking_event()
1705 struct evsel *evsel; in evlist__get_tracking_event() local
1707 evlist__for_each_entry(evlist, evsel) { in evlist__get_tracking_event()
1708 if (evsel->tracking) in evlist__get_tracking_event()
1709 return evsel; in evlist__get_tracking_event()
1715 void evlist__set_tracking_event(struct evlist *evlist, struct evsel *tracking_evsel) in evlist__set_tracking_event()
1717 struct evsel *evsel; in evlist__set_tracking_event() local
1722 evlist__for_each_entry(evlist, evsel) { in evlist__set_tracking_event()
1723 if (evsel != tracking_evsel) in evlist__set_tracking_event()
1724 evsel->tracking = false; in evlist__set_tracking_event()
1730 struct evsel *evlist__findnew_tracking_event(struct evlist *evlist, bool system_wide) in evlist__findnew_tracking_event()
1732 struct evsel *evsel; in evlist__findnew_tracking_event() local
1734 evsel = evlist__get_tracking_event(evlist); in evlist__findnew_tracking_event()
1735 if (!evsel__is_dummy_event(evsel)) { in evlist__findnew_tracking_event()
1736 evsel = evlist__add_aux_dummy(evlist, system_wide); in evlist__findnew_tracking_event()
1737 if (!evsel) in evlist__findnew_tracking_event()
1740 evlist__set_tracking_event(evlist, evsel); in evlist__findnew_tracking_event()
1742 perf_evlist__go_system_wide(&evlist->core, &evsel->core); in evlist__findnew_tracking_event()
1745 return evsel; in evlist__findnew_tracking_event()
1748 struct evsel *evlist__find_evsel_by_str(struct evlist *evlist, const char *str) in evlist__find_evsel_by_str()
1750 struct evsel *evsel; in evlist__find_evsel_by_str() local
1752 evlist__for_each_entry(evlist, evsel) { in evlist__find_evsel_by_str()
1753 if (!evsel->name) in evlist__find_evsel_by_str()
1755 if (evsel__name_is(evsel, str)) in evlist__find_evsel_by_str()
1756 return evsel; in evlist__find_evsel_by_str()
1821 struct evsel *evsel; in evlist__exclude_kernel() local
1823 evlist__for_each_entry(evlist, evsel) { in evlist__exclude_kernel()
1824 if (!evsel->core.attr.exclude_kernel) in evlist__exclude_kernel()
1839 struct evsel *leader = evlist__first(evlist); in evlist__force_leader()
1846 struct evsel *evlist__reset_weak_group(struct evlist *evsel_list, struct evsel *evsel, bool close) in evlist__reset_weak_group() argument
1848 struct evsel *c2, *leader; in evlist__reset_weak_group()
1851 leader = evsel__leader(evsel); in evlist__reset_weak_group()
1861 if (c2 == evsel) in evlist__reset_weak_group()
2111 struct evsel *evsel; in evlist__ctlfd_enable() local
2125 evsel = evlist__find_evsel_by_str(evlist, name); in evlist__ctlfd_enable()
2126 if (evsel) { in evlist__ctlfd_enable()
2131 pr_info("Event %s %s\n", evsel->name, in evlist__ctlfd_enable()
2152 struct evsel *evsel; in evlist__ctlfd_list() local
2177 evlist__for_each_entry(evlist, evsel) in evlist__ctlfd_list()
2178 evsel__fprintf(evsel, &details, stderr); in evlist__ctlfd_list()
2460 struct evsel *evlist__find_evsel(struct evlist *evlist, int idx) in evlist__find_evsel()
2462 struct evsel *evsel; in evlist__find_evsel() local
2464 evlist__for_each_entry(evlist, evsel) { in evlist__find_evsel()
2465 if (evsel->core.idx == idx) in evlist__find_evsel()
2466 return evsel; in evlist__find_evsel()
2473 struct evsel *evsel; in evlist__scnprintf_evsels() local
2476 evlist__for_each_entry(evlist, evsel) { in evlist__scnprintf_evsels()
2477 if (evsel__is_dummy_event(evsel)) in evlist__scnprintf_evsels()
2479 if (size > (strlen(evsel__name(evsel)) + (printed ? 2 : 1))) { in evlist__scnprintf_evsels()
2480 …printed += scnprintf(bf + printed, size - printed, "%s%s", printed ? "," : "", evsel__name(evsel)); in evlist__scnprintf_evsels()
2492 struct evsel *leader, *evsel, *pos; in evlist__check_mem_load_aux() local
2501 evlist__for_each_entry(evlist, evsel) { in evlist__check_mem_load_aux()
2502 leader = evsel__leader(evsel); in evlist__check_mem_load_aux()
2503 if (leader == evsel) in evlist__check_mem_load_aux()
2527 struct evsel *pos; in evlist__warn_user_requested_cpus()
2558 struct evsel *pos; in evlist__uniquify_name()
2588 struct evsel *evsel; in evlist__has_bpf_output() local
2590 evlist__for_each_entry(evlist, evsel) { in evlist__has_bpf_output()
2591 if (evsel__is_bpf_output(evsel)) in evlist__has_bpf_output()
2600 struct evsel *evsel; in evlist__needs_bpf_sb_event() local
2602 evlist__for_each_entry(evlist, evsel) { in evlist__needs_bpf_sb_event()
2603 if (evsel__is_dummy_event(evsel)) in evlist__needs_bpf_sb_event()
2605 if (!evsel->core.attr.exclude_kernel) in evlist__needs_bpf_sb_event()