/tools/perf/tests/ |
D | parse-events.c | 17 struct perf_evsel *evsel = perf_evlist__first(evlist); in test__checkevent_tracepoint() local 21 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); in test__checkevent_tracepoint() 23 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); in test__checkevent_tracepoint() 24 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); in test__checkevent_tracepoint() 30 struct perf_evsel *evsel; in test__checkevent_tracepoint_multi() local 35 evlist__for_each_entry(evlist, evsel) { in test__checkevent_tracepoint_multi() 37 PERF_TYPE_TRACEPOINT == evsel->attr.type); in test__checkevent_tracepoint_multi() 39 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); in test__checkevent_tracepoint_multi() 41 1 == evsel->attr.sample_period); in test__checkevent_tracepoint_multi() 48 struct perf_evsel *evsel = perf_evlist__first(evlist); in test__checkevent_raw() local [all …]
|
D | evsel-tp-sched.c | 7 static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name, in perf_evsel__test_field() argument 10 struct format_field *field = perf_evsel__field(evsel, name); in perf_evsel__test_field() 15 pr_debug("%s: \"%s\" field not found!\n", evsel->name, name); in perf_evsel__test_field() 22 evsel->name, name, is_signed, should_be_signed); in perf_evsel__test_field() 28 evsel->name, name, field->size, size); in perf_evsel__test_field() 37 struct perf_evsel *evsel = perf_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("perf_evsel__newtp failed with %ld\n", PTR_ERR(evsel)); in test__perf_evsel__tp_sched_test() 45 if (perf_evsel__test_field(evsel, "prev_comm", 16, true)) in test__perf_evsel__tp_sched_test() 48 if (perf_evsel__test_field(evsel, "prev_pid", 4, true)) in test__perf_evsel__tp_sched_test() [all …]
|
D | event-times.c | 13 struct perf_evsel *evsel = perf_evlist__last(evlist); in attach__enable_on_exec() local 35 evsel->attr.enable_on_exec = 1; in attach__enable_on_exec() 55 struct perf_evsel *evsel = perf_evlist__last(evlist); in attach__current_disabled() local 67 evsel->attr.disabled = 1; in attach__current_disabled() 69 err = perf_evsel__open_per_thread(evsel, threads); in attach__current_disabled() 76 return perf_evsel__enable(evsel) == 0 ? TEST_OK : TEST_FAIL; in attach__current_disabled() 81 struct perf_evsel *evsel = perf_evlist__last(evlist); in attach__current_enabled() local 93 err = perf_evsel__open_per_thread(evsel, threads); in attach__current_enabled() 101 struct perf_evsel *evsel = perf_evlist__last(evlist); in detach__disable() local 103 return perf_evsel__enable(evsel); in detach__disable() [all …]
|
D | openat-syscall.c | 11 struct perf_evsel *evsel; in test__openat_syscall_event() local 22 evsel = perf_evsel__newtp("syscalls", "sys_enter_openat"); in test__openat_syscall_event() 23 if (IS_ERR(evsel)) { in test__openat_syscall_event() 29 if (perf_evsel__open_per_thread(evsel, threads) < 0) { in test__openat_syscall_event() 41 if (perf_evsel__read_on_cpu(evsel, 0, 0) < 0) { in test__openat_syscall_event() 46 if (perf_counts(evsel->counts, 0, 0)->val != nr_openat_calls) { in test__openat_syscall_event() 48 nr_openat_calls, perf_counts(evsel->counts, 0, 0)->val); in test__openat_syscall_event() 54 perf_evsel__close_fd(evsel, 1, threads->nr); in test__openat_syscall_event() 56 perf_evsel__delete(evsel); in test__openat_syscall_event()
|
D | evsel-roundtrip-name.c | 11 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_entry(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()
|
D | openat-syscall-all-cpus.c | 17 struct perf_evsel *evsel; in test__openat_syscall_event_on_all_cpus() local 37 evsel = perf_evsel__newtp("syscalls", "sys_enter_openat"); in test__openat_syscall_event_on_all_cpus() 38 if (IS_ERR(evsel)) { in test__openat_syscall_event_on_all_cpus() 44 if (perf_evsel__open(evsel, cpus, threads) < 0) { in test__openat_syscall_event_on_all_cpus() 83 if (perf_evsel__alloc_counts(evsel, cpus->nr, 1) < 0) { in test__openat_syscall_event_on_all_cpus() 96 if (perf_evsel__read_on_cpu(evsel, cpu, 0) < 0) { in test__openat_syscall_event_on_all_cpus() 103 if (perf_counts(evsel->counts, cpu, 0)->val != expected) { in test__openat_syscall_event_on_all_cpus() 105 expected, cpus->map[cpu], perf_counts(evsel->counts, cpu, 0)->val); in test__openat_syscall_event_on_all_cpus() 110 perf_evsel__free_counts(evsel); in test__openat_syscall_event_on_all_cpus() 112 perf_evsel__close_fd(evsel, 1, threads->nr); in test__openat_syscall_event_on_all_cpus() [all …]
|
D | event_update.c | 82 struct perf_evsel *evsel; in test__event_update() local 88 evsel = perf_evlist__first(evlist); in test__event_update() 91 !perf_evsel__alloc_id(evsel, 1, 1)); in test__event_update() 93 perf_evlist__id_add(evlist, evsel, 0, 0, 123); in test__event_update() 95 evsel->unit = strdup("KRAVA"); in test__event_update() 98 !perf_event__synthesize_event_update_unit(NULL, evsel, process_event_unit)); in test__event_update() 100 evsel->scale = 0.123; in test__event_update() 103 !perf_event__synthesize_event_update_scale(NULL, evsel, process_event_scale)); in test__event_update() 105 tmp.name = perf_evsel__name(evsel); in test__event_update() 108 !perf_event__synthesize_event_update_name(&tmp.tool, evsel, process_event_name)); in test__event_update() [all …]
|
D | task-exit.c | 38 struct perf_evsel *evsel; in test__task_exit() local 83 evsel = perf_evlist__first(evlist); in test__task_exit() 84 evsel->attr.task = 1; in test__task_exit() 85 evsel->attr.sample_freq = 0; in test__task_exit() 86 evsel->attr.inherit = 0; in test__task_exit() 87 evsel->attr.watermark = 0; in test__task_exit() 88 evsel->attr.wakeup_events = 1; in test__task_exit() 89 evsel->attr.exclude_kernel = 1; in test__task_exit()
|
D | mmap-basic.c | 35 struct perf_evsel *evsels[nsyscalls], *evsel; in test__basic_mmap() local 121 evsel = perf_evlist__id2evsel(evlist, sample.id); in test__basic_mmap() 122 if (evsel == NULL) { in test__basic_mmap() 127 nr_events[evsel->idx]++; in test__basic_mmap() 132 evlist__for_each_entry(evlist, evsel) { in test__basic_mmap() 133 if (nr_events[evsel->idx] != expected_nr_events[evsel->idx]) { in test__basic_mmap() 135 expected_nr_events[evsel->idx], in test__basic_mmap() 136 perf_evsel__name(evsel), nr_events[evsel->idx]); in test__basic_mmap()
|
D | openat-syscall-tp-fields.c | 31 struct perf_evsel *evsel; in test__syscall_openat_tp_fields() local 40 evsel = perf_evsel__newtp("syscalls", "sys_enter_openat"); in test__syscall_openat_tp_fields() 41 if (IS_ERR(evsel)) { in test__syscall_openat_tp_fields() 46 perf_evlist__add(evlist, evsel); in test__syscall_openat_tp_fields() 54 perf_evsel__config(evsel, &opts, NULL); in test__syscall_openat_tp_fields() 97 err = perf_evsel__parse_sample(evsel, event, &sample); in test__syscall_openat_tp_fields() 103 tp_flags = perf_evsel__intval(evsel, &sample, "flags"); in test__syscall_openat_tp_fields()
|
D | keep-tracking.c | 65 struct perf_evsel *evsel = NULL; in test__keep_tracking() local 85 evsel = perf_evlist__first(evlist); in test__keep_tracking() 87 evsel->attr.comm = 1; in test__keep_tracking() 88 evsel->attr.disabled = 1; in test__keep_tracking() 89 evsel->attr.enable_on_exec = 0; in test__keep_tracking() 124 evsel = perf_evlist__last(evlist); in test__keep_tracking() 126 CHECK__(perf_evsel__disable(evsel)); in test__keep_tracking()
|
/tools/perf/util/ |
D | evsel.h | 23 struct perf_evsel *evsel; member 143 static inline struct cpu_map *perf_evsel__cpus(struct perf_evsel *evsel) in perf_evsel__cpus() argument 145 return evsel->cpus; in perf_evsel__cpus() 148 static inline int perf_evsel__nr_cpus(struct perf_evsel *evsel) in perf_evsel__nr_cpus() argument 150 return perf_evsel__cpus(evsel)->nr; in perf_evsel__nr_cpus() 156 void perf_evsel__compute_deltas(struct perf_evsel *evsel, int cpu, int thread, 160 int (*init)(struct perf_evsel *evsel), 161 void (*fini)(struct perf_evsel *evsel)); 184 void perf_evsel__init(struct perf_evsel *evsel, 186 void perf_evsel__exit(struct perf_evsel *evsel); [all …]
|
D | evsel.c | 45 static int perf_evsel__no_extra_init(struct perf_evsel *evsel __maybe_unused) in perf_evsel__no_extra_init() 50 static void perf_evsel__no_extra_fini(struct perf_evsel *evsel __maybe_unused) in perf_evsel__no_extra_fini() 56 int (*init)(struct perf_evsel *evsel); 57 void (*fini)(struct perf_evsel *evsel); 65 int (*init)(struct perf_evsel *evsel), in perf_evsel__object_config() argument 66 void (*fini)(struct perf_evsel *evsel)) in perf_evsel__object_config() argument 165 void perf_evsel__calc_id_pos(struct perf_evsel *evsel) in perf_evsel__calc_id_pos() argument 167 evsel->id_pos = __perf_evsel__calc_id_pos(evsel->attr.sample_type); in perf_evsel__calc_id_pos() 168 evsel->is_pos = __perf_evsel__calc_is_pos(evsel->attr.sample_type); in perf_evsel__calc_id_pos() 171 void __perf_evsel__set_sample_bit(struct perf_evsel *evsel, in __perf_evsel__set_sample_bit() argument [all …]
|
D | record.c | 9 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 …]
|
D | stat.c | 67 bool __perf_evsel_stat__is(struct perf_evsel *evsel, in __perf_evsel_stat__is() argument 70 struct perf_stat_evsel *ps = evsel->priv; in __perf_evsel_stat__is() 90 void perf_stat_evsel_id_init(struct perf_evsel *evsel) in perf_stat_evsel_id_init() argument 92 struct perf_stat_evsel *ps = evsel->priv; in perf_stat_evsel_id_init() 98 if (!strcmp(perf_evsel__name(evsel), id_str[i])) { in perf_stat_evsel_id_init() 105 static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) in perf_evsel__reset_stat_priv() argument 108 struct perf_stat_evsel *ps = evsel->priv; in perf_evsel__reset_stat_priv() 113 perf_stat_evsel_id_init(evsel); in perf_evsel__reset_stat_priv() 116 static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel) in perf_evsel__alloc_stat_priv() argument 118 evsel->priv = zalloc(sizeof(struct perf_stat_evsel)); in perf_evsel__alloc_stat_priv() [all …]
|
D | evlist.c | 102 struct perf_evsel *evsel; in perf_evlist__update_id_pos() local 104 evlist__for_each_entry(evlist, evsel) in perf_evlist__update_id_pos() 105 perf_evsel__calc_id_pos(evsel); in perf_evlist__update_id_pos() 147 struct perf_evsel *evsel) in __perf_evlist__propagate_maps() argument 153 if (!evsel->own_cpus || evlist->has_user_cpus) { in __perf_evlist__propagate_maps() 154 cpu_map__put(evsel->cpus); in __perf_evlist__propagate_maps() 155 evsel->cpus = cpu_map__get(evlist->cpus); in __perf_evlist__propagate_maps() 156 } else if (evsel->cpus != evsel->own_cpus) { in __perf_evlist__propagate_maps() 157 cpu_map__put(evsel->cpus); in __perf_evlist__propagate_maps() 158 evsel->cpus = cpu_map__get(evsel->own_cpus); in __perf_evlist__propagate_maps() [all …]
|
D | counts.c | 37 void perf_evsel__reset_counts(struct perf_evsel *evsel) in perf_evsel__reset_counts() argument 39 perf_counts__reset(evsel->counts); in perf_evsel__reset_counts() 42 int perf_evsel__alloc_counts(struct perf_evsel *evsel, int ncpus, int nthreads) in perf_evsel__alloc_counts() argument 44 evsel->counts = perf_counts__new(ncpus, nthreads); in perf_evsel__alloc_counts() 45 return evsel->counts != NULL ? 0 : -ENOMEM; in perf_evsel__alloc_counts() 48 void perf_evsel__free_counts(struct perf_evsel *evsel) in perf_evsel__free_counts() argument 50 perf_counts__delete(evsel->counts); in perf_evsel__free_counts() 51 evsel->counts = NULL; in perf_evsel__free_counts()
|
D | stat-shadow.c | 53 static int evsel_context(struct perf_evsel *evsel) in evsel_context() argument 57 if (evsel->attr.exclude_kernel) in evsel_context() 59 if (evsel->attr.exclude_user) in evsel_context() 61 if (evsel->attr.exclude_hv) in evsel_context() 63 if (evsel->attr.exclude_host) in evsel_context() 65 if (evsel->attr.exclude_idle) in evsel_context() 176 struct perf_evsel *evsel, double avg, in print_stalled_cycles_frontend() argument 181 int ctx = evsel_context(evsel); in print_stalled_cycles_frontend() 198 struct perf_evsel *evsel, double avg, in print_stalled_cycles_backend() argument 203 int ctx = evsel_context(evsel); in print_stalled_cycles_backend() [all …]
|
D | drv_configs.c | 22 perf_evsel__apply_drv_configs(struct perf_evsel *evsel, in perf_evsel__apply_drv_configs() argument 31 if (pmu->type == evsel->attr.type) { in perf_evsel__apply_drv_configs() 36 list_for_each_entry(term, &evsel->config_terms, list) { in perf_evsel__apply_drv_configs() 65 struct perf_evsel *evsel; in perf_evlist__apply_drv_configs() local 68 evlist__for_each_entry(evlist, evsel) { in perf_evlist__apply_drv_configs() 69 err = perf_evsel__apply_drv_configs(evsel, err_term); in perf_evlist__apply_drv_configs() 71 *err_evsel = evsel; in perf_evlist__apply_drv_configs()
|
D | evlist.h | 114 void perf_evlist__remove(struct perf_evlist *evlist, struct perf_evsel *evsel); 149 void perf_evlist__id_add(struct perf_evlist *evlist, struct perf_evsel *evsel, 152 struct perf_evsel *evsel, 226 struct perf_evsel *evsel, int idx); 229 struct perf_evsel *evsel); 299 #define __evlist__for_each_entry(list, evsel) \ argument 300 list_for_each_entry(evsel, list, node) 307 #define evlist__for_each_entry(evlist, evsel) \ argument 308 __evlist__for_each_entry(&(evlist)->entries, evsel) 315 #define __evlist__for_each_entry_continue(list, evsel) \ argument [all …]
|
D | kvm-stat.h | 46 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, 110 void exit_event_get_key(struct perf_evsel *evsel, 113 bool exit_event_begin(struct perf_evsel *evsel, 116 bool exit_event_end(struct perf_evsel *evsel, 123 bool kvm_exit_event(struct perf_evsel *evsel); 124 bool kvm_entry_event(struct perf_evsel *evsel);
|
D | evsel_fprintf.c | 32 int perf_evsel__fprintf(struct perf_evsel *evsel, in perf_evsel__fprintf() argument 41 if (!perf_evsel__is_group_leader(evsel)) in perf_evsel__fprintf() 44 if (evsel->nr_members > 1) in perf_evsel__fprintf() 45 printed += fprintf(fp, "%s{", evsel->group_name ?: ""); in perf_evsel__fprintf() 47 printed += fprintf(fp, "%s", perf_evsel__name(evsel)); in perf_evsel__fprintf() 48 for_each_group_member(pos, evsel) in perf_evsel__fprintf() 51 if (evsel->nr_members > 1) in perf_evsel__fprintf() 56 printed += fprintf(fp, "%s", perf_evsel__name(evsel)); in perf_evsel__fprintf() 59 printed += perf_event_attr__fprintf(fp, &evsel->attr, in perf_evsel__fprintf() 64 if (!evsel->attr.freq) in perf_evsel__fprintf() [all …]
|
/tools/perf/arch/x86/util/ |
D | kvm-stat.c | 27 static void mmio_event_get_key(struct perf_evsel *evsel, struct perf_sample *sample, in mmio_event_get_key() argument 30 key->key = perf_evsel__intval(evsel, sample, "gpa"); in mmio_event_get_key() 31 key->info = perf_evsel__intval(evsel, sample, "type"); in mmio_event_get_key() 38 static bool mmio_event_begin(struct perf_evsel *evsel, in mmio_event_begin() argument 42 if (kvm_exit_event(evsel)) in mmio_event_begin() 46 if (!strcmp(evsel->name, "kvm:kvm_mmio") && in mmio_event_begin() 47 perf_evsel__intval(evsel, sample, "type") == KVM_TRACE_MMIO_WRITE) { in mmio_event_begin() 48 mmio_event_get_key(evsel, sample, key); in mmio_event_begin() 55 static bool mmio_event_end(struct perf_evsel *evsel, struct perf_sample *sample, in mmio_event_end() argument 59 if (kvm_entry_event(evsel)) in mmio_event_end() [all …]
|
/tools/perf/ |
D | builtin-inject.c | 215 struct perf_evsel *evsel, 221 struct perf_evsel *evsel, in perf_event__repipe_sample() argument 224 if (evsel->handler) { in perf_event__repipe_sample() 225 inject_handler f = evsel->handler; in perf_event__repipe_sample() 226 return f(tool, event, sample, evsel, machine); in perf_event__repipe_sample() 229 build_id__mark_dso_hit(tool, event, sample, evsel, machine); in perf_event__repipe_sample() 414 struct perf_evsel *evsel __maybe_unused, in perf_event__inject_buildid() 457 struct perf_evsel *evsel __maybe_unused, in perf_inject__sched_process_exit() 477 struct perf_evsel *evsel, in perf_inject__sched_switch() argument 483 perf_inject__sched_process_exit(tool, event, sample, evsel, machine); in perf_inject__sched_switch() [all …]
|
/tools/perf/arch/s390/util/ |
D | kvm-stat.c | 27 static void event_icpt_insn_get_key(struct perf_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 perf_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 perf_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 perf_evsel *evsel, in event_icpt_prog_get_key() argument 58 key->key = perf_evsel__intval(evsel, sample, "code"); in event_icpt_prog_get_key()
|