Home
last modified time | relevance | path

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

12345678

/linux/tools/perf/tests/
H A Dparse-events.c41 static bool check_evsel(const char *test, int line, bool cond, struct evsel *evsel) in check_evsel() argument
49 evsel__fprintf(evsel, &details, debug_file()); in check_evsel()
52 #define TEST_ASSERT_EVSEL(test, cond, evsel) \ argument
53 if (!check_evsel(test, __LINE__, cond, evsel)) \
65 struct evsel *evsel; in num_core_entries() local
67 evlist__for_each_entry(evlist, evsel) { in num_core_entries()
68 if (!evsel->pmu->is_core) in num_core_entries()
70 if (core_pmu != evsel->pmu && core_pmu != NULL) in num_core_entries()
72 core_pmu = evsel->pmu; in num_core_entries()
77 static bool test_hw_config(const struct evsel *evsel, __u64 expected_config) in test_hw_config() argument
[all …]
H A Devent-times.c19 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/util/
H A Devsel.h45 struct evsel { struct
77 struct evsel *first_wildcard_match;
103 struct evsel *metric_leader; argument
233 static inline struct perf_cpu_map *evsel__cpus(struct evsel *evsel) in evsel__cpus() argument
235 return perf_evsel__cpus(&evsel->core); in evsel__cpus()
238 static inline int evsel__nr_cpus(struct evsel *evsel) in evsel__nr_cpus() argument
240 return perf_cpu_map__nr(evsel__cpus(evsel)); in evsel__nr_cpus()
243 void evsel__compute_deltas(struct evsel *evsel, int cpu, int thread,
247 int (*init)(struct evsel *evsel),
248 void (*fini)(struct evsel *evsel));
[all …]
H A Devsel.c84 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 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 …]
H A Dbpf_counter.c106 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 Dbpf_counter.h5 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 Devlist.c126 struct evsel *evsel; in evlist__new_default() local
128 evlist__for_each_entry(evlist, evsel) in evlist__new_default()
129 evsel__set_sample_id(evsel, /*can_sample_identifier=*/false); in evlist__new_default()
156 struct evsel *first = evlist__first(evlist); in evlist__set_id_pos()
164 struct evsel *evsel; in evlist__update_id_pos() local
166 evlist__for_each_entry(evlist, evsel) in evlist__update_id_pos()
167 evsel__calc_id_pos(evsel); in evlist__update_id_pos()
174 struct evsel *pos, *n; in evlist__purge()
207 void evlist__add(struct evlist *evlist, struct evsel *entry) in evlist__add()
217 void evlist__remove(struct evlist *evlist, struct evsel *evsel) in evlist__remove() argument
[all …]
H A Dbpf_counter_cgroup.c42 static struct evsel *cgrp_switch;
99 struct evsel *evsel; in bperf_load_program() local
147 evlist__for_each_entry(evlist, evsel) { in bperf_load_program()
148 if (cgrp == NULL || evsel->cgrp == leader_cgrp) { in bperf_load_program()
149 leader_cgrp = evsel->cgrp; in bperf_load_program()
150 evsel->cgrp = NULL; in bperf_load_program()
153 err = evsel__open_per_cpu(evsel, evsel->core.cpus, -1); in bperf_load_program()
155 evsel->supported = true; in bperf_load_program()
158 perf_cpu_map__for_each_cpu(cpu, j, evsel->core.cpus) { in bperf_load_program()
159 int fd = FD(evsel, j); in bperf_load_program()
[all …]
H A Drecord.c4 #include "evsel.h"
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()
41 evsel__config_term_mask(struct evsel * evsel) evsel__config_term_mask() argument
53 evsel__config_leader_sampling(struct evsel * evsel,struct evlist * evlist) evsel__config_leader_sampling() argument
97 struct evsel *evsel; evlist__config() local
224 struct evsel *evsel; evlist__can_select_event() local
[all...]
H A Dtool_pmu.c96 bool evsel__is_tool(const struct evsel *evsel) in evsel__is_tool() argument
98 return perf_pmu__is_tool(evsel->pmu); in evsel__is_tool()
101 enum tool_pmu_event evsel__tool_event(const struct evsel *evsel) in evsel__tool_event() argument
103 if (!evsel__is_tool(evsel)) in evsel__tool_event()
106 return (enum tool_pmu_event)evsel->core.attr.config; in evsel__tool_event()
109 const char *evsel__tool_pmu_event_name(const struct evsel *evsel) in evsel__tool_pmu_event_name() argument
111 return tool_pmu__event_to_str(evsel->core.attr.config); in evsel__tool_pmu_event_name()
223 int evsel__tool_pmu_prepare_open(struct evsel *evsel, in evsel__tool_pmu_prepare_open() argument
227 if ((evsel__tool_event(evsel) == TOOL_PMU__EVENT_SYSTEM_TIME || in evsel__tool_pmu_prepare_open()
228 evsel__tool_event(evsel) == TOOL_PMU__EVENT_USER_TIME) && in evsel__tool_pmu_prepare_open()
[all …]
H A Devlist.h72 struct evsel *selected;
112 void evlist__add(struct evlist *evlist, struct evsel *entry);
113 void evlist__remove(struct evlist *evlist, struct evsel *evsel);
115 int arch_evlist__cmp(const struct evsel *lhs, const struct evsel *rhs);
119 struct evsel *evlist__add_aux_dummy(struct evlist *evlist, bool system_wide);
120 static inline struct evsel *evlist__add_dummy_on_all_cpus(struct evlist *evlist) in evlist__add_dummy_on_all_cpus()
125 struct evsel *evlist__add_sched_switch(struct evlist *evlist, bool system_wide);
153 struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name);
164 struct evsel *evlist__id2evsel(struct evlist *evlist, u64 id);
165 struct evsel *evlist__id2evsel_strict(struct evlist *evlist, u64 id);
[all …]
H A Dstat-shadow.c22 const struct evsel *evsel, int *tool_aggr_idx) in tool_pmu__is_time_event() argument
24 enum tool_pmu_event event = evsel__tool_event(evsel); in tool_pmu__is_time_event()
47 const struct evsel *evsel, in prepare_metric() argument
51 struct evsel * const *metric_events = mexp->metric_events; in prepare_metric()
69 if (evsel && evsel->metric_leader && in prepare_metric()
70 evsel->pmu != evsel->metric_leader->pmu && in prepare_metric()
71 mexp->metric_events[i]->pmu == evsel->metric_leader->pmu) { in prepare_metric()
72 struct evsel *pos; in prepare_metric()
74 evlist__for_each_entry(evsel->evlist, pos) { in prepare_metric()
75 if (pos->pmu != evsel->pmu) in prepare_metric()
[all …]
H A 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()
93 static void perf_probe_sample_identifier(struct evsel *evsel) in perf_probe_sample_identifier() argument
95 evsel->core.attr.sample_type |= PERF_SAMPLE_IDENTIFIER; in perf_probe_sample_identifier()
98 static void perf_probe_comm_exec(struct evsel *evsel) in perf_probe_comm_exec() argument
100 evsel->core.attr.comm_exec = 1; in perf_probe_comm_exec()
[all …]
H A Dintel-tpebs.c45 struct evsel *evsel; member
69 static struct tpebs_retire_lat *tpebs_retire_lat__find(struct evsel *evsel)
72 static int evsel__tpebs_start_perf_record(struct evsel *evsel) in evsel__tpebs_start_perf_record() argument
99 if (!perf_cpu_map__is_any_cpu_or_is_empty(evsel->evlist->core.user_requested_cpus)) { in evsel__tpebs_start_perf_record()
100 cpu_map__snprint(evsel->evlist->core.user_requested_cpus, cpumap_buf, in evsel__tpebs_start_perf_record()
173 if (t->evsel->evlist == NULL) in should_ignore_sample()
176 workload_pid = t->evsel->evlist->workload.pid; in should_ignore_sample()
180 if (!t->evsel->core.attr.inherit) in should_ignore_sample()
189 struct evsel *evsel, in process_sample_event() argument
200 t = tpebs_retire_lat__find(evsel); in process_sample_event()
[all …]
H A Dannotate.h124 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 …]
H A 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 …]
/linux/tools/perf/arch/x86/tests/
H A 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/tools/lib/perf/
H A Devsel.c23 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 Devlist.c37 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 Devsel.c22 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 Dtopdown.c37 bool arch_is_topdown_slots(const struct evsel *evsel) in arch_is_topdown_slots() argument
39 return evsel->core.attr.type == PERF_TYPE_RAW && in arch_is_topdown_slots()
40 evsel->core.attr.config == TOPDOWN_SLOTS && in arch_is_topdown_slots()
41 evsel->core.attr.config1 == 0; in arch_is_topdown_slots()
44 bool arch_is_topdown_metrics(const struct evsel *evsel) in arch_is_topdown_metrics() argument
47 return evsel->core.attr.type == PERF_TYPE_RAW && in arch_is_topdown_metrics()
48 (evsel->core.attr.config & 0xFFFFF8FF) == 0x8000 && in arch_is_topdown_metrics()
49 evsel->core.attr.config1 == 0; in arch_is_topdown_metrics()
58 bool arch_topdown_sample_read(struct evsel *leader) in arch_topdown_sample_read()
60 struct evsel *evsel; in arch_topdown_sample_read() local
[all …]
H A Dkvm-stat.c32 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 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 …]
H A 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 …]

12345678