| /linux/tools/perf/util/ |
| H A D | evsel.h | 45 struct evsel { struct 77 struct evsel *first_wildcard_match; 103 struct evsel **metric_events; argument 104 struct evsel *metric_leader; argument 232 static inline struct perf_cpu_map *evsel__cpus(struct evsel *evsel) in evsel__cpus() argument 234 return perf_evsel__cpus(&evsel->core); in evsel__cpus() 237 static inline int evsel__nr_cpus(struct evsel *evsel) in evsel__nr_cpus() argument 239 return perf_cpu_map__nr(evsel__cpus(evsel)); in evsel__nr_cpus() 242 void evsel__compute_deltas(struct evsel *evsel, int cpu, int thread, 246 int (*init)(struct evsel *evsel), [all …]
|
| H A D | evsel.c | 84 static int evsel__no_extra_init(struct evsel *evsel __maybe_unused) in evsel__no_extra_init() 207 static void evsel__no_extra_fini(struct evsel *evsel __maybe_unused) in evsel__no_extra_fini() 213 int (*init)(struct evsel *evsel); 214 void (*fini)(struct evsel *evsel); 216 .size = sizeof(struct evsel), 221 int evsel__object_config(size_t object_size, int (*init)(struct evsel *evsel), in evsel__object_config() argument 222 void (*fini)(struct evsel *evsel)) in evsel__object_config() argument 243 const char *evsel__pmu_name(const struct evsel *evsel) in evsel__pmu_name() argument 245 struct perf_pmu *pmu = evsel__find_pmu(evsel); in evsel__pmu_name() 250 return event_type(evsel->core.attr.type); in evsel__pmu_name() [all …]
|
| H A D | stat.c | 80 static void evsel__reset_aggr_stats(struct evsel *evsel) in evsel__reset_aggr_stats() argument 82 struct perf_stat_evsel *ps = evsel->stats; in evsel__reset_aggr_stats() 89 static void evsel__reset_stat_priv(struct evsel *evsel) in evsel__reset_stat_priv() argument 91 struct perf_stat_evsel *ps = evsel->stats; in evsel__reset_stat_priv() 94 evsel__reset_aggr_stats(evsel); in evsel__reset_stat_priv() 97 static int evsel__alloc_aggr_stats(struct evsel *evsel, int nr_aggr) in evsel__alloc_aggr_stats() argument 99 struct perf_stat_evsel *ps = evsel->stats; in evsel__alloc_aggr_stats() 114 struct evsel *evsel; in evlist__alloc_aggr_stats() local 116 evlist__for_each_entry(evlist, evsel) { in evlist__alloc_aggr_stats() 117 if (evsel__alloc_aggr_stats(evsel, nr_aggr) < 0) in evlist__alloc_aggr_stats() [all …]
|
| H A D | bpf_counter.c | 106 static int bpf_program_profiler__destroy(struct evsel *evsel) in bpf_program_profiler__destroy() argument 111 &evsel->bpf_counter_list, list) { in bpf_program_profiler__destroy() 116 assert(list_empty(&evsel->bpf_counter_list)); in bpf_program_profiler__destroy() 160 static int bpf_program_profiler_load_one(struct evsel *evsel, u32 prog_id) in bpf_program_profiler_load_one() argument 186 skel->rodata->num_cpu = evsel__nr_cpus(evsel); in bpf_program_profiler_load_one() 188 bpf_map__set_max_entries(skel->maps.events, evsel__nr_cpus(evsel)); in bpf_program_profiler_load_one() 215 list_add(&counter->list, &evsel->bpf_counter_list); in bpf_program_profiler_load_one() 227 static int bpf_program_profiler__load(struct evsel *evsel, struct target *target) in bpf_program_profiler__load() argument 247 ret = bpf_program_profiler_load_one(evsel, prog_id); in bpf_program_profiler__load() 249 bpf_program_profiler__destroy(evsel); in bpf_program_profiler__load() [all …]
|
| H A D | bpf_counter.h | 5 struct evsel; 10 typedef int (*bpf_counter_evsel_op)(struct evsel *evsel); 11 typedef int (*bpf_counter_evsel_target_op)(struct evsel *evsel, 13 typedef int (*bpf_counter_evsel_install_pe_op)(struct evsel *evsel, 27 int bpf_counter__load(struct evsel *evsel, struct target *target); 28 int bpf_counter__enable(struct evsel *evsel); 29 int bpf_counter__disable(struct evsel *evsel); 30 int bpf_counter__read(struct evsel *evsel); 31 void bpf_counter__destroy(struct evsel *evsel); 32 int bpf_counter__install_pe(struct evsel *evsel, int cpu_map_idx, int fd); [all …]
|
| H A D | stat-shadow.c | 56 static int evsel_context(const struct evsel *evsel) in evsel_context() argument 60 if (evsel->core.attr.exclude_kernel) in evsel_context() 62 if (evsel->core.attr.exclude_user) in evsel_context() 64 if (evsel->core.attr.exclude_hv) in evsel_context() 66 if (evsel->core.attr.exclude_host) in evsel_context() 68 if (evsel->core.attr.exclude_idle) in evsel_context() 80 static enum stat_type evsel__stat_type(struct evsel *evsel) in evsel__stat_type() argument 99 if (evsel__is_clock(evsel)) in evsel__stat_type() 101 else if (evsel__match(evsel, HARDWARE, HW_CPU_CYCLES)) in evsel__stat_type() 103 else if (evsel__match(evsel, HARDWARE, HW_INSTRUCTIONS)) in evsel__stat_type() [all …]
|
| H A D | bpf_counter_cgroup.c | 40 static struct evsel *cgrp_switch; 48 struct evsel *evsel; in bperf_load_program() local 113 evlist__for_each_entry(evlist, evsel) { in bperf_load_program() 114 if (cgrp == NULL || evsel->cgrp == leader_cgrp) { in bperf_load_program() 115 leader_cgrp = evsel->cgrp; in bperf_load_program() 116 evsel->cgrp = NULL; in bperf_load_program() 119 err = evsel__open_per_cpu(evsel, evsel->core.cpus, -1); in bperf_load_program() 121 evsel->supported = true; in bperf_load_program() 124 perf_cpu_map__for_each_cpu(cpu, j, evsel->core.cpus) { in bperf_load_program() 125 int fd = FD(evsel, j); in bperf_load_program() [all …]
|
| H A D | tool_pmu.c | 91 bool evsel__is_tool(const struct evsel *evsel) in evsel__is_tool() argument 93 return perf_pmu__is_tool(evsel->pmu); in evsel__is_tool() 96 enum tool_pmu_event evsel__tool_event(const struct evsel *evsel) in evsel__tool_event() argument 98 if (!evsel__is_tool(evsel)) in evsel__tool_event() 101 return (enum tool_pmu_event)evsel->core.attr.config; in evsel__tool_event() 104 const char *evsel__tool_pmu_event_name(const struct evsel *evsel) in evsel__tool_pmu_event_name() argument 106 return tool_pmu__event_to_str(evsel->core.attr.config); in evsel__tool_pmu_event_name() 201 int evsel__tool_pmu_prepare_open(struct evsel *evsel, in evsel__tool_pmu_prepare_open() argument 205 if ((evsel__tool_event(evsel) == TOOL_PMU__EVENT_SYSTEM_TIME || in evsel__tool_pmu_prepare_open() 206 evsel__tool_event(evsel) == TOOL_PMU__EVENT_USER_TIME) && in evsel__tool_pmu_prepare_open() [all …]
|
| H A D | evlist.c | 117 struct evsel *evsel; in evlist__new_default() local 119 evlist__for_each_entry(evlist, evsel) in evlist__new_default() 120 evsel__set_sample_id(evsel, /*can_sample_identifier=*/false); in evlist__new_default() 147 struct evsel *first = evlist__first(evlist); in evlist__set_id_pos() 155 struct evsel *evsel; in evlist__update_id_pos() local 157 evlist__for_each_entry(evlist, evsel) in evlist__update_id_pos() 158 evsel__calc_id_pos(evsel); in evlist__update_id_pos() 165 struct evsel *pos, *n; in evlist__purge() 198 void evlist__add(struct evlist *evlist, struct evsel *entry) in evlist__add() 208 void evlist__remove(struct evlist *evlist, struct evsel *evsel) in evlist__remove() argument [all …]
|
| H A D | record.c | 26 static struct evsel *evsel__read_sampler(struct evsel *evsel, struct evlist *evlist) in evsel__read_sampler() argument 28 struct evsel *leader = evsel__leader(evsel); in evsel__read_sampler() 32 evlist__for_each_entry(evlist, evsel) { in evsel__read_sampler() 33 if (evsel__leader(evsel) == leader && evsel != evsel__leader(evsel)) in evsel__read_sampler() 34 return evsel; in evsel__read_sampler() 41 static u64 evsel__config_term_mask(struct evsel *evsel) in evsel__config_term_mask() argument 44 struct list_head *config_terms = &evsel->config_terms; in evsel__config_term_mask() 53 static void evsel__config_leader_sampling(struct evsel *evsel, struct evlist *evlist) in evsel__config_leader_sampling() argument 55 struct perf_event_attr *attr = &evsel->core.attr; in evsel__config_leader_sampling() 56 struct evsel *leader = evsel__leader(evsel); in evsel__config_leader_sampling() [all …]
|
| H A D | evlist.h | 72 struct evsel *selected; 110 void evlist__add(struct evlist *evlist, struct evsel *entry); 111 void evlist__remove(struct evlist *evlist, struct evsel *evsel); 113 int arch_evlist__cmp(const struct evsel *lhs, const struct evsel *rhs); 117 struct evsel *evlist__add_aux_dummy(struct evlist *evlist, bool system_wide); 118 static inline struct evsel *evlist__add_dummy_on_all_cpus(struct evlist *evlist) in evlist__add_dummy_on_all_cpus() 123 struct evsel *evlist__add_sched_switch(struct evlist *evlist, bool system_wide); 151 struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name); 162 struct evsel *evlist__id2evsel(struct evlist *evlist, u64 id); 163 struct evsel *evlist__id2evsel_strict(struct evlist *evlist, u64 id); [all …]
|
| H A D | perf_api_probe.c | 12 typedef void (*setup_probe_fn_t)(struct evsel *evsel); 17 struct evsel *evsel; in perf_do_probe_api() local 29 evsel = evlist__first(evlist); in perf_do_probe_api() 32 fd = sys_perf_event_open(&evsel->core.attr, pid, cpu.cpu, -1, flags); in perf_do_probe_api() 44 fn(evsel); in perf_do_probe_api() 46 fd = sys_perf_event_open(&evsel->core.attr, pid, cpu.cpu, -1, flags); in perf_do_probe_api() 82 static void perf_probe_sample_identifier(struct evsel *evsel) in perf_probe_sample_identifier() argument 84 evsel->core.attr.sample_type |= PERF_SAMPLE_IDENTIFIER; in perf_probe_sample_identifier() 87 static void perf_probe_comm_exec(struct evsel *evsel) in perf_probe_comm_exec() argument 89 evsel->core.attr.comm_exec = 1; in perf_probe_comm_exec() [all …]
|
| H A D | intel-tpebs.c | 44 struct evsel *evsel; member 68 static struct tpebs_retire_lat *tpebs_retire_lat__find(struct evsel *evsel) 71 static int evsel__tpebs_start_perf_record(struct evsel *evsel) in evsel__tpebs_start_perf_record() argument 98 if (!perf_cpu_map__is_any_cpu_or_is_empty(evsel->evlist->core.user_requested_cpus)) { in evsel__tpebs_start_perf_record() 99 cpu_map__snprint(evsel->evlist->core.user_requested_cpus, cpumap_buf, in evsel__tpebs_start_perf_record() 172 if (t->evsel->evlist == NULL) in should_ignore_sample() 175 workload_pid = t->evsel->evlist->workload.pid; in should_ignore_sample() 179 if (!t->evsel->core.attr.inherit) in should_ignore_sample() 188 struct evsel *evsel, in process_sample_event() argument 199 t = tpebs_retire_lat__find(evsel); in process_sample_event() [all …]
|
| H A D | annotate.h | 124 struct evsel *evsel; member 204 struct evsel *evsel; member 219 struct evsel *evsel, 223 void symbol__calc_percent(struct symbol *sym, struct evsel *evsel); 398 const struct evsel *evsel) in annotated_source__histogram() argument 400 return &src->histograms[evsel->core.idx]; in annotated_source__histogram() 404 const struct evsel *evsel) in annotation__histogram() argument 406 return annotated_source__histogram(notes->src, evsel); in annotation__histogram() 410 annotated_source__hist_entry(struct annotated_source *src, const struct evsel *evsel, u64 offset) in annotated_source__hist_entry() argument 413 long key = offset << 16 | evsel->core.idx; in annotated_source__hist_entry() [all …]
|
| /linux/tools/perf/tests/ |
| H A D | parse-events.c | 37 static bool test_config(const struct evsel *evsel, __u64 expected_config) in test_config() argument 39 __u32 type = evsel->core.attr.type; in test_config() 40 __u64 config = evsel->core.attr.config; in test_config() 52 static bool test_perf_config(const struct perf_evsel *evsel, __u64 expected_config) in test_perf_config() argument 54 return (evsel->attr.config & PERF_HW_EVENT_MASK) == expected_config; in test_perf_config() 85 struct evsel *evsel = evlist__first(evlist); in test__checkevent_tracepoint() local 89 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); in test__checkevent_tracepoint() 91 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); in test__checkevent_tracepoint() 92 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period); in test__checkevent_tracepoint() 98 struct evsel *evsel; in test__checkevent_tracepoint_multi() local [all …]
|
| H A D | evsel-tp-sched.c | 8 static int evsel__test_field(struct evsel *evsel, const char *name, int size, bool should_be_signed) in evsel__test_field() argument 10 struct tep_format_field *field = evsel__field(evsel, name); in evsel__test_field() 15 pr_debug("%s: \"%s\" field not found!\n", evsel->name, name); in evsel__test_field() 22 evsel->name, name, is_signed, should_be_signed); in evsel__test_field() 28 evsel->name, name, field->size, size); in evsel__test_field() 38 struct evsel *evsel = evsel__newtp("sched", "sched_switch"); in test__perf_evsel__tp_sched_test() local 41 if (IS_ERR(evsel)) { in test__perf_evsel__tp_sched_test() 42 pr_debug("evsel__newtp failed with %ld\n", PTR_ERR(evsel)); in test__perf_evsel__tp_sched_test() 43 return PTR_ERR(evsel) == -EACCES ? TEST_SKIP : TEST_FAIL; in test__perf_evsel__tp_sched_test() 46 if (evsel__test_field(evsel, "prev_comm", 16, false)) in test__perf_evsel__tp_sched_test() [all …]
|
| H A D | event-times.c | 19 struct evsel *evsel = evlist__last(evlist); in attach__enable_on_exec() local 39 evsel->core.attr.enable_on_exec = 1; in attach__enable_on_exec() 59 struct evsel *evsel = evlist__last(evlist); in attach__current_disabled() local 71 evsel->core.attr.disabled = 1; in attach__current_disabled() 73 err = evsel__open_per_thread(evsel, threads); in attach__current_disabled() 80 return evsel__enable(evsel) == 0 ? TEST_OK : TEST_FAIL; in attach__current_disabled() 85 struct evsel *evsel = evlist__last(evlist); in attach__current_enabled() local 97 err = evsel__open_per_thread(evsel, threads); in attach__current_enabled() 105 struct evsel *evsel = evlist__last(evlist); in detach__disable() local 107 return evsel__enable(evsel); in detach__disable() [all …]
|
| /linux/tools/perf/arch/x86/tests/ |
| H A D | hybrid.c | 10 static bool test_config(const struct evsel *evsel, __u64 expected_config) in test_config() argument 12 return (evsel->core.attr.config & PERF_HW_EVENT_MASK) == expected_config; in test_config() 15 static bool test_perf_config(const struct perf_evsel *evsel, __u64 expected_config) in test_perf_config() argument 17 return (evsel->attr.config & PERF_HW_EVENT_MASK) == expected_config; in test_perf_config() 20 static bool test_hybrid_type(const struct evsel *evsel, __u64 expected_config) in test_hybrid_type() argument 22 return (evsel->core.attr.config >> PERF_PMU_TYPE_SHIFT) == expected_config; in test_hybrid_type() 27 struct evsel *evsel = evlist__first(evlist); in test__hybrid_hw_event_with_pmu() local 30 TEST_ASSERT_VAL("wrong type", PERF_TYPE_HARDWARE == evsel->core.attr.type); in test__hybrid_hw_event_with_pmu() 31 TEST_ASSERT_VAL("wrong hybrid type", test_hybrid_type(evsel, PERF_TYPE_RAW)); in test__hybrid_hw_event_with_pmu() 32 TEST_ASSERT_VAL("wrong config", test_config(evsel, PERF_COUNT_HW_CPU_CYCLES)); in test__hybrid_hw_event_with_pmu() [all …]
|
| /linux/tools/lib/perf/ |
| H A D | evsel.c | 23 void perf_evsel__init(struct perf_evsel *evsel, struct perf_event_attr *attr, in perf_evsel__init() argument 26 INIT_LIST_HEAD(&evsel->node); in perf_evsel__init() 27 INIT_LIST_HEAD(&evsel->per_stream_periods); in perf_evsel__init() 28 evsel->attr = *attr; in perf_evsel__init() 29 evsel->idx = idx; in perf_evsel__init() 30 evsel->leader = evsel; in perf_evsel__init() 35 struct perf_evsel *evsel = zalloc(sizeof(*evsel)); in perf_evsel__new() local 37 if (evsel != NULL) in perf_evsel__new() 38 perf_evsel__init(evsel, attr, 0); in perf_evsel__new() 40 return evsel; in perf_evsel__new() [all …]
|
| H A D | evlist.c | 37 struct perf_evsel *evsel) in __perf_evlist__propagate_maps() argument 39 if (perf_cpu_map__is_empty(evsel->cpus)) { in __perf_evlist__propagate_maps() 40 if (perf_cpu_map__is_empty(evsel->pmu_cpus)) { in __perf_evlist__propagate_maps() 45 evsel->pmu_cpus = perf_cpu_map__new_online_cpus(); in __perf_evlist__propagate_maps() 47 if (evlist->has_user_cpus && !evsel->system_wide) { in __perf_evlist__propagate_maps() 52 evsel->cpus = perf_cpu_map__get(evlist->user_requested_cpus); in __perf_evlist__propagate_maps() 58 evsel->cpus = perf_cpu_map__get(evsel->pmu_cpus); in __perf_evlist__propagate_maps() 65 if (evsel->requires_cpu && perf_cpu_map__has_any_cpu(evsel->cpus)) { in __perf_evlist__propagate_maps() 66 perf_cpu_map__put(evsel->cpus); in __perf_evlist__propagate_maps() 67 evsel->cpus = perf_cpu_map__get(evsel->pmu_cpus); in __perf_evlist__propagate_maps() [all …]
|
| /linux/tools/perf/arch/x86/util/ |
| H A D | evsel.c | 22 void arch_evsel__set_sample_weight(struct evsel *evsel) in arch_evsel__set_sample_weight() argument 24 evsel__set_sample_bit(evsel, WEIGHT_STRUCT); in arch_evsel__set_sample_weight() 28 bool evsel__sys_has_perf_metrics(const struct evsel *evsel) in evsel__sys_has_perf_metrics() argument 43 pmu = evsel__find_pmu(evsel); in evsel__sys_has_perf_metrics() 47 bool arch_evsel__must_be_in_group(const struct evsel *evsel) in arch_evsel__must_be_in_group() argument 49 if (!evsel__sys_has_perf_metrics(evsel)) in arch_evsel__must_be_in_group() 52 return arch_is_topdown_metrics(evsel) || arch_is_topdown_slots(evsel); in arch_evsel__must_be_in_group() 55 int arch_evsel__hw_name(struct evsel *evsel, char *bf, size_t size) in arch_evsel__hw_name() argument 57 u64 event = evsel->core.attr.config & PERF_HW_EVENT_MASK; in arch_evsel__hw_name() 58 u64 pmu = evsel->core.attr.config >> PERF_PMU_TYPE_SHIFT; in arch_evsel__hw_name() [all …]
|
| H A D | topdown.c | 36 bool arch_is_topdown_slots(const struct evsel *evsel) in arch_is_topdown_slots() argument 38 return evsel->core.attr.type == PERF_TYPE_RAW && in arch_is_topdown_slots() 39 evsel->core.attr.config == TOPDOWN_SLOTS && in arch_is_topdown_slots() 40 evsel->core.attr.config1 == 0; in arch_is_topdown_slots() 43 bool arch_is_topdown_metrics(const struct evsel *evsel) in arch_is_topdown_metrics() argument 46 return evsel->core.attr.type == PERF_TYPE_RAW && in arch_is_topdown_metrics() 47 (evsel->core.attr.config & 0xFFFFF8FF) == 0x8000 && in arch_is_topdown_metrics() 48 evsel->core.attr.config1 == 0; in arch_is_topdown_metrics() 57 bool arch_topdown_sample_read(struct evsel *leader) in arch_topdown_sample_read() 59 struct evsel *evsel; in arch_topdown_sample_read() local [all …]
|
| H A D | kvm-stat.c | 32 static void mmio_event_get_key(struct evsel *evsel, struct perf_sample *sample, in mmio_event_get_key() argument 35 key->key = evsel__intval(evsel, sample, "gpa"); in mmio_event_get_key() 36 key->info = evsel__intval(evsel, sample, "type"); in mmio_event_get_key() 43 static bool mmio_event_begin(struct evsel *evsel, in mmio_event_begin() argument 47 if (kvm_exit_event(evsel)) in mmio_event_begin() 51 if (evsel__name_is(evsel, "kvm:kvm_mmio") && in mmio_event_begin() 52 evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_WRITE) { in mmio_event_begin() 53 mmio_event_get_key(evsel, sample, key); in mmio_event_begin() 60 static bool mmio_event_end(struct evsel *evsel, struct perf_sample *sample, in mmio_event_end() argument 64 if (kvm_entry_event(evsel)) in mmio_event_end() [all …]
|
| /linux/tools/lib/perf/tests/ |
| H A D | test-evlist.c | 38 struct perf_evsel *evsel, *leader; in test_stat_cpu() local 55 evsel = leader = perf_evsel__new(&attr1); in test_stat_cpu() 56 __T("failed to create evsel1", evsel); in test_stat_cpu() 58 perf_evlist__add(evlist, evsel); in test_stat_cpu() 60 evsel = perf_evsel__new(&attr2); in test_stat_cpu() 61 __T("failed to create evsel2", evsel); in test_stat_cpu() 63 perf_evlist__add(evlist, evsel); in test_stat_cpu() 67 __T("failed to set leader", evsel->leader == leader); in test_stat_cpu() 74 perf_evlist__for_each_evsel(evlist, evsel) { in test_stat_cpu() 75 cpus = perf_evsel__cpus(evsel); in test_stat_cpu() [all …]
|
| H A D | test-evsel.c | 23 struct perf_evsel *evsel; in test_stat_cpu() local 33 evsel = perf_evsel__new(&attr); in test_stat_cpu() 34 __T("failed to create evsel", evsel); in test_stat_cpu() 36 err = perf_evsel__open(evsel, cpus, NULL); in test_stat_cpu() 42 perf_evsel__read(evsel, idx, 0, &counts); in test_stat_cpu() 46 perf_evsel__close(evsel); in test_stat_cpu() 47 perf_evsel__delete(evsel); in test_stat_cpu() 57 struct perf_evsel *evsel; in test_stat_thread() local 69 evsel = perf_evsel__new(&attr); in test_stat_thread() 70 __T("failed to create evsel", evsel); in test_stat_thread() [all …]
|