Home
last modified time | relevance | path

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

123456

/tools/perf/util/
Devsel.h43 struct evsel { struct
83 struct evsel *leader; argument
93 struct evsel **metric_events; argument
94 struct evsel *metric_leader; argument
127 static inline struct perf_cpu_map *evsel__cpus(struct evsel *evsel) in evsel__cpus() argument
129 return perf_evsel__cpus(&evsel->core); in evsel__cpus()
132 static inline int perf_evsel__nr_cpus(struct evsel *evsel) in perf_evsel__nr_cpus() argument
134 return evsel__cpus(evsel)->nr; in perf_evsel__nr_cpus()
140 void perf_evsel__compute_deltas(struct evsel *evsel, int cpu, int thread,
144 int (*init)(struct evsel *evsel),
[all …]
Devsel.c59 static int perf_evsel__no_extra_init(struct evsel *evsel __maybe_unused) in perf_evsel__no_extra_init()
66 static void perf_evsel__no_extra_fini(struct evsel *evsel __maybe_unused) in perf_evsel__no_extra_fini()
72 int (*init)(struct evsel *evsel);
73 void (*fini)(struct evsel *evsel);
75 .size = sizeof(struct evsel),
81 int (*init)(struct evsel *evsel), in perf_evsel__object_config() argument
82 void (*fini)(struct evsel *evsel)) in perf_evsel__object_config() argument
181 void perf_evsel__calc_id_pos(struct evsel *evsel) in perf_evsel__calc_id_pos() argument
183 evsel->id_pos = __perf_evsel__calc_id_pos(evsel->core.attr.sample_type); in perf_evsel__calc_id_pos()
184 evsel->is_pos = __perf_evsel__calc_is_pos(evsel->core.attr.sample_type); in perf_evsel__calc_id_pos()
[all …]
Dstat.c78 bool __perf_evsel_stat__is(struct evsel *evsel, in __perf_evsel_stat__is() argument
81 struct perf_stat_evsel *ps = evsel->stats; in __perf_evsel_stat__is()
103 static void perf_stat_evsel_id_init(struct evsel *evsel) in perf_stat_evsel_id_init() argument
105 struct perf_stat_evsel *ps = evsel->stats; in perf_stat_evsel_id_init()
111 if (!strcmp(perf_evsel__name(evsel), id_str[i])) { in perf_stat_evsel_id_init()
118 static void perf_evsel__reset_stat_priv(struct evsel *evsel) in perf_evsel__reset_stat_priv() argument
121 struct perf_stat_evsel *ps = evsel->stats; in perf_evsel__reset_stat_priv()
126 perf_stat_evsel_id_init(evsel); in perf_evsel__reset_stat_priv()
129 static int perf_evsel__alloc_stat_priv(struct evsel *evsel) in perf_evsel__alloc_stat_priv() argument
131 evsel->stats = zalloc(sizeof(struct perf_stat_evsel)); in perf_evsel__alloc_stat_priv()
[all …]
Devlist.c108 struct evsel *first = evlist__first(evlist); in perf_evlist__set_id_pos()
116 struct evsel *evsel; in perf_evlist__update_id_pos() local
118 evlist__for_each_entry(evlist, evsel) in perf_evlist__update_id_pos()
119 perf_evsel__calc_id_pos(evsel); in perf_evlist__update_id_pos()
126 struct evsel *pos, *n; in evlist__purge()
160 void evlist__add(struct evlist *evlist, struct evsel *entry) in evlist__add()
172 void evlist__remove(struct evlist *evlist, struct evsel *evsel) in evlist__remove() argument
174 evsel->evlist = NULL; in evlist__remove()
175 perf_evlist__remove(&evlist->core, &evsel->core); in evlist__remove()
181 struct evsel *evsel, *temp; in perf_evlist__splice_list_tail() local
[all …]
Devlist.h65 struct evsel *selected;
92 void evlist__add(struct evlist *evlist, struct evsel *entry);
93 void evlist__remove(struct evlist *evlist, struct evsel *evsel);
136 struct evsel *
139 struct evsel *
148 struct evsel *perf_evlist__id2evsel(struct evlist *evlist, u64 id);
149 struct evsel *perf_evlist__id2evsel_strict(struct evlist *evlist,
201 struct evsel *evsel, int idx);
204 struct evsel *evsel);
207 int perf_evlist__apply_filters(struct evlist *evlist, struct evsel **err_evsel);
[all …]
Drecord.c16 typedef void (*setup_probe_fn_t)(struct evsel *evsel);
21 struct evsel *evsel; in perf_do_probe_api() local
33 evsel = evlist__first(evlist); in perf_do_probe_api()
36 fd = sys_perf_event_open(&evsel->core.attr, pid, cpu, -1, flags); in perf_do_probe_api()
48 fn(evsel); in perf_do_probe_api()
50 fd = sys_perf_event_open(&evsel->core.attr, pid, cpu, -1, flags); in perf_do_probe_api()
85 static void perf_probe_sample_identifier(struct evsel *evsel) in perf_probe_sample_identifier() argument
87 evsel->core.attr.sample_type |= PERF_SAMPLE_IDENTIFIER; in perf_probe_sample_identifier()
90 static void perf_probe_comm_exec(struct evsel *evsel) in perf_probe_comm_exec() argument
92 evsel->core.attr.comm_exec = 1; in perf_probe_comm_exec()
[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.c51 void perf_evsel__reset_counts(struct evsel *evsel) in perf_evsel__reset_counts() argument
53 perf_counts__reset(evsel->counts); in perf_evsel__reset_counts()
56 int perf_evsel__alloc_counts(struct evsel *evsel, int ncpus, int nthreads) in perf_evsel__alloc_counts() argument
58 evsel->counts = perf_counts__new(ncpus, nthreads); in perf_evsel__alloc_counts()
59 return evsel->counts != NULL ? 0 : -ENOMEM; in perf_evsel__alloc_counts()
62 void perf_evsel__free_counts(struct evsel *evsel) in perf_evsel__free_counts() argument
64 perf_counts__delete(evsel->counts); in perf_evsel__free_counts()
65 evsel->counts = NULL; in perf_evsel__free_counts()
Dstat-shadow.c28 struct evsel *evsel; member
61 if (a->evsel == NULL && b->evsel == NULL) { in saved_value_cmp()
71 if (a->evsel == b->evsel) in saved_value_cmp()
73 if ((char *)a->evsel < (char *)b->evsel) in saved_value_cmp()
99 static struct saved_value *saved_value_lookup(struct evsel *evsel, in saved_value_lookup() argument
110 .evsel = evsel, in saved_value_lookup()
151 static int evsel_context(struct evsel *evsel) in evsel_context() argument
155 if (evsel->core.attr.exclude_kernel) in evsel_context()
157 if (evsel->core.attr.exclude_user) in evsel_context()
159 if (evsel->core.attr.exclude_hv) in evsel_context()
[all …]
/tools/perf/tests/
Dparse-events.c49 struct evsel *evsel = evlist__first(evlist); in test__checkevent_tracepoint() local
53 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->core.attr.type); in test__checkevent_tracepoint()
55 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); in test__checkevent_tracepoint()
56 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->core.attr.sample_period); in test__checkevent_tracepoint()
62 struct evsel *evsel; in test__checkevent_tracepoint_multi() local
67 evlist__for_each_entry(evlist, evsel) { in test__checkevent_tracepoint_multi()
69 PERF_TYPE_TRACEPOINT == evsel->core.attr.type); in test__checkevent_tracepoint_multi()
71 PERF_TP_SAMPLE_TYPE == evsel->core.attr.sample_type); in test__checkevent_tracepoint_multi()
73 1 == evsel->core.attr.sample_period); in test__checkevent_tracepoint_multi()
80 struct evsel *evsel = evlist__first(evlist); in test__checkevent_raw() local
[all …]
Devsel-tp-sched.c8 static int perf_evsel__test_field(struct evsel *evsel, const char *name, in perf_evsel__test_field() argument
11 struct tep_format_field *field = perf_evsel__field(evsel, name); in perf_evsel__test_field()
16 pr_debug("%s: \"%s\" field not found!\n", evsel->name, name); in perf_evsel__test_field()
23 evsel->name, name, is_signed, should_be_signed); in perf_evsel__test_field()
29 evsel->name, name, field->size, size); in perf_evsel__test_field()
38 struct evsel *evsel = perf_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("perf_evsel__newtp failed with %ld\n", PTR_ERR(evsel)); in test__perf_evsel__tp_sched_test()
46 if (perf_evsel__test_field(evsel, "prev_comm", 16, false)) in test__perf_evsel__tp_sched_test()
49 if (perf_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 = perf_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 = perf_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 …]
Devsel-roundtrip-name.c14 struct evsel *evsel; in perf_evsel__roundtrip_cache_name_test() local
37 evsel = evlist__first(evlist); in perf_evsel__roundtrip_cache_name_test()
48 if (evsel->idx != idx) in perf_evsel__roundtrip_cache_name_test()
53 if (strcmp(perf_evsel__name(evsel), name)) { in perf_evsel__roundtrip_cache_name_test()
54 pr_debug("%s != %s\n", perf_evsel__name(evsel), name); in perf_evsel__roundtrip_cache_name_test()
58 evsel = perf_evsel__next(evsel); in perf_evsel__roundtrip_cache_name_test()
70 struct evsel *evsel; in __perf_evsel__name_array_test() local
86 evlist__for_each_entry(evlist, evsel) { in __perf_evsel__name_array_test()
87 if (strcmp(perf_evsel__name(evsel), names[evsel->idx])) { in __perf_evsel__name_array_test()
89 pr_debug("%s != %s\n", perf_evsel__name(evsel), names[evsel->idx]); in __perf_evsel__name_array_test()
Dopenat-syscall.c19 struct evsel *evsel; in test__openat_syscall_event() local
30 evsel = perf_evsel__newtp("syscalls", "sys_enter_openat"); in test__openat_syscall_event()
31 if (IS_ERR(evsel)) { in test__openat_syscall_event()
37 if (perf_evsel__open_per_thread(evsel, threads) < 0) { in test__openat_syscall_event()
49 if (perf_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()
Dopenat-syscall-all-cpus.c27 struct evsel *evsel; in test__openat_syscall_event_on_all_cpus() local
47 evsel = perf_evsel__newtp("syscalls", "sys_enter_openat"); in test__openat_syscall_event_on_all_cpus()
48 if (IS_ERR(evsel)) { in test__openat_syscall_event_on_all_cpus()
54 if (evsel__open(evsel, cpus, threads) < 0) { in test__openat_syscall_event_on_all_cpus()
93 if (perf_evsel__alloc_counts(evsel, cpus->nr, 1) < 0) { in test__openat_syscall_event_on_all_cpus()
106 if (perf_evsel__read_on_cpu(evsel, cpu, 0) < 0) { in test__openat_syscall_event_on_all_cpus()
113 if (perf_counts(evsel->counts, cpu, 0)->val != expected) { in test__openat_syscall_event_on_all_cpus()
115 expected, cpus->map[cpu], perf_counts(evsel->counts, cpu, 0)->val); in test__openat_syscall_event_on_all_cpus()
120 perf_evsel__free_counts(evsel); in test__openat_syscall_event_on_all_cpus()
122 perf_evsel__close_fd(&evsel->core); in test__openat_syscall_event_on_all_cpus()
[all …]
Devent_update.c89 struct evsel *evsel; in test__event_update() local
95 evsel = evlist__first(evlist); in test__event_update()
98 !perf_evsel__alloc_id(&evsel->core, 1, 1)); in test__event_update()
100 perf_evlist__id_add(&evlist->core, &evsel->core, 0, 0, 123); in test__event_update()
102 evsel->unit = strdup("KRAVA"); in test__event_update()
105 !perf_event__synthesize_event_update_unit(NULL, evsel, process_event_unit)); in test__event_update()
107 evsel->scale = 0.123; in test__event_update()
110 !perf_event__synthesize_event_update_scale(NULL, evsel, process_event_scale)); in test__event_update()
112 tmp.name = perf_evsel__name(evsel); in test__event_update()
115 !perf_event__synthesize_event_update_name(&tmp.tool, evsel, process_event_name)); in test__event_update()
[all …]
/tools/perf/lib/
Devsel.c19 void perf_evsel__init(struct perf_evsel *evsel, struct perf_event_attr *attr) in perf_evsel__init() argument
21 INIT_LIST_HEAD(&evsel->node); in perf_evsel__init()
22 evsel->attr = *attr; in perf_evsel__init()
27 struct perf_evsel *evsel = zalloc(sizeof(*evsel)); in perf_evsel__new() local
29 if (evsel != NULL) in perf_evsel__new()
30 perf_evsel__init(evsel, attr); in perf_evsel__new()
32 return evsel; in perf_evsel__new()
35 void perf_evsel__delete(struct perf_evsel *evsel) in perf_evsel__delete() argument
37 free(evsel); in perf_evsel__delete()
42 int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads) in perf_evsel__alloc_fd() argument
[all …]
Devlist.c33 struct perf_evsel *evsel) in __perf_evlist__propagate_maps() argument
39 if (!evsel->own_cpus || evlist->has_user_cpus) { in __perf_evlist__propagate_maps()
40 perf_cpu_map__put(evsel->cpus); in __perf_evlist__propagate_maps()
41 evsel->cpus = perf_cpu_map__get(evlist->cpus); in __perf_evlist__propagate_maps()
42 } else if (evsel->cpus != evsel->own_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(evsel->own_cpus); in __perf_evlist__propagate_maps()
47 perf_thread_map__put(evsel->threads); in __perf_evlist__propagate_maps()
48 evsel->threads = perf_thread_map__get(evlist->threads); in __perf_evlist__propagate_maps()
53 struct perf_evsel *evsel; in perf_evlist__propagate_maps() local
[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 = perf_evsel__intval(evsel, sample, "gpa"); in mmio_event_get_key()
35 key->info = perf_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 perf_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/perf/lib/tests/
Dtest-evsel.c19 struct perf_evsel *evsel; in test_stat_cpu() local
29 evsel = perf_evsel__new(&attr); in test_stat_cpu()
30 __T("failed to create evsel", evsel); in test_stat_cpu()
32 err = perf_evsel__open(evsel, cpus, NULL); in test_stat_cpu()
38 perf_evsel__read(evsel, cpu, 0, &counts); in test_stat_cpu()
42 perf_evsel__close(evsel); in test_stat_cpu()
43 perf_evsel__delete(evsel); in test_stat_cpu()
53 struct perf_evsel *evsel; in test_stat_thread() local
65 evsel = perf_evsel__new(&attr); in test_stat_thread()
66 __T("failed to create evsel", evsel); in test_stat_thread()
[all …]
Dtest-evlist.c21 struct perf_evsel *evsel; in test_stat_cpu() local
38 evsel = perf_evsel__new(&attr1); in test_stat_cpu()
39 __T("failed to create evsel1", evsel); in test_stat_cpu()
41 perf_evlist__add(evlist, evsel); in test_stat_cpu()
43 evsel = perf_evsel__new(&attr2); in test_stat_cpu()
44 __T("failed to create evsel2", evsel); in test_stat_cpu()
46 perf_evlist__add(evlist, evsel); in test_stat_cpu()
53 perf_evlist__for_each_evsel(evlist, evsel) { in test_stat_cpu()
54 cpus = perf_evsel__cpus(evsel); in test_stat_cpu()
59 perf_evsel__read(evsel, cpu, 0, &counts); in test_stat_cpu()
[all …]
/tools/perf/lib/include/perf/
Devsel.h24 LIBPERF_API void perf_evsel__init(struct perf_evsel *evsel,
27 LIBPERF_API void perf_evsel__delete(struct perf_evsel *evsel);
28 LIBPERF_API int perf_evsel__open(struct perf_evsel *evsel, struct perf_cpu_map *cpus,
30 LIBPERF_API void perf_evsel__close(struct perf_evsel *evsel);
31 LIBPERF_API int perf_evsel__read(struct perf_evsel *evsel, int cpu, int thread,
33 LIBPERF_API int perf_evsel__enable(struct perf_evsel *evsel);
34 LIBPERF_API int perf_evsel__disable(struct perf_evsel *evsel);
35 LIBPERF_API struct perf_cpu_map *perf_evsel__cpus(struct perf_evsel *evsel);
36 LIBPERF_API struct perf_thread_map *perf_evsel__threads(struct perf_evsel *evsel);
37 LIBPERF_API struct perf_event_attr *perf_evsel__attr(struct perf_evsel *evsel);
/tools/perf/arch/s390/util/
Dkvm-stat.c27 static void event_icpt_insn_get_key(struct evsel *evsel, in event_icpt_insn_get_key() argument
33 insn = perf_evsel__intval(evsel, sample, "instruction"); in event_icpt_insn_get_key()
38 static void event_sigp_get_key(struct evsel *evsel, in event_sigp_get_key() argument
42 key->key = perf_evsel__intval(evsel, sample, "order_code"); in event_sigp_get_key()
46 static void event_diag_get_key(struct evsel *evsel, in event_diag_get_key() argument
50 key->key = perf_evsel__intval(evsel, sample, "code"); in event_diag_get_key()
54 static void event_icpt_prog_get_key(struct evsel *evsel, in event_icpt_prog_get_key() argument
58 key->key = perf_evsel__intval(evsel, sample, "code"); in event_icpt_prog_get_key()
/tools/perf/lib/include/internal/
Devlist.h36 #define __perf_evlist__for_each_entry(list, evsel) \ argument
37 list_for_each_entry(evsel, list, node)
44 #define perf_evlist__for_each_entry(evlist, evsel) \ argument
45 __perf_evlist__for_each_entry(&(evlist)->entries, evsel)
52 #define __perf_evlist__for_each_entry_reverse(list, evsel) \ argument
53 list_for_each_entry_reverse(evsel, list, node)
60 #define perf_evlist__for_each_entry_reverse(evlist, evsel) \ argument
61 __perf_evlist__for_each_entry_reverse(&(evlist)->entries, evsel)
76 struct perf_evsel *evsel,
80 struct perf_evsel *evsel,
Devsel.h21 struct perf_evsel *evsel; member
53 int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads);
54 void perf_evsel__close_fd(struct perf_evsel *evsel);
55 void perf_evsel__free_fd(struct perf_evsel *evsel);
56 int perf_evsel__read_size(struct perf_evsel *evsel);
57 int perf_evsel__apply_filter(struct perf_evsel *evsel, const char *filter);
59 int perf_evsel__alloc_id(struct perf_evsel *evsel, int ncpus, int nthreads);
60 void perf_evsel__free_id(struct perf_evsel *evsel);

123456