/linux-6.6.21/tools/perf/util/ |
D | evlist.h | 54 struct evlist { struct 70 void (*trace_event_sample_raw)(struct evlist *evlist, argument 92 struct evlist *evlist__new(void); argument 93 struct evlist *evlist__new_default(void); 94 struct evlist *evlist__new_dummy(void); 95 void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus, 97 void evlist__exit(struct evlist *evlist); 98 void evlist__delete(struct evlist *evlist); 100 void evlist__add(struct evlist *evlist, struct evsel *entry); 101 void evlist__remove(struct evlist *evlist, struct evsel *evsel); [all …]
|
D | evlist.c | 71 void evlist__init(struct evlist *evlist, struct perf_cpu_map *cpus, in evlist__init() argument 74 perf_evlist__init(&evlist->core); in evlist__init() 75 perf_evlist__set_maps(&evlist->core, cpus, threads); in evlist__init() 76 evlist->workload.pid = -1; in evlist__init() 77 evlist->bkw_mmap_state = BKW_MMAP_NOTREADY; in evlist__init() 78 evlist->ctl_fd.fd = -1; in evlist__init() 79 evlist->ctl_fd.ack = -1; in evlist__init() 80 evlist->ctl_fd.pos = -1; in evlist__init() 83 struct evlist *evlist__new(void) in evlist__new() 85 struct evlist *evlist = zalloc(sizeof(*evlist)); in evlist__new() local [all …]
|
D | sideband_evlist.c | 15 int evlist__add_sb_event(struct evlist *evlist, struct perf_event_attr *attr, in evlist__add_sb_event() argument 25 evsel = evsel__new_idx(attr, evlist->core.nr_entries); in evlist__add_sb_event() 31 evlist__add(evlist, evsel); in evlist__add_sb_event() 37 struct evlist *evlist = arg; in perf_evlist__poll_thread() local 52 if (evlist->thread.done) in perf_evlist__poll_thread() 56 evlist__poll(evlist, 1000); in perf_evlist__poll_thread() 58 for (i = 0; i < evlist->core.nr_mmaps; i++) { in perf_evlist__poll_thread() 59 struct mmap *map = &evlist->mmap[i]; in perf_evlist__poll_thread() 65 struct evsel *evsel = evlist__event2evsel(evlist, event); in perf_evlist__poll_thread() 84 void evlist__set_cb(struct evlist *evlist, evsel__sb_cb_t cb, void *data) in evlist__set_cb() argument [all …]
|
D | stat.h | 151 struct evlist; 191 struct evlist *evlist, bool alloc_raw); 192 void evlist__free_stats(struct evlist *evlist); 193 void evlist__reset_stats(struct evlist *evlist); 194 void evlist__reset_prev_raw_counts(struct evlist *evlist); 195 void evlist__copy_prev_raw_counts(struct evlist *evlist); 196 void evlist__save_aggr_prev_raw_counts(struct evlist *evlist); 198 int evlist__alloc_aggr_stats(struct evlist *evlist, int nr_aggr); 199 void evlist__reset_aggr_stats(struct evlist *evlist); 200 void evlist__copy_res_stats(struct perf_stat_config *config, struct evlist *evlist); [all …]
|
D | record.c | 26 static struct evsel *evsel__read_sampler(struct evsel *evsel, struct evlist *evlist) in evsel__read_sampler() argument 32 evlist__for_each_entry(evlist, evsel) { in evsel__read_sampler() 53 static void evsel__config_leader_sampling(struct evsel *evsel, struct evlist *evlist) in evsel__config_leader_sampling() argument 63 read_sampler = evsel__read_sampler(evsel, evlist); in evsel__config_leader_sampling() 95 void evlist__config(struct evlist *evlist, struct record_opts *opts, struct callchain_param *callch… in evlist__config() argument 102 if (perf_cpu_map__cpu(evlist->core.user_requested_cpus, 0).cpu < 0) in evlist__config() 107 evlist__for_each_entry(evlist, evsel) { in evlist__config() 114 evlist__for_each_entry(evlist, evsel) in evlist__config() 115 evsel__config_leader_sampling(evsel, evlist); in evlist__config() 125 } else if (evlist->core.nr_entries > 1) { in evlist__config() [all …]
|
D | iostat.h | 20 struct evlist; 33 int iostat_prepare(struct evlist *evlist, struct perf_stat_config *config); 36 void iostat_list(struct evlist *evlist, struct perf_stat_config *config); 37 void iostat_release(struct evlist *evlist); 38 void iostat_prefix(struct evlist *evlist, struct perf_stat_config *config, 43 void iostat_print_counters(struct evlist *evlist,
|
D | sample-raw.h | 5 struct evlist; 9 void evlist__s390_sample_raw(struct evlist *evlist, union perf_event *event, 11 bool evlist__has_amd_ibs(struct evlist *evlist); 12 void evlist__amd_sample_raw(struct evlist *evlist, union perf_event *event, 14 void evlist__init_trace_event_sample_raw(struct evlist *evlist);
|
/linux-6.6.21/tools/lib/perf/ |
D | evlist.c | 28 void perf_evlist__init(struct perf_evlist *evlist) in perf_evlist__init() argument 30 INIT_LIST_HEAD(&evlist->entries); in perf_evlist__init() 31 evlist->nr_entries = 0; in perf_evlist__init() 32 fdarray__init(&evlist->pollfd, 64); in perf_evlist__init() 33 perf_evlist__reset_id_hash(evlist); in perf_evlist__init() 36 static void __perf_evlist__propagate_maps(struct perf_evlist *evlist, in __perf_evlist__propagate_maps() argument 43 } else if (evlist->has_user_cpus && evsel->is_pmu_core) { in __perf_evlist__propagate_maps() 49 evsel->cpus = perf_cpu_map__intersect(evlist->user_requested_cpus, evsel->own_cpus); in __perf_evlist__propagate_maps() 50 } else if (!evsel->own_cpus || evlist->has_user_cpus || in __perf_evlist__propagate_maps() 51 (!evsel->requires_cpu && perf_cpu_map__has_any_cpu(evlist->user_requested_cpus))) { in __perf_evlist__propagate_maps() [all …]
|
/linux-6.6.21/tools/perf/tests/ |
D | expand-cgroup.c | 16 static int test_expand_events(struct evlist *evlist, in test_expand_events() argument 29 TEST_ASSERT_VAL("evlist is empty", !evlist__empty(evlist)); in test_expand_events() 31 nr_events = evlist->core.nr_entries; in test_expand_events() 38 evlist__for_each_entry(evlist, evsel) { in test_expand_events() 47 was_group_event = evsel__is_group_event(evlist__first(evlist)); in test_expand_events() 48 nr_members = evlist__first(evlist)->core.nr_members; in test_expand_events() 50 ret = evlist__expand_cgroup(evlist, cgrp_str, metric_events, false); in test_expand_events() 57 if (evlist->core.nr_entries != nr_events * nr_cgrps) { in test_expand_events() 63 evlist__for_each_entry(evlist, evsel) { in test_expand_events() 104 struct evlist *evlist = evlist__new_default(); in expand_default_events() local [all …]
|
D | event-times.c | 17 static int attach__enable_on_exec(struct evlist *evlist) in attach__enable_on_exec() argument 19 struct evsel *evsel = evlist__last(evlist); in attach__enable_on_exec() 29 err = evlist__create_maps(evlist, &target); in attach__enable_on_exec() 35 err = evlist__prepare_workload(evlist, &target, argv, false, NULL); in attach__enable_on_exec() 43 err = evlist__open(evlist); in attach__enable_on_exec() 50 return evlist__start_workload(evlist) == 1 ? TEST_OK : TEST_FAIL; in attach__enable_on_exec() 53 static int detach__enable_on_exec(struct evlist *evlist) in detach__enable_on_exec() argument 55 waitpid(evlist->workload.pid, NULL, 0); in detach__enable_on_exec() 59 static int attach__current_disabled(struct evlist *evlist) in attach__current_disabled() argument 61 struct evsel *evsel = evlist__last(evlist); in attach__current_disabled() [all …]
|
D | keep-tracking.c | 33 static int find_comm(struct evlist *evlist, const char *comm) in find_comm() argument 40 for (i = 0; i < evlist->core.nr_mmaps; i++) { in find_comm() 41 md = &evlist->mmap[i]; in find_comm() 76 struct evlist *evlist = NULL; in test__keep_tracking() local 87 evlist = evlist__new(); in test__keep_tracking() 88 CHECK_NOT_NULL__(evlist); in test__keep_tracking() 90 perf_evlist__set_maps(&evlist->core, cpus, threads); in test__keep_tracking() 92 CHECK__(parse_event(evlist, "dummy:u")); in test__keep_tracking() 93 CHECK__(parse_event(evlist, "cycles:u")); in test__keep_tracking() 95 evlist__config(evlist, &opts, NULL); in test__keep_tracking() [all …]
|
D | parse-events.c | 85 static int test__checkevent_tracepoint(struct evlist *evlist) in test__checkevent_tracepoint() argument 87 struct evsel *evsel = evlist__first(evlist); in test__checkevent_tracepoint() 89 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); in test__checkevent_tracepoint() 90 TEST_ASSERT_VAL("wrong number of groups", 0 == evlist__nr_groups(evlist)); in test__checkevent_tracepoint() 98 static int test__checkevent_tracepoint_multi(struct evlist *evlist) in test__checkevent_tracepoint_multi() argument 102 TEST_ASSERT_VAL("wrong number of entries", evlist->core.nr_entries > 1); in test__checkevent_tracepoint_multi() 103 TEST_ASSERT_VAL("wrong number of groups", 0 == evlist__nr_groups(evlist)); in test__checkevent_tracepoint_multi() 105 evlist__for_each_entry(evlist, evsel) { in test__checkevent_tracepoint_multi() 117 static int test__checkevent_raw(struct evlist *evlist) in test__checkevent_raw() argument 122 TEST_ASSERT_VAL("wrong number of entries", 0 != evlist->core.nr_entries); in test__checkevent_raw() [all …]
|
D | backward-ring-buffer.c | 32 static int count_samples(struct evlist *evlist, int *sample_count, in count_samples() argument 37 for (i = 0; i < evlist->core.nr_mmaps; i++) { in count_samples() 38 struct mmap *map = &evlist->overwrite_mmap[i]; in count_samples() 62 static int do_test(struct evlist *evlist, int mmap_pages, in do_test() argument 68 err = evlist__mmap(evlist, mmap_pages); in do_test() 75 evlist__enable(evlist); in do_test() 77 evlist__disable(evlist); in do_test() 79 err = count_samples(evlist, sample_count, comm_count); in do_test() 80 evlist__munmap(evlist); in do_test() 89 struct evlist *evlist; in test__backward_ring_buffer() local [all …]
|
D | switch-tracking.c | 125 static int process_sample_event(struct evlist *evlist, in process_sample_event() argument 134 if (evlist__parse_sample(evlist, event, &sample)) { in process_sample_event() 139 evsel = evlist__id2evsel(evlist, sample.id); in process_sample_event() 175 static int process_event(struct evlist *evlist, union perf_event *event, in process_event() argument 179 return process_sample_event(evlist, event, switch_tracking); in process_event() 215 static int add_event(struct evlist *evlist, struct list_head *events, in add_event() argument 229 if (evlist__parse_sample(evlist, event, &sample)) { in add_event() 264 static int process_events(struct evlist *evlist, in process_events() argument 274 for (i = 0; i < evlist->core.nr_mmaps; i++) { in process_events() 275 md = &evlist->mmap[i]; in process_events() [all …]
|
D | pfm.c | 15 static int count_pfm_events(struct perf_evlist *evlist) in count_pfm_events() argument 20 perf_evlist__for_each_entry(evlist, evsel) { in count_pfm_events() 29 struct evlist *evlist; in test__pfm_events() local 67 evlist = evlist__new(); in test__pfm_events() 68 if (evlist == NULL) in test__pfm_events() 71 opt.value = evlist; in test__pfm_events() 76 count_pfm_events(&evlist->core), in test__pfm_events() 79 evlist__nr_groups(evlist), in test__pfm_events() 82 evlist__delete(evlist); in test__pfm_events() 90 struct evlist *evlist; in test__pfm_group() local [all …]
|
D | evsel-roundtrip-name.c | 21 struct evlist *evlist = evlist__new(); in perf_evsel__roundtrip_cache_name_test() local 25 if (evlist == NULL) { in perf_evsel__roundtrip_cache_name_test() 32 err = parse_event(evlist, name); in perf_evsel__roundtrip_cache_name_test() 36 evlist__delete(evlist); in perf_evsel__roundtrip_cache_name_test() 39 evlist__for_each_entry(evlist, evsel) { in perf_evsel__roundtrip_cache_name_test() 45 evlist__delete(evlist); in perf_evsel__roundtrip_cache_name_test() 57 struct evlist *evlist = evlist__new(); in perf_evsel__name_array_test() local 61 if (evlist == NULL) { in perf_evsel__name_array_test() 65 err = parse_event(evlist, names[i]); in perf_evsel__name_array_test() 69 evlist__delete(evlist); in perf_evsel__name_array_test() [all …]
|
D | perf-record.c | 56 struct evlist *evlist = evlist__new_dummy(); in test__PERF_RECORD() local 73 if (evlist == NULL) /* Fallback for kernels lacking PERF_COUNT_SW_DUMMY */ in test__PERF_RECORD() 74 evlist = evlist__new_default(); in test__PERF_RECORD() 76 if (evlist == NULL) { in test__PERF_RECORD() 87 err = evlist__create_maps(evlist, &opts.target); in test__PERF_RECORD() 99 err = evlist__prepare_workload(evlist, &opts.target, argv, false, NULL); in test__PERF_RECORD() 108 evsel = evlist__first(evlist); in test__PERF_RECORD() 112 evlist__config(evlist, &opts, NULL); in test__PERF_RECORD() 114 err = sched__get_first_possible_cpu(evlist->workload.pid, &cpu_mask); in test__PERF_RECORD() 126 if (sched_setaffinity(evlist->workload.pid, cpu_mask_size, &cpu_mask) < 0) { in test__PERF_RECORD() [all …]
|
D | perf-time-to-tsc.c | 81 struct evlist *evlist = NULL; in test__perf_time_to_tsc() local 99 evlist = evlist__new(); in test__perf_time_to_tsc() 100 CHECK_NOT_NULL__(evlist); in test__perf_time_to_tsc() 102 perf_evlist__set_maps(&evlist->core, cpus, threads); in test__perf_time_to_tsc() 104 CHECK__(parse_event(evlist, "cycles:u")); in test__perf_time_to_tsc() 106 evlist__config(evlist, &opts, NULL); in test__perf_time_to_tsc() 109 evlist__for_each_entry(evlist, evsel) { in test__perf_time_to_tsc() 115 ret = evlist__open(evlist); in test__perf_time_to_tsc() 124 CHECK__(evlist__mmap(evlist, UINT_MAX)); in test__perf_time_to_tsc() 126 pc = evlist->mmap[0].core.base; in test__perf_time_to_tsc() [all …]
|
D | parse-metric.c | 33 static void load_runtime_stat(struct evlist *evlist, struct value *vals) in load_runtime_stat() argument 38 evlist__alloc_aggr_stats(evlist, 1); in load_runtime_stat() 39 evlist__for_each_entry(evlist, evsel) { in load_runtime_stat() 48 static double compute_single(struct rblist *metric_events, struct evlist *evlist, in compute_single() argument 55 evlist__for_each_entry(evlist, evsel) { in compute_single() 77 struct evlist *evlist; in __compute_metric() local 84 evlist = evlist__new(); in __compute_metric() 85 if (!evlist) in __compute_metric() 90 evlist__delete(evlist); in __compute_metric() 94 perf_evlist__set_maps(&evlist->core, cpus, NULL); in __compute_metric() [all …]
|
/linux-6.6.21/tools/lib/perf/tests/ |
D | test-evlist.c | 37 struct perf_evlist *evlist; in test_stat_cpu() local 52 evlist = perf_evlist__new(); in test_stat_cpu() 53 __T("failed to create evlist", evlist); in test_stat_cpu() 58 perf_evlist__add(evlist, evsel); in test_stat_cpu() 63 perf_evlist__add(evlist, evsel); in test_stat_cpu() 65 perf_evlist__set_leader(evlist); in test_stat_cpu() 69 perf_evlist__set_maps(evlist, cpus, NULL); in test_stat_cpu() 71 err = perf_evlist__open(evlist); in test_stat_cpu() 74 perf_evlist__for_each_evsel(evlist, evsel) { in test_stat_cpu() 85 perf_evlist__close(evlist); in test_stat_cpu() [all …]
|
/linux-6.6.21/tools/lib/perf/include/perf/ |
D | evlist.h | 13 LIBPERF_API void perf_evlist__add(struct perf_evlist *evlist, 15 LIBPERF_API void perf_evlist__remove(struct perf_evlist *evlist, 18 LIBPERF_API void perf_evlist__delete(struct perf_evlist *evlist); 19 LIBPERF_API struct perf_evsel* perf_evlist__next(struct perf_evlist *evlist, 21 LIBPERF_API int perf_evlist__open(struct perf_evlist *evlist); 22 LIBPERF_API void perf_evlist__close(struct perf_evlist *evlist); 23 LIBPERF_API void perf_evlist__enable(struct perf_evlist *evlist); 24 LIBPERF_API void perf_evlist__disable(struct perf_evlist *evlist); 26 #define perf_evlist__for_each_evsel(evlist, pos) \ argument 27 for ((pos) = perf_evlist__next((evlist), NULL); \ [all …]
|
/linux-6.6.21/tools/perf/arch/x86/tests/ |
D | hybrid.c | 25 static int test__hybrid_hw_event_with_pmu(struct evlist *evlist) in test__hybrid_hw_event_with_pmu() argument 27 struct evsel *evsel = evlist__first(evlist); in test__hybrid_hw_event_with_pmu() 29 TEST_ASSERT_VAL("wrong number of entries", 1 == evlist->core.nr_entries); in test__hybrid_hw_event_with_pmu() 36 static int test__hybrid_hw_group_event(struct evlist *evlist) in test__hybrid_hw_group_event() argument 40 evsel = leader = evlist__first(evlist); in test__hybrid_hw_group_event() 41 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); in test__hybrid_hw_group_event() 55 static int test__hybrid_sw_hw_group_event(struct evlist *evlist) in test__hybrid_sw_hw_group_event() argument 59 evsel = leader = evlist__first(evlist); in test__hybrid_sw_hw_group_event() 60 TEST_ASSERT_VAL("wrong number of entries", 2 == evlist->core.nr_entries); in test__hybrid_sw_hw_group_event() 72 static int test__hybrid_hw_sw_group_event(struct evlist *evlist) in test__hybrid_hw_sw_group_event() argument [all …]
|
/linux-6.6.21/tools/perf/bench/ |
D | evlist-open-close.c | 68 static int evlist__count_evsel_fds(struct evlist *evlist) in evlist__count_evsel_fds() argument 73 evlist__for_each_entry(evlist, evsel) in evlist__count_evsel_fds() 79 static struct evlist *bench__create_evlist(char *evstr) in bench__create_evlist() 82 struct evlist *evlist = evlist__new(); in bench__create_evlist() local 85 if (!evlist) { in bench__create_evlist() 91 ret = parse_events(evlist, evstr, &err); in bench__create_evlist() 100 ret = evlist__create_maps(evlist, &opts.target); in bench__create_evlist() 106 evlist__config(evlist, &opts, NULL); in bench__create_evlist() 108 return evlist; in bench__create_evlist() 111 evlist__delete(evlist); in bench__create_evlist() [all …]
|
/linux-6.6.21/tools/lib/perf/include/internal/ |
D | evlist.h | 54 int perf_evlist__alloc_pollfd(struct perf_evlist *evlist); 55 int perf_evlist__add_pollfd(struct perf_evlist *evlist, int fd, 58 int perf_evlist__mmap_ops(struct perf_evlist *evlist, 62 void perf_evlist__init(struct perf_evlist *evlist); 63 void perf_evlist__exit(struct perf_evlist *evlist); 78 #define perf_evlist__for_each_entry(evlist, evsel) \ argument 79 __perf_evlist__for_each_entry(&(evlist)->entries, evsel) 94 #define perf_evlist__for_each_entry_reverse(evlist, evsel) \ argument 95 __perf_evlist__for_each_entry_reverse(&(evlist)->entries, evsel) 112 #define perf_evlist__for_each_entry_safe(evlist, tmp, evsel) \ argument [all …]
|
/linux-6.6.21/tools/lib/perf/Documentation/examples/ |
D | counting.c | 21 struct perf_evlist *evlist; in main() local 46 evlist = perf_evlist__new(); in main() 47 if (!evlist) { in main() 56 perf_evlist__add(evlist, evsel); in main() 62 perf_evlist__add(evlist, evsel); in main() 63 perf_evlist__set_maps(evlist, NULL, threads); in main() 64 err = perf_evlist__open(evlist); in main() 69 perf_evlist__enable(evlist); in main() 71 perf_evlist__disable(evlist); in main() 72 perf_evlist__for_each_evsel(evlist, evsel) { in main() [all …]
|