/external/linux-tools-perf/src/tools/perf/tests/ |
D | parse-events.c | 15 struct perf_evsel *evsel = perf_evlist__first(evlist); in test__checkevent_tracepoint() local 19 TEST_ASSERT_VAL("wrong type", PERF_TYPE_TRACEPOINT == evsel->attr.type); in test__checkevent_tracepoint() 21 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); in test__checkevent_tracepoint() 22 TEST_ASSERT_VAL("wrong sample_period", 1 == evsel->attr.sample_period); in test__checkevent_tracepoint() 28 struct perf_evsel *evsel; in test__checkevent_tracepoint_multi() local 33 list_for_each_entry(evsel, &evlist->entries, node) { in test__checkevent_tracepoint_multi() 35 PERF_TYPE_TRACEPOINT == evsel->attr.type); in test__checkevent_tracepoint_multi() 37 PERF_TP_SAMPLE_TYPE == evsel->attr.sample_type); in test__checkevent_tracepoint_multi() 39 1 == evsel->attr.sample_period); in test__checkevent_tracepoint_multi() 46 struct perf_evsel *evsel = perf_evlist__first(evlist); in test__checkevent_raw() local [all …]
|
D | evsel-tp-sched.c | 5 static int perf_evsel__test_field(struct perf_evsel *evsel, const char *name, in perf_evsel__test_field() argument 8 struct format_field *field = perf_evsel__field(evsel, name); in perf_evsel__test_field() 13 pr_debug("%s: \"%s\" field not found!\n", evsel->name, name); in perf_evsel__test_field() 20 evsel->name, name, is_signed, should_be_signed); in perf_evsel__test_field() 26 evsel->name, name, field->size, size); in perf_evsel__test_field() 35 struct perf_evsel *evsel = perf_evsel__newtp("sched", "sched_switch", 0); in test__perf_evsel__tp_sched_test() local 38 if (evsel == NULL) { in test__perf_evsel__tp_sched_test() 43 if (perf_evsel__test_field(evsel, "prev_comm", 16, true)) in test__perf_evsel__tp_sched_test() 46 if (perf_evsel__test_field(evsel, "prev_pid", 4, true)) in test__perf_evsel__tp_sched_test() 49 if (perf_evsel__test_field(evsel, "prev_prio", 4, true)) in test__perf_evsel__tp_sched_test() [all …]
|
D | evsel-roundtrip-name.c | 10 struct perf_evsel *evsel; in perf_evsel__roundtrip_cache_name_test() local 33 evsel = perf_evlist__first(evlist); in perf_evsel__roundtrip_cache_name_test() 44 if (evsel->idx != idx) in perf_evsel__roundtrip_cache_name_test() 49 if (strcmp(perf_evsel__name(evsel), name)) { in perf_evsel__roundtrip_cache_name_test() 50 pr_debug("%s != %s\n", perf_evsel__name(evsel), name); in perf_evsel__roundtrip_cache_name_test() 54 evsel = perf_evsel__next(evsel); in perf_evsel__roundtrip_cache_name_test() 66 struct perf_evsel *evsel; in __perf_evsel__name_array_test() local 82 list_for_each_entry(evsel, &evlist->entries, node) { in __perf_evsel__name_array_test() 83 if (strcmp(perf_evsel__name(evsel), names[evsel->idx])) { in __perf_evsel__name_array_test() 85 pr_debug("%s != %s\n", perf_evsel__name(evsel), names[evsel->idx]); in __perf_evsel__name_array_test()
|
D | open-syscall.c | 9 struct perf_evsel *evsel; in test__open_syscall_event() local 18 evsel = perf_evsel__newtp("syscalls", "sys_enter_open", 0); in test__open_syscall_event() 19 if (evsel == NULL) { in test__open_syscall_event() 24 if (perf_evsel__open_per_thread(evsel, threads) < 0) { in test__open_syscall_event() 36 if (perf_evsel__read_on_cpu(evsel, 0, 0) < 0) { in test__open_syscall_event() 41 if (evsel->counts->cpu[0].val != nr_open_calls) { in test__open_syscall_event() 43 nr_open_calls, evsel->counts->cpu[0].val); in test__open_syscall_event() 49 perf_evsel__close_fd(evsel, 1, threads->nr); in test__open_syscall_event() 51 perf_evsel__delete(evsel); in test__open_syscall_event()
|
D | open-syscall-all-cpus.c | 11 struct perf_evsel *evsel; in test__open_syscall_event_on_all_cpus() local 29 evsel = perf_evsel__newtp("syscalls", "sys_enter_open", 0); in test__open_syscall_event_on_all_cpus() 30 if (evsel == NULL) { in test__open_syscall_event_on_all_cpus() 35 if (perf_evsel__open(evsel, cpus, threads) < 0) { in test__open_syscall_event_on_all_cpus() 74 if (perf_evsel__alloc_counts(evsel, cpus->nr) < 0) { in test__open_syscall_event_on_all_cpus() 87 if (perf_evsel__read_on_cpu(evsel, cpu, 0) < 0) { in test__open_syscall_event_on_all_cpus() 94 if (evsel->counts->cpu[cpu].val != expected) { in test__open_syscall_event_on_all_cpus() 96 expected, cpus->map[cpu], evsel->counts->cpu[cpu].val); in test__open_syscall_event_on_all_cpus() 101 perf_evsel__free_counts(evsel); in test__open_syscall_event_on_all_cpus() 103 perf_evsel__close_fd(evsel, 1, threads->nr); in test__open_syscall_event_on_all_cpus() [all …]
|
D | mmap-basic.c | 33 struct perf_evsel *evsels[nsyscalls], *evsel; in test__basic_mmap() local 118 evsel = perf_evlist__id2evsel(evlist, sample.id); in test__basic_mmap() 119 if (evsel == NULL) { in test__basic_mmap() 124 nr_events[evsel->idx]++; in test__basic_mmap() 129 list_for_each_entry(evsel, &evlist->entries, node) { in test__basic_mmap() 130 if (nr_events[evsel->idx] != expected_nr_events[evsel->idx]) { in test__basic_mmap() 132 expected_nr_events[evsel->idx], in test__basic_mmap() 133 perf_evsel__name(evsel), nr_events[evsel->idx]); in test__basic_mmap()
|
D | task-exit.c | 29 struct perf_evsel *evsel; in test__task_exit() local 75 evsel = perf_evlist__first(evlist); in test__task_exit() 76 evsel->attr.task = 1; in test__task_exit() 77 evsel->attr.sample_freq = 0; in test__task_exit() 78 evsel->attr.inherit = 0; in test__task_exit() 79 evsel->attr.watermark = 0; in test__task_exit() 80 evsel->attr.wakeup_events = 1; in test__task_exit() 81 evsel->attr.exclude_kernel = 1; in test__task_exit()
|
D | open-syscall-tp-fields.c | 22 struct perf_evsel *evsel; in test__syscall_open_tp_fields() local 30 evsel = perf_evsel__newtp("syscalls", "sys_enter_open", 0); in test__syscall_open_tp_fields() 31 if (evsel == NULL) { in test__syscall_open_tp_fields() 36 perf_evlist__add(evlist, evsel); in test__syscall_open_tp_fields() 44 perf_evsel__config(evsel, &opts); in test__syscall_open_tp_fields() 85 err = perf_evsel__parse_sample(evsel, event, &sample); in test__syscall_open_tp_fields() 91 tp_flags = perf_evsel__intval(evsel, &sample, "flags"); in test__syscall_open_tp_fields()
|
D | keep-tracking.c | 66 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()
|
D | perf-time-to-tsc.c | 62 struct perf_evsel *evsel = NULL; in test__perf_time_to_tsc() local 86 evsel = perf_evlist__first(evlist); in test__perf_time_to_tsc() 88 evsel->attr.comm = 1; in test__perf_time_to_tsc() 89 evsel->attr.disabled = 1; in test__perf_time_to_tsc() 90 evsel->attr.enable_on_exec = 0; in test__perf_time_to_tsc() 128 CHECK__(perf_evsel__parse_sample(evsel, event, in test__perf_time_to_tsc() 133 CHECK__(perf_evsel__parse_sample(evsel, event, in test__perf_time_to_tsc()
|
/external/linux-tools-perf/src/tools/perf/util/ |
D | evsel.h | 40 struct perf_evsel *evsel; member 107 void perf_evsel__init(struct perf_evsel *evsel, 109 void perf_evsel__exit(struct perf_evsel *evsel); 110 void perf_evsel__delete(struct perf_evsel *evsel); 112 void perf_evsel__config(struct perf_evsel *evsel, 116 void perf_evsel__calc_id_pos(struct perf_evsel *evsel); 132 const char *perf_evsel__name(struct perf_evsel *evsel); 133 const char *perf_evsel__group_name(struct perf_evsel *evsel); 134 int perf_evsel__group_desc(struct perf_evsel *evsel, char *buf, size_t size); 136 int perf_evsel__alloc_fd(struct perf_evsel *evsel, int ncpus, int nthreads); [all …]
|
D | evsel.c | 111 void perf_evsel__calc_id_pos(struct perf_evsel *evsel) in perf_evsel__calc_id_pos() argument 113 evsel->id_pos = __perf_evsel__calc_id_pos(evsel->attr.sample_type); in perf_evsel__calc_id_pos() 114 evsel->is_pos = __perf_evsel__calc_is_pos(evsel->attr.sample_type); in perf_evsel__calc_id_pos() 127 void __perf_evsel__set_sample_bit(struct perf_evsel *evsel, in __perf_evsel__set_sample_bit() argument 130 if (!(evsel->attr.sample_type & bit)) { in __perf_evsel__set_sample_bit() 131 evsel->attr.sample_type |= bit; in __perf_evsel__set_sample_bit() 132 evsel->sample_size += sizeof(u64); in __perf_evsel__set_sample_bit() 133 perf_evsel__calc_id_pos(evsel); in __perf_evsel__set_sample_bit() 137 void __perf_evsel__reset_sample_bit(struct perf_evsel *evsel, in __perf_evsel__reset_sample_bit() argument 140 if (evsel->attr.sample_type & bit) { in __perf_evsel__reset_sample_bit() [all …]
|
D | evlist.c | 69 struct perf_evsel *evsel; in perf_evlist__update_id_pos() local 71 list_for_each_entry(evsel, &evlist->entries, node) in perf_evlist__update_id_pos() 72 perf_evsel__calc_id_pos(evsel); in perf_evlist__update_id_pos() 125 struct perf_evsel *evsel, *leader; in __perf_evlist__set_leader() local 128 evsel = list_entry(list->prev, struct perf_evsel, node); in __perf_evlist__set_leader() 130 leader->nr_members = evsel->idx - leader->idx + 1; in __perf_evlist__set_leader() 132 list_for_each_entry(evsel, list, node) { in __perf_evlist__set_leader() 133 evsel->leader = leader; in __perf_evlist__set_leader() 151 struct perf_evsel *evsel; in perf_evlist__add_default() local 155 evsel = perf_evsel__new(&attr, 0); in perf_evlist__add_default() [all …]
|
D | record.c | 6 typedef void (*setup_probe_fn_t)(struct perf_evsel *evsel); 11 struct perf_evsel *evsel; in perf_do_probe_api() local 21 evsel = perf_evlist__first(evlist); in perf_do_probe_api() 23 fd = sys_perf_event_open(&evsel->attr, -1, cpu, -1, 0); in perf_do_probe_api() 28 fn(evsel); in perf_do_probe_api() 30 fd = sys_perf_event_open(&evsel->attr, -1, cpu, -1, 0); in perf_do_probe_api() 65 static void perf_probe_sample_identifier(struct perf_evsel *evsel) in perf_probe_sample_identifier() argument 67 evsel->attr.sample_type |= PERF_SAMPLE_IDENTIFIER; in perf_probe_sample_identifier() 78 struct perf_evsel *evsel; in perf_evlist__config() local 91 list_for_each_entry(evsel, &evlist->entries, node) in perf_evlist__config() [all …]
|
D | header.c | 624 struct perf_evsel *evsel; in write_event_desc() local 640 sz = (u32)sizeof(evsel->attr); in write_event_desc() 645 list_for_each_entry(evsel, &evlist->entries, node) { in write_event_desc() 647 ret = do_write(fd, &evsel->attr, sz); in write_event_desc() 657 nri = evsel->ids; in write_event_desc() 665 ret = do_write_string(fd, perf_evsel__name(evsel)); in write_event_desc() 671 ret = do_write(fd, evsel->id, evsel->ids * sizeof(u64)); in write_event_desc() 1087 struct perf_evsel *evsel; in write_group_desc() local 1094 list_for_each_entry(evsel, &evlist->entries, node) { in write_group_desc() 1095 if (perf_evsel__is_group_leader(evsel) && in write_group_desc() [all …]
|
D | parse-events.c | 276 struct perf_evsel *evsel; in __add_event() local 280 evsel = perf_evsel__new(attr, (*idx)++); in __add_event() 281 if (!evsel) in __add_event() 284 evsel->cpus = cpus; in __add_event() 286 evsel->name = strdup(name); in __add_event() 287 list_add_tail(&evsel->node, list); in __add_event() 379 struct perf_evsel *evsel; in add_tracepoint() local 381 evsel = perf_evsel__newtp(sys_name, evt_name, (*idx)++); in add_tracepoint() 382 if (!evsel) in add_tracepoint() 385 list_add_tail(&evsel->node, list); in add_tracepoint() [all …]
|
D | annotate.h | 143 struct perf_evsel *evsel, bool full_paths, 150 struct perf_evsel *evsel, bool print_lines, 155 struct perf_evsel *evsel, 160 struct perf_evsel *evsel __maybe_unused, in symbol__tui_annotate() 170 struct perf_evsel *evsel, 174 struct perf_evsel *evsel, in hist_entry__gtk_annotate() argument 177 return symbol__gtk_annotate(he->ms.sym, he->ms.map, evsel, hbt); in hist_entry__gtk_annotate() 183 struct perf_evsel *evsel __maybe_unused, in hist_entry__gtk_annotate()
|
/external/linux-tools-perf/src/tools/perf/ |
D | builtin-stat.c | 127 static inline struct cpu_map *perf_evsel__cpus(struct perf_evsel *evsel) in perf_evsel__cpus() argument 129 return (evsel->cpus && !target.cpu_list) ? evsel->cpus : evsel_list->cpus; in perf_evsel__cpus() 132 static inline int perf_evsel__nr_cpus(struct perf_evsel *evsel) in perf_evsel__nr_cpus() argument 134 return perf_evsel__cpus(evsel)->nr; in perf_evsel__nr_cpus() 137 static void perf_evsel__reset_stat_priv(struct perf_evsel *evsel) in perf_evsel__reset_stat_priv() argument 139 memset(evsel->priv, 0, sizeof(struct perf_stat)); in perf_evsel__reset_stat_priv() 142 static int perf_evsel__alloc_stat_priv(struct perf_evsel *evsel) in perf_evsel__alloc_stat_priv() argument 144 evsel->priv = zalloc(sizeof(struct perf_stat)); in perf_evsel__alloc_stat_priv() 145 return evsel->priv == NULL ? -ENOMEM : 0; in perf_evsel__alloc_stat_priv() 148 static void perf_evsel__free_stat_priv(struct perf_evsel *evsel) in perf_evsel__free_stat_priv() argument [all …]
|
D | builtin-inject.c | 94 struct perf_evsel *evsel, 100 struct perf_evsel *evsel, in perf_event__repipe_sample() argument 103 if (evsel->handler.func) { in perf_event__repipe_sample() 104 inject_handler f = evsel->handler.func; in perf_event__repipe_sample() 105 return f(tool, event, sample, evsel, machine); in perf_event__repipe_sample() 108 build_id__mark_dso_hit(tool, event, sample, evsel, machine); in perf_event__repipe_sample() 205 struct perf_evsel *evsel __maybe_unused, in perf_event__inject_buildid() 251 struct perf_evsel *evsel __maybe_unused, in perf_inject__sched_process_exit() 271 struct perf_evsel *evsel, in perf_inject__sched_switch() argument 277 perf_inject__sched_process_exit(tool, event, sample, evsel, machine); in perf_inject__sched_switch() [all …]
|
D | builtin-lock.c | 339 int (*acquire_event)(struct perf_evsel *evsel, 342 int (*acquired_event)(struct perf_evsel *evsel, 345 int (*contended_event)(struct perf_evsel *evsel, 348 int (*release_event)(struct perf_evsel *evsel, 388 static int report_lock_acquire_event(struct perf_evsel *evsel, in report_lock_acquire_event() argument 395 const char *name = perf_evsel__strval(evsel, sample, "name"); in report_lock_acquire_event() 396 u64 tmp = perf_evsel__intval(evsel, sample, "lockdep_addr"); in report_lock_acquire_event() 397 int flag = perf_evsel__intval(evsel, sample, "flag"); in report_lock_acquire_event() 461 static int report_lock_acquired_event(struct perf_evsel *evsel, in report_lock_acquired_event() argument 469 const char *name = perf_evsel__strval(evsel, sample, "name"); in report_lock_acquired_event() [all …]
|
D | builtin-report.c | 76 struct perf_evsel *evsel, in perf_report__add_mem_hist_entry() argument 90 err = machine__resolve_callchain(machine, evsel, al->thread, in perf_report__add_mem_hist_entry() 114 he = __hists__add_mem_entry(&evsel->hists, al, parent, mi, cost, cost); in perf_report__add_mem_hist_entry() 126 assert(evsel != NULL); in perf_report__add_mem_hist_entry() 131 err = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); in perf_report__add_mem_hist_entry() 147 evsel->idx, in perf_report__add_mem_hist_entry() 153 evsel->hists.stats.total_period += cost; in perf_report__add_mem_hist_entry() 154 hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); in perf_report__add_mem_hist_entry() 169 struct perf_evsel *evsel, in perf_report__add_branch_hist_entry() argument 181 err = machine__resolve_callchain(machine, evsel, al->thread, in perf_report__add_branch_hist_entry() [all …]
|
D | builtin-annotate.c | 46 static int perf_evsel__add_sample(struct perf_evsel *evsel, in perf_evsel__add_sample() argument 66 he = __hists__add_entry(&evsel->hists, al, NULL, 1, 1); in perf_evsel__add_sample() 76 ret = hist_entry__inc_addr_samples(he, evsel->idx, al->addr); in perf_evsel__add_sample() 79 evsel->hists.stats.total_period += sample->period; in perf_evsel__add_sample() 80 hists__inc_nr_events(&evsel->hists, PERF_RECORD_SAMPLE); in perf_evsel__add_sample() 87 struct perf_evsel *evsel, in process_sample_event() argument 102 if (!al.filtered && perf_evsel__add_sample(evsel, sample, &al, ann)) { in process_sample_event() 112 struct perf_evsel *evsel, in hist_entry__tty_annotate() argument 115 return symbol__tty_annotate(he->ms.sym, he->ms.map, evsel, in hist_entry__tty_annotate() 120 struct perf_evsel *evsel, in hists__find_annotations() argument [all …]
|
D | builtin-kvm.c | 69 bool (*is_begin_event)(struct perf_evsel *evsel, 72 bool (*is_end_event)(struct perf_evsel *evsel, 122 static void exit_event_get_key(struct perf_evsel *evsel, in exit_event_get_key() argument 127 key->key = perf_evsel__intval(evsel, sample, "exit_reason"); in exit_event_get_key() 130 static bool kvm_exit_event(struct perf_evsel *evsel) in kvm_exit_event() argument 132 return !strcmp(evsel->name, "kvm:kvm_exit"); in kvm_exit_event() 135 static bool exit_event_begin(struct perf_evsel *evsel, in exit_event_begin() argument 138 if (kvm_exit_event(evsel)) { in exit_event_begin() 139 exit_event_get_key(evsel, sample, key); in exit_event_begin() 146 static bool kvm_entry_event(struct perf_evsel *evsel) in kvm_entry_event() argument [all …]
|
D | builtin-sched.c | 103 int (*switch_event)(struct perf_sched *sched, struct perf_evsel *evsel, 106 int (*runtime_event)(struct perf_sched *sched, struct perf_evsel *evsel, 109 int (*wakeup_event)(struct perf_sched *sched, struct perf_evsel *evsel, 117 struct perf_evsel *evsel, 655 struct perf_evsel *evsel, struct perf_sample *sample, in replay_wakeup_event() argument 658 const char *comm = perf_evsel__strval(evsel, sample, "comm"); in replay_wakeup_event() 659 const u32 pid = perf_evsel__intval(evsel, sample, "pid"); in replay_wakeup_event() 663 printf("sched_wakeup event %p\n", evsel); in replay_wakeup_event() 676 struct perf_evsel *evsel, in replay_switch_event() argument 680 const char *prev_comm = perf_evsel__strval(evsel, sample, "prev_comm"), in replay_switch_event() [all …]
|
/external/linux-tools-perf/src/tools/perf/ui/ |
D | hist.c | 20 struct perf_evsel *evsel = hists_to_evsel(hists); in __hpp__fmt() local 33 if (perf_evsel__is_group_event(evsel)) { in __hpp__fmt() 36 int nr_members = evsel->nr_members; in __hpp__fmt() 38 prev_idx = perf_evsel__group_idx(evsel); in __hpp__fmt() 47 evsel = hists_to_evsel(pair->hists); in __hpp__fmt() 48 idx_delta = perf_evsel__group_idx(evsel) - prev_idx - 1; in __hpp__fmt() 66 prev_idx = perf_evsel__group_idx(evsel); in __hpp__fmt() 89 struct perf_evsel *evsel = hpp->ptr; \ 91 len = max(len, evsel->nr_members * _unit_width); \ 103 struct perf_evsel *evsel = hpp->ptr; \ [all …]
|