Home
last modified time | relevance | path

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

12345678

/tools/perf/util/
Devsel.h48 struct evsel { struct
97 struct evsel **metric_events; argument
98 struct evsel *metric_leader; argument
182 static inline struct perf_cpu_map *evsel__cpus(struct evsel *evsel) in evsel__cpus() argument
184 return perf_evsel__cpus(&evsel->core); in evsel__cpus()
187 static inline int evsel__nr_cpus(struct evsel *evsel) in evsel__nr_cpus() argument
189 return evsel__cpus(evsel)->nr; in evsel__nr_cpus()
195 void evsel__compute_deltas(struct evsel *evsel, int cpu, int thread,
199 int (*init)(struct evsel *evsel),
200 void (*fini)(struct evsel *evsel));
[all …]
Devsel.c62 static int evsel__no_extra_init(struct evsel *evsel __maybe_unused) in evsel__no_extra_init()
69 static void evsel__no_extra_fini(struct evsel *evsel __maybe_unused) in evsel__no_extra_fini()
75 int (*init)(struct evsel *evsel);
76 void (*fini)(struct evsel *evsel);
78 .size = sizeof(struct evsel),
83 int evsel__object_config(size_t object_size, int (*init)(struct evsel *evsel), in evsel__object_config() argument
84 void (*fini)(struct evsel *evsel)) in evsel__object_config() argument
183 void evsel__calc_id_pos(struct evsel *evsel) in evsel__calc_id_pos() argument
185 evsel->id_pos = __perf_evsel__calc_id_pos(evsel->core.attr.sample_type); in evsel__calc_id_pos()
186 evsel->is_pos = __perf_evsel__calc_is_pos(evsel->core.attr.sample_type); in evsel__calc_id_pos()
[all …]
Dbpf_counter.c47 static int bpf_program_profiler__destroy(struct evsel *evsel) in bpf_program_profiler__destroy() argument
52 &evsel->bpf_counter_list, list) { in bpf_program_profiler__destroy()
57 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__resize(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()
167 static int bpf_program_profiler__load(struct evsel *evsel, struct target *target) in bpf_program_profiler__load() argument
186 ret = bpf_program_profiler_load_one(evsel, prog_id); in bpf_program_profiler__load()
188 bpf_program_profiler__destroy(evsel); in bpf_program_profiler__load()
[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, int fd);
[all …]
Devlist-hybrid.c21 struct evsel *evsel; in evlist__add_default_hybrid() local
29 evsel = evsel__new_cycles(precise, PERF_TYPE_HARDWARE, in evlist__add_default_hybrid()
31 if (!evsel) in evlist__add_default_hybrid()
35 evsel->core.cpus = cpus; in evlist__add_default_hybrid()
36 evsel->core.own_cpus = perf_cpu_map__get(cpus); in evlist__add_default_hybrid()
37 evsel->pmu_name = strdup(pmu->name); in evlist__add_default_hybrid()
38 evlist__add(evlist, evsel); in evlist__add_default_hybrid()
44 static bool group_hybrid_conflict(struct evsel *leader) in group_hybrid_conflict()
46 struct evsel *pos, *prev = NULL; in group_hybrid_conflict()
63 struct evsel *evsel; in evlist__warn_hybrid_group() local
[all …]
Dstat.c79 bool __perf_stat_evsel__is(struct evsel *evsel, enum perf_stat_evsel_id id) in __perf_stat_evsel__is() argument
81 struct perf_stat_evsel *ps = evsel->stats; in __perf_stat_evsel__is()
111 static void perf_stat_evsel_id_init(struct evsel *evsel) in perf_stat_evsel_id_init() argument
113 struct perf_stat_evsel *ps = evsel->stats; in perf_stat_evsel_id_init()
119 if (!strcmp(evsel__name(evsel), id_str[i])) { in perf_stat_evsel_id_init()
126 static void evsel__reset_stat_priv(struct evsel *evsel) in evsel__reset_stat_priv() argument
129 struct perf_stat_evsel *ps = evsel->stats; in evsel__reset_stat_priv()
134 perf_stat_evsel_id_init(evsel); in evsel__reset_stat_priv()
137 static int evsel__alloc_stat_priv(struct evsel *evsel) in evsel__alloc_stat_priv() argument
139 evsel->stats = zalloc(sizeof(struct perf_stat_evsel)); in evsel__alloc_stat_priv()
[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, -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, -1, flags); in perf_do_probe_api()
81 static void perf_probe_sample_identifier(struct evsel *evsel) in perf_probe_sample_identifier() argument
83 evsel->core.attr.sample_type |= PERF_SAMPLE_IDENTIFIER; in perf_probe_sample_identifier()
86 static void perf_probe_comm_exec(struct evsel *evsel) in perf_probe_comm_exec() argument
88 evsel->core.attr.comm_exec = 1; in perf_probe_comm_exec()
[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, evlist->core.all_cpus, -1); in bperf_load_program()
126 int fd = FD(evsel, cpu); in bperf_load_program()
127 __u32 idx = evsel->core.idx * total_cpus + in bperf_load_program()
138 evsel->cgrp = leader_cgrp; in bperf_load_program()
[all …]
Devlist.c119 struct evsel *first = evlist__first(evlist); in evlist__set_id_pos()
127 struct evsel *evsel; in evlist__update_id_pos() local
129 evlist__for_each_entry(evlist, evsel) in evlist__update_id_pos()
130 evsel__calc_id_pos(evsel); in evlist__update_id_pos()
137 struct evsel *pos, *n; in evlist__purge()
167 void evlist__add(struct evlist *evlist, struct evsel *entry) in evlist__add()
177 void evlist__remove(struct evlist *evlist, struct evsel *evsel) in evlist__remove() argument
179 evsel->evlist = NULL; in evlist__remove()
180 perf_evlist__remove(&evlist->core, &evsel->core); in evlist__remove()
186 struct evsel *evsel, *temp, *leader = NULL; in evlist__splice_list_tail() local
[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 …]
Devlist.h64 struct evsel *selected;
96 void evlist__add(struct evlist *evlist, struct evsel *entry);
97 void evlist__remove(struct evlist *evlist, struct evsel *evsel);
140 struct evsel *evlist__find_tracepoint_by_id(struct evlist *evlist, int id);
141 struct evsel *evlist__find_tracepoint_by_name(struct evlist *evlist, const char *name);
152 struct evsel *evlist__id2evsel(struct evlist *evlist, u64 id);
153 struct evsel *evlist__id2evsel_strict(struct evlist *evlist, u64 id);
197 int evlist__enable_event_idx(struct evlist *evlist, struct evsel *evsel, int idx);
199 void evlist__set_selected(struct evlist *evlist, struct evsel *evsel);
202 int evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel);
[all …]
Dkvm-stat.h11 struct evsel;
50 void (*get_key)(struct evsel *evsel,
57 bool (*is_begin_event)(struct evsel *evsel,
60 bool (*is_end_event)(struct evsel *evsel,
114 void exit_event_get_key(struct evsel *evsel,
117 bool exit_event_begin(struct evsel *evsel,
120 bool exit_event_end(struct evsel *evsel,
127 bool kvm_exit_event(struct evsel *evsel);
128 bool kvm_entry_event(struct evsel *evsel);
Dcounts.c53 void evsel__reset_counts(struct evsel *evsel) in evsel__reset_counts() argument
55 perf_counts__reset(evsel->counts); in evsel__reset_counts()
58 int evsel__alloc_counts(struct evsel *evsel, int ncpus, int nthreads) in evsel__alloc_counts() argument
60 evsel->counts = perf_counts__new(ncpus, nthreads); in evsel__alloc_counts()
61 return evsel->counts != NULL ? 0 : -ENOMEM; in evsel__alloc_counts()
64 void evsel__free_counts(struct evsel *evsel) in evsel__free_counts() argument
66 perf_counts__delete(evsel->counts); in evsel__free_counts()
67 evsel->counts = NULL; in evsel__free_counts()
/tools/perf/tests/
Dparse-events.c51 struct evsel *evsel = evlist__first(evlist); in test__checkevent_tracepoint() local
55 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); in test__checkevent_tracepoint()
57 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); in test__checkevent_tracepoint()
58 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period); in test__checkevent_tracepoint()
64 struct evsel *evsel; in test__checkevent_tracepoint_multi() local
69 evlist__for_each_entry(evlist, evsel) { in test__checkevent_tracepoint_multi()
71 PERF_TYPE_TRACEPOINT == evsel->core.attr.type); in test__checkevent_tracepoint_multi()
73 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); in test__checkevent_tracepoint_multi()
75 1 == evsel->core.attr.sample_period); in test__checkevent_tracepoint_multi()
82 struct evsel *evsel = evlist__first(evlist); in test__checkevent_raw() 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()
37 struct evsel *evsel = evsel__newtp("sched", "sched_switch"); in test__perf_evsel__tp_sched_test() local
40 if (IS_ERR(evsel)) { in test__perf_evsel__tp_sched_test()
41 pr_debug("evsel__newtp failed with %ld\n", PTR_ERR(evsel)); in test__perf_evsel__tp_sched_test()
45 if (evsel__test_field(evsel, "prev_comm", 16, false)) in test__perf_evsel__tp_sched_test()
48 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 …]
Dopenat-syscall.c19 struct evsel *evsel; in test__openat_syscall_event() local
30 evsel = evsel__newtp("syscalls", "sys_enter_openat"); in test__openat_syscall_event()
31 if (IS_ERR(evsel)) { in test__openat_syscall_event()
37 if (evsel__open_per_thread(evsel, threads) < 0) { in test__openat_syscall_event()
49 if (evsel__read_on_cpu(evsel, 0, 0) < 0) { in test__openat_syscall_event()
54 if (perf_counts(evsel->counts, 0, 0)->val != nr_openat_calls) { in test__openat_syscall_event()
56 nr_openat_calls, perf_counts(evsel->counts, 0, 0)->val); in test__openat_syscall_event()
62 perf_evsel__close_fd(&evsel->core); in test__openat_syscall_event()
64 evsel__delete(evsel); in test__openat_syscall_event()
/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.c36 struct perf_evsel *evsel) in __perf_evlist__propagate_maps() argument
42 if (!evsel->own_cpus || evlist->has_user_cpus) { in __perf_evlist__propagate_maps()
43 perf_cpu_map__put(evsel->cpus); in __perf_evlist__propagate_maps()
44 evsel->cpus = perf_cpu_map__get(evlist->cpus); in __perf_evlist__propagate_maps()
45 } else if (!evsel->system_wide && perf_cpu_map__empty(evlist->cpus)) { in __perf_evlist__propagate_maps()
46 perf_cpu_map__put(evsel->cpus); in __perf_evlist__propagate_maps()
47 evsel->cpus = perf_cpu_map__get(evlist->cpus); in __perf_evlist__propagate_maps()
48 } else if (evsel->cpus != evsel->own_cpus) { in __perf_evlist__propagate_maps()
49 perf_cpu_map__put(evsel->cpus); in __perf_evlist__propagate_maps()
50 evsel->cpus = perf_cpu_map__get(evsel->own_cpus); in __perf_evlist__propagate_maps()
[all …]
/tools/perf/arch/x86/util/
Dkvm-stat.c31 static void mmio_event_get_key(struct evsel *evsel, struct perf_sample *sample, in mmio_event_get_key() argument
34 key->key = evsel__intval(evsel, sample, "gpa"); in mmio_event_get_key()
35 key->info = evsel__intval(evsel, sample, "type"); in mmio_event_get_key()
42 static bool mmio_event_begin(struct evsel *evsel, in mmio_event_begin() argument
46 if (kvm_exit_event(evsel)) in mmio_event_begin()
50 if (!strcmp(evsel->name, "kvm:kvm_mmio") && in mmio_event_begin()
51 evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_WRITE) { in mmio_event_begin()
52 mmio_event_get_key(evsel, sample, key); in mmio_event_begin()
59 static bool mmio_event_end(struct evsel *evsel, struct perf_sample *sample, in mmio_event_end() argument
63 if (kvm_entry_event(evsel)) in mmio_event_end()
[all …]
/tools/lib/perf/tests/
Dtest-evsel.c20 struct perf_evsel *evsel; in test_stat_cpu() local
30 evsel = perf_evsel__new(&attr); in test_stat_cpu()
31 __T("failed to create evsel", evsel); in test_stat_cpu()
33 err = perf_evsel__open(evsel, cpus, NULL); in test_stat_cpu()
39 perf_evsel__read(evsel, idx, 0, &counts); in test_stat_cpu()
43 perf_evsel__close(evsel); in test_stat_cpu()
44 perf_evsel__delete(evsel); in test_stat_cpu()
54 struct perf_evsel *evsel; in test_stat_thread() local
66 evsel = perf_evsel__new(&attr); in test_stat_thread()
67 __T("failed to create evsel", evsel); in test_stat_thread()
[all …]
Dtest-evlist.c34 struct perf_evsel *evsel, *leader; in test_stat_cpu() local
51 evsel = leader = perf_evsel__new(&attr1); in test_stat_cpu()
52 __T("failed to create evsel1", evsel); in test_stat_cpu()
54 perf_evlist__add(evlist, evsel); in test_stat_cpu()
56 evsel = perf_evsel__new(&attr2); in test_stat_cpu()
57 __T("failed to create evsel2", evsel); in test_stat_cpu()
59 perf_evlist__add(evlist, evsel); in test_stat_cpu()
63 __T("failed to set leader", evsel->leader == leader); in test_stat_cpu()
70 perf_evlist__for_each_evsel(evlist, evsel) { in test_stat_cpu()
71 cpus = perf_evsel__cpus(evsel); in test_stat_cpu()
[all …]
/tools/lib/perf/include/perf/
Devsel.h25 LIBPERF_API void perf_evsel__delete(struct perf_evsel *evsel);
26 LIBPERF_API int perf_evsel__open(struct perf_evsel *evsel, struct perf_cpu_map *cpus,
28 LIBPERF_API void perf_evsel__close(struct perf_evsel *evsel);
29 LIBPERF_API void perf_evsel__close_cpu(struct perf_evsel *evsel, int cpu);
30 LIBPERF_API int perf_evsel__mmap(struct perf_evsel *evsel, int pages);
31 LIBPERF_API void perf_evsel__munmap(struct perf_evsel *evsel);
32 LIBPERF_API void *perf_evsel__mmap_base(struct perf_evsel *evsel, int cpu, int thread);
33 LIBPERF_API int perf_evsel__read(struct perf_evsel *evsel, int cpu, int thread,
35 LIBPERF_API int perf_evsel__enable(struct perf_evsel *evsel);
36 LIBPERF_API int perf_evsel__enable_cpu(struct perf_evsel *evsel, int cpu);
[all …]
/tools/perf/arch/arm64/util/
Dkvm-stat.c25 static void event_get_key(struct evsel *evsel, in event_get_key() argument
30 key->key = evsel__intval(evsel, sample, kvm_exit_reason); in event_get_key()
39 key->key = evsel__intval(evsel, sample, kvm_trap_exit_reason); in event_get_key()
44 static bool event_begin(struct evsel *evsel, in event_begin() argument
48 return !strcmp(evsel->name, kvm_entry_trace); in event_begin()
51 static bool event_end(struct evsel *evsel, in event_end() argument
55 if (!strcmp(evsel->name, kvm_exit_trace)) { in event_end()
56 event_get_key(evsel, sample, key); in event_end()

12345678