Home
last modified time | relevance | path

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

123

/tools/perf/tests/
Dparse-events.c16 struct perf_evsel *evsel = perf_evlist__first(evlist); in test__checkevent_tracepoint() local
20 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); in test__checkevent_tracepoint()
22 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); in test__checkevent_tracepoint()
23 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); in test__checkevent_tracepoint()
29 struct perf_evsel *evsel; in test__checkevent_tracepoint_multi() local
34 evlist__for_each(evlist, evsel) { in test__checkevent_tracepoint_multi()
36 PERF_TYPE_TRACEPOINT == evsel->attr.type); in test__checkevent_tracepoint_multi()
38 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); in test__checkevent_tracepoint_multi()
40 1 == evsel->attr.sample_period); in test__checkevent_tracepoint_multi()
47 struct perf_evsel *evsel = perf_evlist__first(evlist); in test__checkevent_raw() local
[all …]
Devsel-tp-sched.c6 static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name, in perf_evsel__test_field() argument
9 struct format_field *field = perf_evsel__field(evsel, name); in perf_evsel__test_field()
14 pr_debug("%s: \"%s\" field not found!\n", evsel->name, name); in perf_evsel__test_field()
21 evsel->name, name, is_signed, should_be_signed); in perf_evsel__test_field()
27 evsel->name, name, field->size, size); in perf_evsel__test_field()
36 struct perf_evsel *evsel = perf_evsel__newtp("sched", "sched_switch"); in test__perf_evsel__tp_sched_test() local
39 if (evsel == NULL) { in test__perf_evsel__tp_sched_test()
44 if (perf_evsel__test_field(evsel, "prev_comm", 16, true)) in test__perf_evsel__tp_sched_test()
47 if (perf_evsel__test_field(evsel, "prev_pid", 4, true)) in test__perf_evsel__tp_sched_test()
50 if (perf_evsel__test_field(evsel, "prev_prio", 4, true)) in test__perf_evsel__tp_sched_test()
[all …]
Dopen-syscall.c9 struct perf_evsel *evsel; in test__open_syscall_event() local
19 evsel = perf_evsel__newtp("syscalls", "sys_enter_open"); in test__open_syscall_event()
20 if (evsel == NULL) { in test__open_syscall_event()
25 if (perf_evsel__open_per_thread(evsel, threads) < 0) { in test__open_syscall_event()
37 if (perf_evsel__read_on_cpu(evsel, 0, 0) < 0) { in test__open_syscall_event()
42 if (evsel->counts->cpu[0].val != nr_open_calls) { in test__open_syscall_event()
44 nr_open_calls, evsel->counts->cpu[0].val); in test__open_syscall_event()
50 perf_evsel__close_fd(evsel, 1, threads->nr); in test__open_syscall_event()
52 perf_evsel__delete(evsel); in test__open_syscall_event()
Devsel-roundtrip-name.c11 struct perf_evsel *evsel; in perf_evsel__roundtrip_cache_name_test() local
34 evsel = perf_evlist__first(evlist); in perf_evsel__roundtrip_cache_name_test()
45 if (evsel->idx != idx) in perf_evsel__roundtrip_cache_name_test()
50 if (strcmp(perf_evsel__name(evsel), name)) { in perf_evsel__roundtrip_cache_name_test()
51 pr_debug("%s != %s\n", perf_evsel__name(evsel), name); in perf_evsel__roundtrip_cache_name_test()
55 evsel = perf_evsel__next(evsel); in perf_evsel__roundtrip_cache_name_test()
67 struct perf_evsel *evsel; in __perf_evsel__name_array_test() local
83 evlist__for_each(evlist, evsel) { in __perf_evsel__name_array_test()
84 if (strcmp(perf_evsel__name(evsel), names[evsel->idx])) { in __perf_evsel__name_array_test()
86 pr_debug("%s != %s\n", perf_evsel__name(evsel), names[evsel->idx]); in __perf_evsel__name_array_test()
Dopen-syscall-all-cpus.c11 struct perf_evsel *evsel; in test__open_syscall_event_on_all_cpus() local
30 evsel = perf_evsel__newtp("syscalls", "sys_enter_open"); in test__open_syscall_event_on_all_cpus()
31 if (evsel == NULL) { in test__open_syscall_event_on_all_cpus()
36 if (perf_evsel__open(evsel, cpus, threads) < 0) { in test__open_syscall_event_on_all_cpus()
75 if (perf_evsel__alloc_counts(evsel, cpus->nr) < 0) { in test__open_syscall_event_on_all_cpus()
88 if (perf_evsel__read_on_cpu(evsel, cpu, 0) < 0) { in test__open_syscall_event_on_all_cpus()
95 if (evsel->counts->cpu[cpu].val != expected) { in test__open_syscall_event_on_all_cpus()
97 expected, cpus->map[cpu], evsel->counts->cpu[cpu].val); in test__open_syscall_event_on_all_cpus()
102 perf_evsel__free_counts(evsel); in test__open_syscall_event_on_all_cpus()
104 perf_evsel__close_fd(evsel, 1, threads->nr); in test__open_syscall_event_on_all_cpus()
[all …]
Dtask-exit.c38 struct perf_evsel *evsel; in test__task_exit() local
76 evsel = perf_evlist__first(evlist); in test__task_exit()
77 evsel->attr.task = 1; in test__task_exit()
78 evsel->attr.sample_freq = 0; in test__task_exit()
79 evsel->attr.inherit = 0; in test__task_exit()
80 evsel->attr.watermark = 0; in test__task_exit()
81 evsel->attr.wakeup_events = 1; in test__task_exit()
82 evsel->attr.exclude_kernel = 1; in test__task_exit()
Dmmap-basic.c33 struct perf_evsel *evsels[nsyscalls], *evsel; in test__basic_mmap() local
119 evsel = perf_evlist__id2evsel(evlist, sample.id); in test__basic_mmap()
120 if (evsel == NULL) { in test__basic_mmap()
125 nr_events[evsel->idx]++; in test__basic_mmap()
130 evlist__for_each(evlist, evsel) { in test__basic_mmap()
131 if (nr_events[evsel->idx] != expected_nr_events[evsel->idx]) { in test__basic_mmap()
133 expected_nr_events[evsel->idx], in test__basic_mmap()
134 perf_evsel__name(evsel), nr_events[evsel->idx]); in test__basic_mmap()
Dopen-syscall-tp-fields.c23 struct perf_evsel *evsel; in test__syscall_open_tp_fields() local
32 evsel = perf_evsel__newtp("syscalls", "sys_enter_open"); in test__syscall_open_tp_fields()
33 if (evsel == NULL) { in test__syscall_open_tp_fields()
38 perf_evlist__add(evlist, evsel); in test__syscall_open_tp_fields()
46 perf_evsel__config(evsel, &opts); in test__syscall_open_tp_fields()
89 err = perf_evsel__parse_sample(evsel, event, &sample); in test__syscall_open_tp_fields()
95 tp_flags = perf_evsel__intval(evsel, &sample, "flags"); in test__syscall_open_tp_fields()
Dkeep-tracking.c66 struct perf_evsel *evsel = NULL; in test__keep_tracking() local
86 evsel = perf_evlist__first(evlist); in test__keep_tracking()
88 evsel->attr.comm = 1; in test__keep_tracking()
89 evsel->attr.disabled = 1; in test__keep_tracking()
90 evsel->attr.enable_on_exec = 0; in test__keep_tracking()
125 evsel = perf_evlist__last(evlist); in test__keep_tracking()
127 CHECK__(perf_evlist__disable_event(evlist, evsel)); in test__keep_tracking()
/tools/perf/util/
Devsel.h38 struct perf_evsel *evsel; member
109 int (*init)(struct perf_evsel *evsel),
110 void (*fini)(struct perf_evsel *evsel));
128 void perf_evsel__init(struct perf_evsel *evsel,
130 void perf_evsel__exit(struct perf_evsel *evsel);
131 void perf_evsel__delete(struct perf_evsel *evsel);
133 void perf_evsel__config(struct perf_evsel *evsel,
137 void perf_evsel__calc_id_pos(struct perf_evsel *evsel);
153 const char *perf_evsel__name(struct perf_evsel *evsel);
155 const char *perf_evsel__group_name(struct perf_evsel *evsel);
[all …]
Devsel.c37 static int perf_evsel__no_extra_init(struct perf_evsel *evsel __maybe_unused) in perf_evsel__no_extra_init()
42 static void perf_evsel__no_extra_fini(struct perf_evsel *evsel __maybe_unused) in perf_evsel__no_extra_fini()
48 int (*init)(struct perf_evsel *evsel);
49 void (*fini)(struct perf_evsel *evsel);
57 int (*init)(struct perf_evsel *evsel), in perf_evsel__object_config() argument
58 void (*fini)(struct perf_evsel *evsel)) in perf_evsel__object_config() argument
157 void perf_evsel__calc_id_pos(struct perf_evsel *evsel) in perf_evsel__calc_id_pos() argument
159 evsel->id_pos = __perf_evsel__calc_id_pos(evsel->attr.sample_type); in perf_evsel__calc_id_pos()
160 evsel->is_pos = __perf_evsel__calc_is_pos(evsel->attr.sample_type); in perf_evsel__calc_id_pos()
163 void __perf_evsel__set_sample_bit(struct perf_evsel *evsel, in __perf_evsel__set_sample_bit() argument
[all …]
Drecord.c9 typedef void (*setup_probe_fn_t)(struct perf_evsel *evsel);
14 struct perf_evsel *evsel; in perf_do_probe_api() local
26 evsel = perf_evlist__first(evlist); in perf_do_probe_api()
29 fd = sys_perf_event_open(&evsel->attr, pid, cpu, -1, flags); in perf_do_probe_api()
41 fn(evsel); in perf_do_probe_api()
43 fd = sys_perf_event_open(&evsel->attr, pid, cpu, -1, flags); in perf_do_probe_api()
78 static void perf_probe_sample_identifier(struct perf_evsel *evsel) in perf_probe_sample_identifier() argument
80 evsel->attr.sample_type |= PERF_SAMPLE_IDENTIFIER; in perf_probe_sample_identifier()
83 static void perf_probe_comm_exec(struct perf_evsel *evsel) in perf_probe_comm_exec() argument
85 evsel->attr.comm_exec = 1; in perf_probe_comm_exec()
[all …]
Devlist.c86 struct perf_evsel *evsel; in perf_evlist__update_id_pos() local
88 evlist__for_each(evlist, evsel) in perf_evlist__update_id_pos()
89 perf_evsel__calc_id_pos(evsel); in perf_evlist__update_id_pos()
149 struct perf_evsel *evsel, *leader; in __perf_evlist__set_leader() local
152 evsel = list_entry(list->prev, struct perf_evsel, node); in __perf_evlist__set_leader()
154 leader->nr_members = evsel->idx - leader->idx + 1; in __perf_evlist__set_leader()
156 __evlist__for_each(list, evsel) { in __perf_evlist__set_leader()
157 evsel->leader = leader; in __perf_evlist__set_leader()
175 struct perf_evsel *evsel; in perf_evlist__add_default() local
179 evsel = perf_evsel__new(&attr); in perf_evlist__add_default()
[all …]
Devlist.h88 void perf_evlist__id_add(struct perf_evlist *evlist, struct perf_evsel *evsel,
134 struct perf_evsel *evsel);
136 struct perf_evsel *evsel);
138 struct perf_evsel *evsel, int idx);
141 struct perf_evsel *evsel);
218 #define __evlist__for_each(list, evsel) \ argument
219 list_for_each_entry(evsel, list, node)
226 #define evlist__for_each(evlist, evsel) \ argument
227 __evlist__for_each(&(evlist)->entries, evsel)
234 #define __evlist__for_each_continue(list, evsel) \ argument
[all …]
Dkvm-stat.h46 void (*get_key)(struct perf_evsel *evsel,
53 bool (*is_begin_event)(struct perf_evsel *evsel,
56 bool (*is_end_event)(struct perf_evsel *evsel,
109 void exit_event_get_key(struct perf_evsel *evsel,
112 bool exit_event_begin(struct perf_evsel *evsel,
115 bool exit_event_end(struct perf_evsel *evsel,
122 bool kvm_exit_event(struct perf_evsel *evsel);
123 bool kvm_entry_event(struct perf_evsel *evsel);
Dparse-events.c287 struct perf_evsel *evsel; in __add_event() local
291 evsel = perf_evsel__new_idx(attr, (*idx)++); in __add_event()
292 if (!evsel) in __add_event()
295 evsel->cpus = cpus; in __add_event()
297 evsel->name = strdup(name); in __add_event()
298 list_add_tail(&evsel->node, list); in __add_event()
299 return evsel; in __add_event()
390 struct perf_evsel *evsel; in add_tracepoint() local
392 evsel = perf_evsel__newtp_idx(sys_name, evt_name, (*idx)++); in add_tracepoint()
393 if (!evsel) in add_tracepoint()
[all …]
Dheader.c685 struct perf_evsel *evsel; in write_event_desc() local
701 sz = (u32)sizeof(evsel->attr); in write_event_desc()
706 evlist__for_each(evlist, evsel) { in write_event_desc()
707 ret = do_write(fd, &evsel->attr, sz); in write_event_desc()
717 nri = evsel->ids; in write_event_desc()
725 ret = do_write_string(fd, perf_evsel__name(evsel)); in write_event_desc()
731 ret = do_write(fd, evsel->id, evsel->ids * sizeof(u64)); in write_event_desc()
1147 struct perf_evsel *evsel; in write_group_desc() local
1154 evlist__for_each(evlist, evsel) { in write_group_desc()
1155 if (perf_evsel__is_group_leader(evsel) && in write_group_desc()
[all …]
/tools/perf/arch/x86/util/
Dkvm-stat.c19 static void mmio_event_get_key(struct perf_evsel *evsel, struct perf_sample *sample, in mmio_event_get_key() argument
22 key->key = perf_evsel__intval(evsel, sample, "gpa"); in mmio_event_get_key()
23 key->info = perf_evsel__intval(evsel, sample, "type"); in mmio_event_get_key()
30 static bool mmio_event_begin(struct perf_evsel *evsel, in mmio_event_begin() argument
34 if (kvm_exit_event(evsel)) in mmio_event_begin()
38 if (!strcmp(evsel->name, "kvm:kvm_mmio") && in mmio_event_begin()
39 perf_evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_WRITE) { in mmio_event_begin()
40 mmio_event_get_key(evsel, sample, key); in mmio_event_begin()
47 static bool mmio_event_end(struct perf_evsel *evsel, struct perf_sample *sample, in mmio_event_end() argument
51 if (kvm_entry_event(evsel)) in mmio_event_end()
[all …]
/tools/perf/
Dbuiltin-stat.c166 static inline struct cpu_map *perf_evsel__cpus(struct perf_evsel *evsel) in perf_evsel__cpus() argument
168 return (evsel->cpus && !target.cpu_list) ? evsel->cpus : evsel_list->cpus; in perf_evsel__cpus()
171 static inline int perf_evsel__nr_cpus(struct perf_evsel *evsel) in perf_evsel__nr_cpus() argument
173 return perf_evsel__cpus(evsel)->nr; in perf_evsel__nr_cpus()
176 static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) in perf_evsel__reset_stat_priv() argument
179 struct perf_stat *ps = evsel->priv; in perf_evsel__reset_stat_priv()
185 static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel) in perf_evsel__alloc_stat_priv() argument
187 evsel->priv = zalloc(sizeof(struct perf_stat)); in perf_evsel__alloc_stat_priv()
188 if (evsel->priv == NULL) in perf_evsel__alloc_stat_priv()
190 perf_evsel__reset_stat_priv(evsel); in perf_evsel__alloc_stat_priv()
[all …]
Dbuiltin-inject.c93 struct perf_evsel *evsel,
99 struct perf_evsel *evsel, in perf_event__repipe_sample() argument
102 if (evsel->handler) { in perf_event__repipe_sample()
103 inject_handler f = evsel->handler; in perf_event__repipe_sample()
104 return f(tool, event, sample, evsel, machine); in perf_event__repipe_sample()
107 build_id__mark_dso_hit(tool, event, sample, evsel, machine); in perf_event__repipe_sample()
204 struct perf_evsel *evsel __maybe_unused, in perf_event__inject_buildid()
250 struct perf_evsel *evsel __maybe_unused, in perf_inject__sched_process_exit()
270 struct perf_evsel *evsel, in perf_inject__sched_switch() argument
276 perf_inject__sched_process_exit(tool, event, sample, evsel, machine); in perf_inject__sched_switch()
[all …]
Dbuiltin-script.c150 static int perf_evsel__check_stype(struct perf_evsel *evsel, in perf_evsel__check_stype() argument
154 struct perf_event_attr *attr = &evsel->attr; in perf_evsel__check_stype()
162 evname = perf_evsel__name(evsel); in perf_evsel__check_stype()
171 evname = perf_evsel__name(evsel); in perf_evsel__check_stype()
179 static int perf_evsel__check_attr(struct perf_evsel *evsel, in perf_evsel__check_attr() argument
182 struct perf_event_attr *attr = &evsel->attr; in perf_evsel__check_attr()
189 if (perf_evsel__check_stype(evsel, PERF_SAMPLE_IP, "IP", in perf_evsel__check_attr()
195 perf_evsel__check_stype(evsel, PERF_SAMPLE_ADDR, "ADDR", in perf_evsel__check_attr()
223 perf_evsel__check_stype(evsel, PERF_SAMPLE_TID, "TID", in perf_evsel__check_attr()
228 perf_evsel__check_stype(evsel, PERF_SAMPLE_TIME, "TIME", in perf_evsel__check_attr()
[all …]
Dbuiltin-trace.c119 static int perf_evsel__init_tp_uint_field(struct perf_evsel *evsel, in perf_evsel__init_tp_uint_field() argument
123 struct format_field *format_field = perf_evsel__field(evsel, name); in perf_evsel__init_tp_uint_field()
128 return tp_field__init_uint(field, format_field, evsel->needs_swap); in perf_evsel__init_tp_uint_field()
131 #define perf_evsel__init_sc_tp_uint_field(evsel, name) \ argument
132 ({ struct syscall_tp *sc = evsel->priv;\
133 perf_evsel__init_tp_uint_field(evsel, &sc->name, #name); })
135 static int perf_evsel__init_tp_ptr_field(struct perf_evsel *evsel, in perf_evsel__init_tp_ptr_field() argument
139 struct format_field *format_field = perf_evsel__field(evsel, name); in perf_evsel__init_tp_ptr_field()
147 #define perf_evsel__init_sc_tp_ptr_field(evsel, name) \ argument
148 ({ struct syscall_tp *sc = evsel->priv;\
[all …]
Dbuiltin-lock.c346 int (*acquire_event)(struct perf_evsel *evsel,
349 int (*acquired_event)(struct perf_evsel *evsel,
352 int (*contended_event)(struct perf_evsel *evsel,
355 int (*release_event)(struct perf_evsel *evsel,
395 static int report_lock_acquire_event(struct perf_evsel *evsel, in report_lock_acquire_event() argument
402 const char *name = perf_evsel__strval(evsel, sample, "name"); in report_lock_acquire_event()
403 u64 tmp = perf_evsel__intval(evsel, sample, "lockdep_addr"); in report_lock_acquire_event()
404 int flag = perf_evsel__intval(evsel, sample, "flag"); in report_lock_acquire_event()
467 static int report_lock_acquired_event(struct perf_evsel *evsel, in report_lock_acquired_event() argument
475 const char *name = perf_evsel__strval(evsel, sample, "name"); in report_lock_acquired_event()
[all …]
/tools/perf/arch/s390/util/
Dkvm-stat.c21 static void event_icpt_insn_get_key(struct perf_evsel *evsel, in event_icpt_insn_get_key() argument
27 insn = perf_evsel__intval(evsel, sample, "instruction"); in event_icpt_insn_get_key()
32 static void event_sigp_get_key(struct perf_evsel *evsel, in event_sigp_get_key() argument
36 key->key = perf_evsel__intval(evsel, sample, "order_code"); in event_sigp_get_key()
40 static void event_diag_get_key(struct perf_evsel *evsel, in event_diag_get_key() argument
44 key->key = perf_evsel__intval(evsel, sample, "code"); in event_diag_get_key()
48 static void event_icpt_prog_get_key(struct perf_evsel *evsel, in event_icpt_prog_get_key() argument
52 key->key = perf_evsel__intval(evsel, sample, "code"); in event_icpt_prog_get_key()
/tools/perf/python/
Dtwatch.py21 evsel = perf.evsel(task = 1, comm = 1, mmap = 0,
25 evsel.open(cpus = cpus, threads = threads);
27 evlist.add(evsel)

123