Home
last modified time | relevance | path

Searched refs:evsel (Results 1 – 25 of 199) sorted by relevance

12345678

/linux-6.12.1/tools/perf/util/
Devsel.h59 struct evsel { struct
111 struct evsel **metric_events; argument
112 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),
247 void (*fini)(struct evsel *evsel));
[all …]
Devsel.c101 static int evsel__no_extra_init(struct evsel *evsel __maybe_unused) in evsel__no_extra_init()
108 static void evsel__no_extra_fini(struct evsel *evsel __maybe_unused) in evsel__no_extra_fini()
114 int (*init)(struct evsel *evsel);
115 void (*fini)(struct evsel *evsel);
117 .size = sizeof(struct evsel),
122 int evsel__object_config(size_t object_size, int (*init)(struct evsel *evsel), in evsel__object_config() argument
123 void (*fini)(struct evsel *evsel)) in evsel__object_config() argument
222 void evsel__calc_id_pos(struct evsel *evsel) in evsel__calc_id_pos() argument
224 evsel->id_pos = __perf_evsel__calc_id_pos(evsel->core.attr.sample_type); in evsel__calc_id_pos()
225 evsel->is_pos = __perf_evsel__calc_is_pos(evsel->core.attr.sample_type); in evsel__calc_id_pos()
[all …]
Dstat.c80 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 …]
Dbpf_counter.c48 static int bpf_program_profiler__destroy(struct evsel *evsel) in bpf_program_profiler__destroy() argument
53 &evsel->bpf_counter_list, list) { in bpf_program_profiler__destroy()
58 assert(list_empty(&evsel->bpf_counter_list)); in bpf_program_profiler__destroy()
102 static int bpf_program_profiler_load_one(struct evsel *evsel, u32 prog_id) in bpf_program_profiler_load_one() argument
128 skel->rodata->num_cpu = evsel__nr_cpus(evsel); in bpf_program_profiler_load_one()
130 bpf_map__set_max_entries(skel->maps.events, evsel__nr_cpus(evsel)); in bpf_program_profiler_load_one()
157 list_add(&counter->list, &evsel->bpf_counter_list); in bpf_program_profiler_load_one()
169 static int bpf_program_profiler__load(struct evsel *evsel, struct target *target) in bpf_program_profiler__load() argument
189 ret = bpf_program_profiler_load_one(evsel, prog_id); in bpf_program_profiler__load()
191 bpf_program_profiler__destroy(evsel); in bpf_program_profiler__load()
[all …]
Dstat-shadow.c55 static int evsel_context(const struct evsel *evsel) in evsel_context() argument
59 if (evsel->core.attr.exclude_kernel) in evsel_context()
61 if (evsel->core.attr.exclude_user) in evsel_context()
63 if (evsel->core.attr.exclude_hv) in evsel_context()
65 if (evsel->core.attr.exclude_host) in evsel_context()
67 if (evsel->core.attr.exclude_idle) in evsel_context()
79 static enum stat_type evsel__stat_type(const struct evsel *evsel) in evsel__stat_type() argument
98 if (evsel__is_clock(evsel)) in evsel__stat_type()
100 else if (evsel__match(evsel, HARDWARE, HW_CPU_CYCLES)) in evsel__stat_type()
102 else if (evsel__match(evsel, HARDWARE, HW_INSTRUCTIONS)) in evsel__stat_type()
[all …]
Dbpf_counter.h14 struct evsel;
18 typedef int (*bpf_counter_evsel_op)(struct evsel *evsel);
19 typedef int (*bpf_counter_evsel_target_op)(struct evsel *evsel,
21 typedef int (*bpf_counter_evsel_install_pe_op)(struct evsel *evsel,
41 int bpf_counter__load(struct evsel *evsel, struct target *target);
42 int bpf_counter__enable(struct evsel *evsel);
43 int bpf_counter__disable(struct evsel *evsel);
44 int bpf_counter__read(struct evsel *evsel);
45 void bpf_counter__destroy(struct evsel *evsel);
46 int bpf_counter__install_pe(struct evsel *evsel, int cpu_map_idx, int fd);
[all …]
Dbpf_counter_cgroup.c39 static struct evsel *cgrp_switch;
47 struct evsel *evsel; in bperf_load_program() local
112 evlist__for_each_entry(evlist, evsel) { in bperf_load_program()
113 if (cgrp == NULL || evsel->cgrp == leader_cgrp) { in bperf_load_program()
114 leader_cgrp = evsel->cgrp; in bperf_load_program()
115 evsel->cgrp = NULL; in bperf_load_program()
118 err = evsel__open_per_cpu(evsel, evsel->core.cpus, -1); in bperf_load_program()
120 evsel->supported = true; in bperf_load_program()
123 perf_cpu_map__for_each_cpu(cpu, j, evsel->core.cpus) { in bperf_load_program()
124 int fd = FD(evsel, j); in bperf_load_program()
[all …]
Devlist.c113 struct evsel *evsel; in evlist__new_default() local
115 evlist__for_each_entry(evlist, evsel) in evlist__new_default()
116 evsel__set_sample_id(evsel, /*can_sample_identifier=*/false); in evlist__new_default()
143 struct evsel *first = evlist__first(evlist); in evlist__set_id_pos()
151 struct evsel *evsel; in evlist__update_id_pos() local
153 evlist__for_each_entry(evlist, evsel) in evlist__update_id_pos()
154 evsel__calc_id_pos(evsel); in evlist__update_id_pos()
161 struct evsel *pos, *n; in evlist__purge()
194 void evlist__add(struct evlist *evlist, struct evsel *entry) in evlist__add()
204 void evlist__remove(struct evlist *evlist, struct evsel *evsel) in evlist__remove() argument
[all …]
Drecord.c26 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 …]
Dperf_api_probe.c12 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 …]
Devlist.h69 struct evsel *selected;
102 void evlist__add(struct evlist *evlist, struct evsel *entry);
103 void evlist__remove(struct evlist *evlist, struct evsel *evsel);
117 int arch_evlist__cmp(const struct evsel *lhs, const struct evsel *rhs);
120 struct evsel *evlist__add_aux_dummy(struct evlist *evlist, bool system_wide);
121 static inline struct evsel *evlist__add_dummy_on_all_cpus(struct evlist *evlist) in evlist__add_dummy_on_all_cpus()
126 struct evsel *evlist__add_sched_switch(struct evlist *evlist, bool system_wide);
155 struct evsel *evlist__find_tracepoint_by_id(struct evlist *evlist, int id);
156 struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name);
167 struct evsel *evlist__id2evsel(struct evlist *evlist, u64 id);
[all …]
Dsideband_evlist.c18 struct evsel *evsel; in evlist__add_sb_event() local
25 evsel = evsel__new_idx(attr, evlist->core.nr_entries); in evlist__add_sb_event()
26 if (!evsel) in evlist__add_sb_event()
29 evsel->side_band.cb = cb; in evlist__add_sb_event()
30 evsel->side_band.data = data; in evlist__add_sb_event()
31 evlist__add(evlist, evsel); in evlist__add_sb_event()
65 struct evsel *evsel = evlist__event2evsel(evlist, event); in perf_evlist__poll_thread() local
67 if (evsel && evsel->side_band.cb) in perf_evlist__poll_thread()
68 evsel->side_band.cb(event, evsel->side_band.data); in perf_evlist__poll_thread()
86 struct evsel *evsel; in evlist__set_cb() local
[all …]
Dbpf-filter.h18 struct evsel;
30 int perf_bpf_filter__prepare(struct evsel *evsel, struct target *target);
31 int perf_bpf_filter__destroy(struct evsel *evsel);
32 u64 perf_bpf_filter__lost_count(struct evsel *evsel);
43 static inline int perf_bpf_filter__prepare(struct evsel *evsel __maybe_unused, in perf_bpf_filter__prepare()
48 static inline int perf_bpf_filter__destroy(struct evsel *evsel __maybe_unused) in perf_bpf_filter__destroy()
52 static inline u64 perf_bpf_filter__lost_count(struct evsel *evsel __maybe_unused) in perf_bpf_filter__lost_count()
/linux-6.12.1/tools/perf/tests/
Dparse-events.c37 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()
87 struct evsel *evsel = evlist__first(evlist); in test__checkevent_tracepoint() local
91 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); in test__checkevent_tracepoint()
93 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); in test__checkevent_tracepoint()
94 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period); in test__checkevent_tracepoint()
100 struct evsel *evsel; in test__checkevent_tracepoint_multi() local
[all …]
Devsel-tp-sched.c8 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()
46 if (evsel__test_field(evsel, "prev_comm", 16, false)) in test__perf_evsel__tp_sched_test()
49 if (evsel__test_field(evsel, "prev_pid", 4, true)) in test__perf_evsel__tp_sched_test()
[all …]
Devent-times.c19 struct evsel *evsel = evlist__last(evlist); in attach__enable_on_exec() local
41 evsel->core.attr.enable_on_exec = 1; in attach__enable_on_exec()
61 struct evsel *evsel = evlist__last(evlist); in attach__current_disabled() local
73 evsel->core.attr.disabled = 1; in attach__current_disabled()
75 err = evsel__open_per_thread(evsel, threads); in attach__current_disabled()
82 return evsel__enable(evsel) == 0 ? TEST_OK : TEST_FAIL; in attach__current_disabled()
87 struct evsel *evsel = evlist__last(evlist); in attach__current_enabled() local
99 err = evsel__open_per_thread(evsel, threads); in attach__current_enabled()
107 struct evsel *evsel = evlist__last(evlist); in detach__disable() local
109 return evsel__enable(evsel); in detach__disable()
[all …]
/linux-6.12.1/tools/perf/arch/x86/tests/
Dhybrid.c10 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-6.12.1/tools/lib/perf/
Devsel.c22 void perf_evsel__init(struct perf_evsel *evsel, struct perf_event_attr *attr, in perf_evsel__init() argument
25 INIT_LIST_HEAD(&evsel->node); in perf_evsel__init()
26 evsel->attr = *attr; in perf_evsel__init()
27 evsel->idx = idx; in perf_evsel__init()
28 evsel->leader = evsel; in perf_evsel__init()
33 struct perf_evsel *evsel = zalloc(sizeof(*evsel)); in perf_evsel__new() local
35 if (evsel != NULL) in perf_evsel__new()
36 perf_evsel__init(evsel, attr, 0); in perf_evsel__new()
38 return evsel; in perf_evsel__new()
41 void perf_evsel__delete(struct perf_evsel *evsel) in perf_evsel__delete() argument
[all …]
Devlist.c37 struct perf_evsel *evsel) in __perf_evlist__propagate_maps() argument
39 if (evsel->system_wide) { in __perf_evlist__propagate_maps()
41 perf_cpu_map__put(evsel->cpus); in __perf_evlist__propagate_maps()
42 evsel->cpus = perf_cpu_map__new_online_cpus(); in __perf_evlist__propagate_maps()
43 } else if (evlist->has_user_cpus && evsel->is_pmu_core) { in __perf_evlist__propagate_maps()
48 perf_cpu_map__put(evsel->cpus); 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()
59 perf_cpu_map__put(evsel->cpus); in __perf_evlist__propagate_maps()
[all …]
/linux-6.12.1/tools/perf/arch/x86/util/
Devsel.c16 void arch_evsel__set_sample_weight(struct evsel *evsel) in arch_evsel__set_sample_weight() argument
18 evsel__set_sample_bit(evsel, WEIGHT_STRUCT); in arch_evsel__set_sample_weight()
22 bool evsel__sys_has_perf_metrics(const struct evsel *evsel) in evsel__sys_has_perf_metrics() argument
24 const char *pmu_name = evsel->pmu_name ? evsel->pmu_name : "cpu"; in evsel__sys_has_perf_metrics()
34 if ((evsel->core.attr.type == PERF_TYPE_RAW) && in evsel__sys_has_perf_metrics()
41 bool arch_evsel__must_be_in_group(const struct evsel *evsel) in arch_evsel__must_be_in_group() argument
43 if (!evsel__sys_has_perf_metrics(evsel) || !evsel->name || in arch_evsel__must_be_in_group()
44 strcasestr(evsel->name, "uops_retired.slots")) in arch_evsel__must_be_in_group()
47 return strcasestr(evsel->name, "topdown") || strcasestr(evsel->name, "slots"); in arch_evsel__must_be_in_group()
50 int arch_evsel__hw_name(struct evsel *evsel, char *bf, size_t size) in arch_evsel__hw_name() argument
[all …]
Dkvm-stat.c30 static void mmio_event_get_key(struct evsel *evsel, struct perf_sample *sample, in mmio_event_get_key() argument
33 key->key = evsel__intval(evsel, sample, "gpa"); in mmio_event_get_key()
34 key->info = evsel__intval(evsel, sample, "type"); in mmio_event_get_key()
41 static bool mmio_event_begin(struct evsel *evsel, in mmio_event_begin() argument
45 if (kvm_exit_event(evsel)) in mmio_event_begin()
49 if (evsel__name_is(evsel, "kvm:kvm_mmio") && in mmio_event_begin()
50 evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_WRITE) { in mmio_event_begin()
51 mmio_event_get_key(evsel, sample, key); in mmio_event_begin()
58 static bool mmio_event_end(struct evsel *evsel, struct perf_sample *sample, in mmio_event_end() argument
62 if (kvm_entry_event(evsel)) in mmio_event_end()
[all …]
Devlist.c28 struct evsel *evsel = evsel__new(attrs + i); in ___evlist__add_default_attrs() local
30 if (evsel == NULL) in ___evlist__add_default_attrs()
32 list_add_tail(&evsel->core.node, &head); in ___evlist__add_default_attrs()
38 struct evsel *evsel; in ___evlist__add_default_attrs() local
40 evsel = evsel__new(attrs + i); in ___evlist__add_default_attrs()
41 if (evsel == NULL) in ___evlist__add_default_attrs()
43 evsel->core.attr.config |= (__u64)pmu->type << PERF_PMU_TYPE_SHIFT; in ___evlist__add_default_attrs()
45 evsel->core.cpus = cpus; in ___evlist__add_default_attrs()
46 evsel->core.own_cpus = perf_cpu_map__get(cpus); in ___evlist__add_default_attrs()
47 evsel->pmu_name = strdup(pmu->name); in ___evlist__add_default_attrs()
[all …]
/linux-6.12.1/tools/lib/perf/tests/
Dtest-evlist.c38 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 …]
Dtest-evsel.c23 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 …]
/linux-6.12.1/tools/lib/perf/include/perf/
Devsel.h29 LIBPERF_API void perf_evsel__delete(struct perf_evsel *evsel);
30 LIBPERF_API int perf_evsel__open(struct perf_evsel *evsel, struct perf_cpu_map *cpus,
32 LIBPERF_API void perf_evsel__close(struct perf_evsel *evsel);
33 LIBPERF_API void perf_evsel__close_cpu(struct perf_evsel *evsel, int cpu_map_idx);
34 LIBPERF_API int perf_evsel__mmap(struct perf_evsel *evsel, int pages);
35 LIBPERF_API void perf_evsel__munmap(struct perf_evsel *evsel);
36 LIBPERF_API void *perf_evsel__mmap_base(struct perf_evsel *evsel, int cpu_map_idx, int thread);
37 LIBPERF_API int perf_evsel__read(struct perf_evsel *evsel, int cpu_map_idx, int thread,
39 LIBPERF_API int perf_evsel__enable(struct perf_evsel *evsel);
40 LIBPERF_API int perf_evsel__enable_cpu(struct perf_evsel *evsel, int cpu_map_idx);
[all …]

12345678