Lines Matching +full:no +full:- +full:ref +full:- +full:high +full:- +full:z
1 // SPDX-License-Identifier: GPL-2.0-only
4 * Copyright (c) 2013-2015, Intel Corporation.
38 #include "util/synthetic-events.h"
49 #include <subcmd/parse-options.h>
51 #include "cs-etm.h"
52 #include "intel-pt.h"
53 #include "intel-bts.h"
54 #include "arm-spe.h"
55 #include "hisi-ptt.h"
56 #include "s390-cpumsf.h"
74 return -EINVAL; in evlist__regroup()
81 evsel->core.nr_members <= 1))) in evlist__regroup()
82 return -EINVAL; in evlist__regroup()
95 if (leader->core.nr_members < 1) in evlist__regroup()
96 leader->core.nr_members = 1; in evlist__regroup()
97 leader->core.nr_members += 1; in evlist__regroup()
111 return !session->itrace_synth_opts || in auxtrace__dont_decode()
112 session->itrace_synth_opts->dont_decode; in auxtrace__dont_decode()
121 WARN_ONCE(mm->base, "Uninitialized auxtrace_mmap\n"); in auxtrace_mmap__mmap()
123 mm->userpg = userpg; in auxtrace_mmap__mmap()
124 mm->mask = mp->mask; in auxtrace_mmap__mmap()
125 mm->len = mp->len; in auxtrace_mmap__mmap()
126 mm->prev = 0; in auxtrace_mmap__mmap()
127 mm->idx = mp->idx; in auxtrace_mmap__mmap()
128 mm->tid = mp->tid; in auxtrace_mmap__mmap()
129 mm->cpu = mp->cpu.cpu; in auxtrace_mmap__mmap()
131 if (!mp->len || !mp->mmap_needed) { in auxtrace_mmap__mmap()
132 mm->base = NULL; in auxtrace_mmap__mmap()
136 pc->aux_offset = mp->offset; in auxtrace_mmap__mmap()
137 pc->aux_size = mp->len; in auxtrace_mmap__mmap()
139 mm->base = mmap(NULL, mp->len, mp->prot, MAP_SHARED, fd, mp->offset); in auxtrace_mmap__mmap()
140 if (mm->base == MAP_FAILED) { in auxtrace_mmap__mmap()
142 mm->base = NULL; in auxtrace_mmap__mmap()
143 return -1; in auxtrace_mmap__mmap()
151 if (mm->base) { in auxtrace_mmap__munmap()
152 munmap(mm->base, mm->len); in auxtrace_mmap__munmap()
153 mm->base = NULL; in auxtrace_mmap__munmap()
163 mp->offset = auxtrace_offset; in auxtrace_mmap_params__init()
164 mp->len = auxtrace_pages * (size_t)page_size; in auxtrace_mmap_params__init()
165 mp->mask = is_power_of_2(mp->len) ? mp->len - 1 : 0; in auxtrace_mmap_params__init()
166 mp->prot = PROT_READ | (auxtrace_overwrite ? 0 : PROT_WRITE); in auxtrace_mmap_params__init()
167 pr_debug2("AUX area mmap length %zu\n", mp->len); in auxtrace_mmap_params__init()
169 mp->len = 0; in auxtrace_mmap_params__init()
177 bool per_cpu = !perf_cpu_map__has_any_cpu(evlist->core.user_requested_cpus); in auxtrace_mmap_params__set_idx()
179 mp->mmap_needed = evsel->needs_auxtrace_mmap; in auxtrace_mmap_params__set_idx()
181 if (!mp->mmap_needed) in auxtrace_mmap_params__set_idx()
184 mp->idx = idx; in auxtrace_mmap_params__set_idx()
187 mp->cpu = perf_cpu_map__cpu(evlist->core.all_cpus, idx); in auxtrace_mmap_params__set_idx()
188 if (evlist->core.threads) in auxtrace_mmap_params__set_idx()
189 mp->tid = perf_thread_map__pid(evlist->core.threads, 0); in auxtrace_mmap_params__set_idx()
191 mp->tid = -1; in auxtrace_mmap_params__set_idx()
193 mp->cpu.cpu = -1; in auxtrace_mmap_params__set_idx()
194 mp->tid = perf_thread_map__pid(evlist->core.threads, idx); in auxtrace_mmap_params__set_idx()
223 queues->nr_queues = nr_queues; in auxtrace_queues__init_nr()
224 queues->queue_array = auxtrace_alloc_queue_array(queues->nr_queues); in auxtrace_queues__init_nr()
225 if (!queues->queue_array) in auxtrace_queues__init_nr()
226 return -ENOMEM; in auxtrace_queues__init_nr()
238 unsigned int nr_queues = queues->nr_queues; in auxtrace_queues__grow()
248 if (nr_queues < queues->nr_queues || nr_queues < new_nr_queues) in auxtrace_queues__grow()
249 return -EINVAL; in auxtrace_queues__grow()
253 return -ENOMEM; in auxtrace_queues__grow()
255 for (i = 0; i < queues->nr_queues; i++) { in auxtrace_queues__grow()
256 list_splice_tail(&queues->queue_array[i].head, in auxtrace_queues__grow()
258 queue_array[i].tid = queues->queue_array[i].tid; in auxtrace_queues__grow()
259 queue_array[i].cpu = queues->queue_array[i].cpu; in auxtrace_queues__grow()
260 queue_array[i].set = queues->queue_array[i].set; in auxtrace_queues__grow()
261 queue_array[i].priv = queues->queue_array[i].priv; in auxtrace_queues__grow()
264 queues->nr_queues = nr_queues; in auxtrace_queues__grow()
265 queues->queue_array = queue_array; in auxtrace_queues__grow()
272 int fd = perf_data__fd(session->data); in auxtrace_copy_data()
299 if (idx >= queues->nr_queues) { in auxtrace_queues__queue_buffer()
305 queue = &queues->queue_array[idx]; in auxtrace_queues__queue_buffer()
307 if (!queue->set) { in auxtrace_queues__queue_buffer()
308 queue->set = true; in auxtrace_queues__queue_buffer()
309 queue->tid = buffer->tid; in auxtrace_queues__queue_buffer()
310 queue->cpu = buffer->cpu.cpu; in auxtrace_queues__queue_buffer()
313 buffer->buffer_nr = queues->next_buffer_nr++; in auxtrace_queues__queue_buffer()
315 list_add_tail(&buffer->list, &queue->head); in auxtrace_queues__queue_buffer()
317 queues->new_data = true; in auxtrace_queues__queue_buffer()
318 queues->populated = true; in auxtrace_queues__queue_buffer()
323 /* Limit buffers to 32MiB on 32-bit */
330 u64 sz = buffer->size; in auxtrace_queues__split_buffer()
338 return -ENOMEM; in auxtrace_queues__split_buffer()
339 b->size = BUFFER_LIMIT_FOR_32_BIT; in auxtrace_queues__split_buffer()
340 b->consecutive = consecutive; in auxtrace_queues__split_buffer()
346 buffer->data_offset += BUFFER_LIMIT_FOR_32_BIT; in auxtrace_queues__split_buffer()
347 sz -= BUFFER_LIMIT_FOR_32_BIT; in auxtrace_queues__split_buffer()
351 buffer->size = sz; in auxtrace_queues__split_buffer()
352 buffer->consecutive = consecutive; in auxtrace_queues__split_buffer()
359 unsigned long *cpu_bitmap = session->itrace_synth_opts->cpu_bitmap; in filter_cpu()
361 return cpu_bitmap && cpu.cpu != -1 && !test_bit(cpu.cpu, cpu_bitmap); in filter_cpu()
370 int err = -ENOMEM; in auxtrace_queues__add_buffer()
372 if (filter_cpu(session, buffer->cpu)) in auxtrace_queues__add_buffer()
377 return -ENOMEM; in auxtrace_queues__add_buffer()
379 if (session->one_mmap) { in auxtrace_queues__add_buffer()
380 buffer->data = buffer->data_offset - session->one_mmap_offset + in auxtrace_queues__add_buffer()
381 session->one_mmap_addr; in auxtrace_queues__add_buffer()
382 } else if (perf_data__is_pipe(session->data)) { in auxtrace_queues__add_buffer()
383 buffer->data = auxtrace_copy_data(buffer->size, session); in auxtrace_queues__add_buffer()
384 if (!buffer->data) in auxtrace_queues__add_buffer()
386 buffer->data_needs_freeing = true; in auxtrace_queues__add_buffer()
388 buffer->size > BUFFER_LIMIT_FOR_32_BIT) { in auxtrace_queues__add_buffer()
415 .pid = -1, in auxtrace_queues__add_event()
416 .tid = event->auxtrace.tid, in auxtrace_queues__add_event()
417 .cpu = { event->auxtrace.cpu }, in auxtrace_queues__add_event()
419 .offset = event->auxtrace.offset, in auxtrace_queues__add_event()
420 .reference = event->auxtrace.reference, in auxtrace_queues__add_event()
421 .size = event->auxtrace.size, in auxtrace_queues__add_event()
423 unsigned int idx = event->auxtrace.idx; in auxtrace_queues__add_event()
442 if (event->header.type == PERF_RECORD_AUXTRACE) { in auxtrace_queues__add_indexed_event()
443 if (event->header.size < sizeof(struct perf_record_auxtrace) || in auxtrace_queues__add_indexed_event()
444 event->header.size != sz) { in auxtrace_queues__add_indexed_event()
445 err = -EINVAL; in auxtrace_queues__add_indexed_event()
448 file_offset += event->header.size; in auxtrace_queues__add_indexed_event()
460 for (i = 0; i < queues->nr_queues; i++) { in auxtrace_queues__free()
461 while (!list_empty(&queues->queue_array[i].head)) { in auxtrace_queues__free()
464 buffer = list_entry(queues->queue_array[i].head.next, in auxtrace_queues__free()
466 list_del_init(&buffer->list); in auxtrace_queues__free()
471 zfree(&queues->queue_array); in auxtrace_queues__free()
472 queues->nr_queues = 0; in auxtrace_queues__free()
482 parent = (pos - 1) >> 1; in auxtrace_heapify()
497 if (queue_nr >= heap->heap_sz) { in auxtrace_heap__add()
502 heap_array = realloc(heap->heap_array, in auxtrace_heap__add()
505 return -ENOMEM; in auxtrace_heap__add()
506 heap->heap_array = heap_array; in auxtrace_heap__add()
507 heap->heap_sz = heap_sz; in auxtrace_heap__add()
510 auxtrace_heapify(heap->heap_array, heap->heap_cnt++, queue_nr, ordinal); in auxtrace_heap__add()
517 zfree(&heap->heap_array); in auxtrace_heap__free()
518 heap->heap_cnt = 0; in auxtrace_heap__free()
519 heap->heap_sz = 0; in auxtrace_heap__free()
524 unsigned int pos, last, heap_cnt = heap->heap_cnt; in auxtrace_heap__pop()
530 heap->heap_cnt -= 1; in auxtrace_heap__pop()
532 heap_array = heap->heap_array; in auxtrace_heap__pop()
555 last = heap_cnt - 1; in auxtrace_heap__pop()
564 return itr->info_priv_size(itr, evlist); in auxtrace_record__info_priv_size()
571 return -EINVAL; in auxtrace_not_supported()
580 return itr->info_fill(itr, session, auxtrace_info, priv_size); in auxtrace_record__info_fill()
587 itr->free(itr); in auxtrace_record__free()
592 if (itr && itr->snapshot_start) in auxtrace_record__snapshot_start()
593 return itr->snapshot_start(itr); in auxtrace_record__snapshot_start()
599 if (!on_exit && itr && itr->snapshot_finish) in auxtrace_record__snapshot_finish()
600 return itr->snapshot_finish(itr); in auxtrace_record__snapshot_finish()
608 if (itr && itr->find_snapshot) in auxtrace_record__find_snapshot()
609 return itr->find_snapshot(itr, idx, mm, data, head, old); in auxtrace_record__find_snapshot()
618 itr->evlist = evlist; in auxtrace_record__options()
619 return itr->recording_options(itr, evlist, opts); in auxtrace_record__options()
627 return itr->reference(itr); in auxtrace_record__reference()
637 /* PMU-agnostic options */ in auxtrace_parse_snapshot_options()
640 opts->auxtrace_snapshot_on_exit = true; in auxtrace_parse_snapshot_options()
647 if (itr && itr->parse_snapshot_options) in auxtrace_parse_snapshot_options()
648 return itr->parse_snapshot_options(itr, opts, str); in auxtrace_parse_snapshot_options()
650 pr_err("No AUX area tracing to snapshot\n"); in auxtrace_parse_snapshot_options()
651 return -EINVAL; in auxtrace_parse_snapshot_options()
656 bool per_cpu_mmaps = !perf_cpu_map__has_any_cpu(evlist->core.user_requested_cpus); in evlist__enable_event_idx()
659 struct perf_cpu evlist_cpu = perf_cpu_map__cpu(evlist->core.all_cpus, idx); in evlist__enable_event_idx()
660 int cpu_map_idx = perf_cpu_map__idx(evsel->core.cpus, evlist_cpu); in evlist__enable_event_idx()
662 if (cpu_map_idx == -1) in evlist__enable_event_idx()
663 return -EINVAL; in evlist__enable_event_idx()
664 return perf_evsel__enable_cpu(&evsel->core, cpu_map_idx); in evlist__enable_event_idx()
667 return perf_evsel__enable_thread(&evsel->core, idx); in evlist__enable_event_idx()
674 if (!itr->evlist) in auxtrace_record__read_finish()
675 return -EINVAL; in auxtrace_record__read_finish()
677 evlist__for_each_entry(itr->evlist, evsel) { in auxtrace_record__read_finish()
679 if (evsel->disabled) in auxtrace_record__read_finish()
681 return evlist__enable_event_idx(itr->evlist, evsel, idx); in auxtrace_record__read_finish()
684 return -EINVAL; in auxtrace_record__read_finish()
688 * Event record size is 16-bit which results in a maximum size of about 64KiB.
694 /* Arbitrary default size if no other default provided */
705 sz = evsel->core.attr.aux_sample_size; in auxtrace_validate_aux_sample_size()
713 return -EINVAL; in auxtrace_validate_aux_sample_size()
719 return -EINVAL; in auxtrace_validate_aux_sample_size()
724 return -EINVAL; in auxtrace_validate_aux_sample_size()
727 opts->auxtrace_sample_mode = true; in auxtrace_validate_aux_sample_size()
733 if (!opts->auxtrace_sample_mode) { in auxtrace_validate_aux_sample_size()
735 return -EINVAL; in auxtrace_validate_aux_sample_size()
740 return -EINVAL; in auxtrace_validate_aux_sample_size()
762 pr_err("No AUX area event to sample\n"); in auxtrace_parse_sample_options()
763 return -EINVAL; in auxtrace_parse_sample_options()
769 return -EINVAL; in auxtrace_parse_sample_options()
773 sz = itr->default_aux_sample_size; in auxtrace_parse_sample_options()
778 /* Set aux_sample_size based on --aux-sample option */ in auxtrace_parse_sample_options()
783 evsel->core.attr.aux_sample_size = sz; in auxtrace_parse_sample_options()
795 evsel->core.attr.aux_sample_size = term->val.aux_sample_size; in auxtrace_parse_sample_options()
797 if (aux_evsel && evsel->core.attr.aux_sample_size) in auxtrace_parse_sample_options()
806 pr_err("No AUX area event to sample\n"); in auxtrace_parse_sample_options()
807 return -EINVAL; in auxtrace_parse_sample_options()
841 return -ENOMEM; in auxtrace_index__alloc()
843 auxtrace_index->nr = 0; in auxtrace_index__alloc()
844 INIT_LIST_HEAD(&auxtrace_index->list); in auxtrace_index__alloc()
846 list_add_tail(&auxtrace_index->list, head); in auxtrace_index__alloc()
856 list_del_init(&auxtrace_index->list); in auxtrace_index__free()
872 auxtrace_index = list_entry(head->prev, struct auxtrace_index, list); in auxtrace_index__last()
874 if (auxtrace_index->nr >= PERF_AUXTRACE_INDEX_ENTRY_COUNT) { in auxtrace_index__last()
878 auxtrace_index = list_entry(head->prev, struct auxtrace_index, in auxtrace_index__last()
893 return -ENOMEM; in auxtrace_index__auxtrace_event()
895 nr = auxtrace_index->nr; in auxtrace_index__auxtrace_event()
896 auxtrace_index->entries[nr].file_offset = file_offset; in auxtrace_index__auxtrace_event()
897 auxtrace_index->entries[nr].sz = event->header.size; in auxtrace_index__auxtrace_event()
898 auxtrace_index->nr += 1; in auxtrace_index__auxtrace_event()
909 for (i = 0; i < auxtrace_index->nr; i++) { in auxtrace_index__do_write()
910 ent.file_offset = auxtrace_index->entries[i].file_offset; in auxtrace_index__do_write()
911 ent.sz = auxtrace_index->entries[i].sz; in auxtrace_index__do_write()
913 return -errno; in auxtrace_index__do_write()
925 total += auxtrace_index->nr; in auxtrace_index__write()
928 return -errno; in auxtrace_index__write()
947 return -1; in auxtrace_index__process_entry()
951 return -1; in auxtrace_index__process_entry()
953 nr = auxtrace_index->nr; in auxtrace_index__process_entry()
955 auxtrace_index->entries[nr].file_offset = in auxtrace_index__process_entry()
957 auxtrace_index->entries[nr].sz = bswap_64(ent.sz); in auxtrace_index__process_entry()
959 auxtrace_index->entries[nr].file_offset = ent.file_offset; in auxtrace_index__process_entry()
960 auxtrace_index->entries[nr].sz = ent.sz; in auxtrace_index__process_entry()
963 auxtrace_index->nr = nr + 1; in auxtrace_index__process_entry()
971 struct list_head *head = &session->auxtrace_index; in auxtrace_index__process()
975 return -1; in auxtrace_index__process()
981 return -1; in auxtrace_index__process()
983 while (nr--) { in auxtrace_index__process()
988 return -1; in auxtrace_index__process()
999 ent->file_offset, ent->sz); in auxtrace_queues__process_index_entry()
1013 list_for_each_entry(auxtrace_index, &session->auxtrace_index, list) { in auxtrace_queues__process_index()
1014 for (i = 0; i < auxtrace_index->nr; i++) { in auxtrace_queues__process_index()
1015 ent = &auxtrace_index->entries[i]; in auxtrace_queues__process_index()
1030 if (list_is_last(&buffer->list, &queue->head)) in auxtrace_buffer__next()
1032 return list_entry(buffer->list.next, struct auxtrace_buffer, in auxtrace_buffer__next()
1035 if (list_empty(&queue->head)) in auxtrace_buffer__next()
1037 return list_entry(queue->head.next, struct auxtrace_buffer, in auxtrace_buffer__next()
1050 id = sample->id; in auxtrace_queues__sample_queue()
1054 sid = evlist__id2sid(session->evlist, id); in auxtrace_queues__sample_queue()
1058 idx = sid->idx; in auxtrace_queues__sample_queue()
1060 if (idx >= queues->nr_queues) in auxtrace_queues__sample_queue()
1063 return &queues->queue_array[idx]; in auxtrace_queues__sample_queue()
1072 .pid = -1, in auxtrace_queues__add_sample()
1075 .size = sample->aux_sample.size, in auxtrace_queues__add_sample()
1078 u64 id = sample->id; in auxtrace_queues__add_sample()
1082 return -EINVAL; in auxtrace_queues__add_sample()
1084 sid = evlist__id2sid(session->evlist, id); in auxtrace_queues__add_sample()
1086 return -ENOENT; in auxtrace_queues__add_sample()
1088 idx = sid->idx; in auxtrace_queues__add_sample()
1089 buffer.tid = sid->tid; in auxtrace_queues__add_sample()
1090 buffer.cpu = sid->cpu; in auxtrace_queues__add_sample()
1108 if (qd->events && event->header.type == PERF_RECORD_AUXTRACE) { in auxtrace_queue_data_cb()
1109 if (event->header.size < sizeof(struct perf_record_auxtrace)) in auxtrace_queue_data_cb()
1110 return -EINVAL; in auxtrace_queue_data_cb()
1111 offset += event->header.size; in auxtrace_queue_data_cb()
1112 return session->auxtrace->queue_data(session, NULL, event, in auxtrace_queue_data_cb()
1116 if (!qd->samples || event->header.type != PERF_RECORD_SAMPLE) in auxtrace_queue_data_cb()
1119 err = evlist__parse_sample(session->evlist, event, &sample); in auxtrace_queue_data_cb()
1126 offset += sample.aux_sample.data - (void *)event; in auxtrace_queue_data_cb()
1128 return session->auxtrace->queue_data(session, &sample, NULL, offset); in auxtrace_queue_data_cb()
1141 if (perf_data__is_pipe(session->data)) in auxtrace_queue_data()
1144 if (!session->auxtrace || !session->auxtrace->queue_data) in auxtrace_queue_data()
1145 return -EINVAL; in auxtrace_queue_data()
1147 return perf_session__peek_events(session, session->header.data_offset, in auxtrace_queue_data()
1148 session->header.data_size, in auxtrace_queue_data()
1155 size_t adj = buffer->data_offset & (page_size - 1); in auxtrace_buffer__get_data_rw()
1156 size_t size = buffer->size + adj; in auxtrace_buffer__get_data_rw()
1157 off_t file_offset = buffer->data_offset - adj; in auxtrace_buffer__get_data_rw()
1160 if (buffer->data) in auxtrace_buffer__get_data_rw()
1161 return buffer->data; in auxtrace_buffer__get_data_rw()
1167 buffer->mmap_addr = addr; in auxtrace_buffer__get_data_rw()
1168 buffer->mmap_size = size; in auxtrace_buffer__get_data_rw()
1170 buffer->data = addr + adj; in auxtrace_buffer__get_data_rw()
1172 return buffer->data; in auxtrace_buffer__get_data_rw()
1177 if (!buffer->data || !buffer->mmap_addr) in auxtrace_buffer__put_data()
1179 munmap(buffer->mmap_addr, buffer->mmap_size); in auxtrace_buffer__put_data()
1180 buffer->mmap_addr = NULL; in auxtrace_buffer__put_data()
1181 buffer->mmap_size = 0; in auxtrace_buffer__put_data()
1182 buffer->data = NULL; in auxtrace_buffer__put_data()
1183 buffer->use_data = NULL; in auxtrace_buffer__put_data()
1189 if (buffer->data_needs_freeing) { in auxtrace_buffer__drop_data()
1190 buffer->data_needs_freeing = false; in auxtrace_buffer__drop_data()
1191 zfree(&buffer->data); in auxtrace_buffer__drop_data()
1192 buffer->use_data = NULL; in auxtrace_buffer__drop_data()
1193 buffer->size = 0; in auxtrace_buffer__drop_data()
1212 auxtrace_error->header.type = PERF_RECORD_AUXTRACE_ERROR; in auxtrace_synth_guest_error()
1213 auxtrace_error->type = type; in auxtrace_synth_guest_error()
1214 auxtrace_error->code = code; in auxtrace_synth_guest_error()
1215 auxtrace_error->cpu = cpu; in auxtrace_synth_guest_error()
1216 auxtrace_error->pid = pid; in auxtrace_synth_guest_error()
1217 auxtrace_error->tid = tid; in auxtrace_synth_guest_error()
1218 auxtrace_error->fmt = 1; in auxtrace_synth_guest_error()
1219 auxtrace_error->ip = ip; in auxtrace_synth_guest_error()
1220 auxtrace_error->time = timestamp; in auxtrace_synth_guest_error()
1221 strlcpy(auxtrace_error->msg, msg, MAX_AUXTRACE_ERROR_MSG); in auxtrace_synth_guest_error()
1223 auxtrace_error->fmt = 2; in auxtrace_synth_guest_error()
1224 auxtrace_error->machine_pid = machine_pid; in auxtrace_synth_guest_error()
1225 auxtrace_error->vcpu = vcpu; in auxtrace_synth_guest_error()
1228 size = (void *)auxtrace_error->msg - (void *)auxtrace_error + in auxtrace_synth_guest_error()
1229 strlen(auxtrace_error->msg) + 1; in auxtrace_synth_guest_error()
1231 auxtrace_error->header.size = PERF_ALIGN(size, sizeof(u64)); in auxtrace_synth_guest_error()
1239 ip, msg, timestamp, 0, -1); in auxtrace_synth_error()
1252 priv_size = auxtrace_record__info_priv_size(itr, session->evlist); in perf_event__synthesize_auxtrace_info()
1255 return -ENOMEM; in perf_event__synthesize_auxtrace_info()
1257 ev->auxtrace_info.header.type = PERF_RECORD_AUXTRACE_INFO; in perf_event__synthesize_auxtrace_info()
1258 ev->auxtrace_info.header.size = sizeof(struct perf_record_auxtrace_info) + in perf_event__synthesize_auxtrace_info()
1260 err = auxtrace_record__info_fill(itr, session, &ev->auxtrace_info, in perf_event__synthesize_auxtrace_info()
1287 zfree(&new_leader->group_name); in unleader_evsel()
1288 new_leader->group_name = leader->group_name; in unleader_evsel()
1289 leader->group_name = NULL; in unleader_evsel()
1291 new_leader->core.nr_members = leader->core.nr_members - 1; in unleader_evsel()
1292 leader->core.nr_members = 1; in unleader_evsel()
1300 evlist__for_each_entry(session->evlist, evsel) { in unleader_auxtrace()
1303 unleader_evsel(session->evlist, evsel); in unleader_auxtrace()
1311 enum auxtrace_type type = event->auxtrace_info.type; in perf_event__process_auxtrace_info()
1338 return -EINVAL; in perf_event__process_auxtrace_info()
1355 …fprintf(stdout, " size: %#"PRI_lx64" offset: %#"PRI_lx64" ref: %#"PRI_lx64" idx: %u tid: %d c… in perf_event__process_auxtrace()
1356 event->auxtrace.size, event->auxtrace.offset, in perf_event__process_auxtrace()
1357 event->auxtrace.reference, event->auxtrace.idx, in perf_event__process_auxtrace()
1358 event->auxtrace.tid, event->auxtrace.cpu); in perf_event__process_auxtrace()
1361 return event->auxtrace.size; in perf_event__process_auxtrace()
1363 if (!session->auxtrace || event->header.type != PERF_RECORD_AUXTRACE) in perf_event__process_auxtrace()
1364 return -EINVAL; in perf_event__process_auxtrace()
1366 err = session->auxtrace->process_auxtrace_event(session, event, session->tool); in perf_event__process_auxtrace()
1370 return event->auxtrace.size; in perf_event__process_auxtrace()
1383 synth_opts->branches = true; in itrace_synth_opts__set_default()
1384 synth_opts->transactions = true; in itrace_synth_opts__set_default()
1385 synth_opts->ptwrites = true; in itrace_synth_opts__set_default()
1386 synth_opts->pwr_events = true; in itrace_synth_opts__set_default()
1387 synth_opts->other_events = true; in itrace_synth_opts__set_default()
1388 synth_opts->intr_events = true; in itrace_synth_opts__set_default()
1389 synth_opts->errors = true; in itrace_synth_opts__set_default()
1390 synth_opts->flc = true; in itrace_synth_opts__set_default()
1391 synth_opts->llc = true; in itrace_synth_opts__set_default()
1392 synth_opts->tlb = true; in itrace_synth_opts__set_default()
1393 synth_opts->mem = true; in itrace_synth_opts__set_default()
1394 synth_opts->remote_access = true; in itrace_synth_opts__set_default()
1397 synth_opts->period_type = PERF_ITRACE_PERIOD_INSTRUCTIONS; in itrace_synth_opts__set_default()
1398 synth_opts->period = 1; in itrace_synth_opts__set_default()
1399 synth_opts->calls = true; in itrace_synth_opts__set_default()
1401 synth_opts->instructions = true; in itrace_synth_opts__set_default()
1402 synth_opts->cycles = true; in itrace_synth_opts__set_default()
1403 synth_opts->period_type = PERF_ITRACE_DEFAULT_PERIOD_TYPE; in itrace_synth_opts__set_default()
1404 synth_opts->period = PERF_ITRACE_DEFAULT_PERIOD; in itrace_synth_opts__set_default()
1406 synth_opts->callchain_sz = PERF_ITRACE_DEFAULT_CALLCHAIN_SZ; in itrace_synth_opts__set_default()
1407 synth_opts->last_branch_sz = PERF_ITRACE_DEFAULT_LAST_BRANCH_SZ; in itrace_synth_opts__set_default()
1408 synth_opts->initial_skip = 0; in itrace_synth_opts__set_default()
1416 if (c >= 'a' && c <= 'z') { in get_flag()
1417 *flags |= 1 << (c - 'a'); in get_flag()
1424 return -1; in get_flag()
1436 return -1; in get_flags()
1438 case '-': in get_flags()
1441 return -1; in get_flags()
1458 perf_config_scan("itrace.debug-log-buffer-size", "%u", &sz); in itrace_log_on_error_size()
1463 * Please check tools/perf/Documentation/perf-script.txt for information
1476 synth_opts->set = true; in itrace_do_parse_synth_opts()
1479 synth_opts->dont_decode = true; in itrace_do_parse_synth_opts()
1485 synth_opts->default_no_sample); in itrace_do_parse_synth_opts()
1494 if (p[-1] == 'y') in itrace_do_parse_synth_opts()
1495 synth_opts->cycles = true; in itrace_do_parse_synth_opts()
1497 synth_opts->instructions = true; in itrace_do_parse_synth_opts()
1501 synth_opts->period = strtoull(p, &endptr, 10); in itrace_do_parse_synth_opts()
1508 synth_opts->period_type = in itrace_do_parse_synth_opts()
1513 synth_opts->period_type = in itrace_do_parse_synth_opts()
1518 synth_opts->period *= 1000; in itrace_do_parse_synth_opts()
1521 synth_opts->period *= 1000; in itrace_do_parse_synth_opts()
1526 synth_opts->period_type = in itrace_do_parse_synth_opts()
1538 synth_opts->branches = true; in itrace_do_parse_synth_opts()
1541 synth_opts->transactions = true; in itrace_do_parse_synth_opts()
1544 synth_opts->ptwrites = true; in itrace_do_parse_synth_opts()
1547 synth_opts->pwr_events = true; in itrace_do_parse_synth_opts()
1550 synth_opts->other_events = true; in itrace_do_parse_synth_opts()
1553 synth_opts->intr_events = true; in itrace_do_parse_synth_opts()
1556 synth_opts->errors = true; in itrace_do_parse_synth_opts()
1557 if (get_flags(&p, &synth_opts->error_plus_flags, in itrace_do_parse_synth_opts()
1558 &synth_opts->error_minus_flags)) in itrace_do_parse_synth_opts()
1562 synth_opts->log = true; in itrace_do_parse_synth_opts()
1563 if (get_flags(&p, &synth_opts->log_plus_flags, in itrace_do_parse_synth_opts()
1564 &synth_opts->log_minus_flags)) in itrace_do_parse_synth_opts()
1566 if (synth_opts->log_plus_flags & AUXTRACE_LOG_FLG_ON_ERROR) in itrace_do_parse_synth_opts()
1567 synth_opts->log_on_error_size = itrace_log_on_error_size(); in itrace_do_parse_synth_opts()
1570 synth_opts->branches = true; in itrace_do_parse_synth_opts()
1571 synth_opts->calls = true; in itrace_do_parse_synth_opts()
1574 synth_opts->branches = true; in itrace_do_parse_synth_opts()
1575 synth_opts->returns = true; in itrace_do_parse_synth_opts()
1579 if (p[-1] == 'G') in itrace_do_parse_synth_opts()
1580 synth_opts->add_callchain = true; in itrace_do_parse_synth_opts()
1582 synth_opts->callchain = true; in itrace_do_parse_synth_opts()
1583 synth_opts->callchain_sz = in itrace_do_parse_synth_opts()
1594 synth_opts->callchain_sz = val; in itrace_do_parse_synth_opts()
1599 if (p[-1] == 'L') in itrace_do_parse_synth_opts()
1600 synth_opts->add_last_branch = true; in itrace_do_parse_synth_opts()
1602 synth_opts->last_branch = true; in itrace_do_parse_synth_opts()
1603 synth_opts->last_branch_sz = in itrace_do_parse_synth_opts()
1615 synth_opts->last_branch_sz = val; in itrace_do_parse_synth_opts()
1619 synth_opts->initial_skip = strtoul(p, &endptr, 10); in itrace_do_parse_synth_opts()
1625 synth_opts->flc = true; in itrace_do_parse_synth_opts()
1628 synth_opts->llc = true; in itrace_do_parse_synth_opts()
1631 synth_opts->tlb = true; in itrace_do_parse_synth_opts()
1634 synth_opts->remote_access = true; in itrace_do_parse_synth_opts()
1637 synth_opts->mem = true; in itrace_do_parse_synth_opts()
1640 synth_opts->quick += 1; in itrace_do_parse_synth_opts()
1643 synth_opts->approx_ipc = true; in itrace_do_parse_synth_opts()
1645 case 'Z': in itrace_do_parse_synth_opts()
1646 synth_opts->timeless_decoding = true; in itrace_do_parse_synth_opts()
1649 synth_opts->use_timestamp = true; in itrace_do_parse_synth_opts()
1661 synth_opts->period_type = in itrace_do_parse_synth_opts()
1664 synth_opts->period = PERF_ITRACE_DEFAULT_PERIOD; in itrace_do_parse_synth_opts()
1671 return -EINVAL; in itrace_do_parse_synth_opts()
1676 return itrace_do_parse_synth_opts(opt->value, str, unset); in itrace_parse_synth_opts()
1696 struct perf_record_auxtrace_error *e = &event->auxtrace_error; in perf_event__fprintf_auxtrace_error()
1697 unsigned long long nsecs = e->time; in perf_event__fprintf_auxtrace_error()
1698 const char *msg = e->msg; in perf_event__fprintf_auxtrace_error()
1702 auxtrace_error_name(e->type), e->type); in perf_event__fprintf_auxtrace_error()
1704 if (e->fmt && nsecs) { in perf_event__fprintf_auxtrace_error()
1707 nsecs -= secs * NSEC_PER_SEC; in perf_event__fprintf_auxtrace_error()
1713 if (!e->fmt) in perf_event__fprintf_auxtrace_error()
1714 msg = (const char *)&e->time; in perf_event__fprintf_auxtrace_error()
1716 if (e->fmt >= 2 && e->machine_pid) in perf_event__fprintf_auxtrace_error()
1717 ret += fprintf(fp, " machine_pid %d vcpu %d", e->machine_pid, e->vcpu); in perf_event__fprintf_auxtrace_error()
1720 e->cpu, e->pid, e->tid, e->ip, e->code, msg); in perf_event__fprintf_auxtrace_error()
1727 struct perf_record_auxtrace_error *e = &event->auxtrace_error; in perf_session__auxtrace_error_inc()
1729 if (e->type < PERF_AUXTRACE_ERROR_MAX) in perf_session__auxtrace_error_inc()
1730 session->evlist->stats.nr_auxtrace_errors[e->type] += 1; in perf_session__auxtrace_error_inc()
1738 if (!stats->nr_auxtrace_errors[i]) in events_stats__auxtrace_error_warn()
1741 stats->nr_auxtrace_errors[i], in events_stats__auxtrace_error_warn()
1757 * In the compat mode kernel runs in 64-bit and perf tool runs in 32-bit mode,
1758 * 32-bit perf tool cannot access 64-bit value atomically, which might lead to
1760 * accesses either the load operation or the store operation for 64-bit value,
1762 * is for accessing the low 32-bit value and another is for the high 32-bit;
1764 * 64-bit value, and thus leads to the unexpected load values.
1766 * kernel (64-bit) user (32-bit)
1768 * if (LOAD ->aux_tail) { --, LOAD ->aux_head_lo
1769 * STORE $aux_data | ,--->
1770 * FLUSH $aux_data | | LOAD ->aux_head_hi
1771 * STORE ->aux_head --|-------` smp_rmb()
1774 * | STORE ->aux_tail_lo
1775 * `----------->
1776 * STORE ->aux_tail_hi
1783 * high 32-bit.
1790 * compares the high 4 bytes of the values between the first time and the last
1791 * time, if there has no change for high 4 bytes injected by the kernel during
1794 * When compat_auxtrace_mmap__write_tail() detects any carrying in the high
1796 * promise the atomicity for 64-bit write, so return '-1' in this case to tell
1801 struct perf_event_mmap_page *pc = mm->userpg; in compat_auxtrace_mmap__read_head()
1806 first = READ_ONCE(pc->aux_head); in compat_auxtrace_mmap__read_head()
1809 second = READ_ONCE(pc->aux_head); in compat_auxtrace_mmap__read_head()
1812 last = READ_ONCE(pc->aux_head); in compat_auxtrace_mmap__read_head()
1820 struct perf_event_mmap_page *pc = mm->userpg; in compat_auxtrace_mmap__write_tail()
1824 return -1; in compat_auxtrace_mmap__write_tail()
1828 WRITE_ONCE(pc->aux_tail, tail); in compat_auxtrace_mmap__write_tail()
1837 struct auxtrace_mmap *mm = &map->auxtrace_mmap; in __auxtrace_mmap__read()
1838 u64 head, old = mm->prev, offset, ref; in __auxtrace_mmap__read() local
1839 unsigned char *data = mm->base; in __auxtrace_mmap__read()
1848 auxtrace_record__find_snapshot(itr, mm->idx, mm, data, &head, &old)) in __auxtrace_mmap__read()
1849 return -1; in __auxtrace_mmap__read()
1855 mm->idx, old, head, head - old); in __auxtrace_mmap__read()
1857 if (mm->mask) { in __auxtrace_mmap__read()
1858 head_off = head & mm->mask; in __auxtrace_mmap__read()
1859 old_off = old & mm->mask; in __auxtrace_mmap__read()
1861 head_off = head % mm->len; in __auxtrace_mmap__read()
1862 old_off = old % mm->len; in __auxtrace_mmap__read()
1866 size = head_off - old_off; in __auxtrace_mmap__read()
1868 size = mm->len - (old_off - head_off); in __auxtrace_mmap__read()
1873 ref = auxtrace_record__reference(itr); in __auxtrace_mmap__read()
1875 if (head > old || size <= head || mm->mask) { in __auxtrace_mmap__read()
1876 offset = head - size; in __auxtrace_mmap__read()
1883 u64 rem = (0ULL - mm->len) % mm->len; in __auxtrace_mmap__read()
1885 offset = head - size - rem; in __auxtrace_mmap__read()
1889 len1 = size - head_off; in __auxtrace_mmap__read()
1890 data1 = &data[mm->len - len1]; in __auxtrace_mmap__read()
1895 data1 = &data[head_off - len1]; in __auxtrace_mmap__read()
1900 if (itr->alignment) { in __auxtrace_mmap__read()
1901 unsigned int unwanted = len1 % itr->alignment; in __auxtrace_mmap__read()
1903 len1 -= unwanted; in __auxtrace_mmap__read()
1904 size -= unwanted; in __auxtrace_mmap__read()
1908 padding = size & (PERF_AUXTRACE_RECORD_ALIGNMENT - 1); in __auxtrace_mmap__read()
1910 padding = PERF_AUXTRACE_RECORD_ALIGNMENT - padding; in __auxtrace_mmap__read()
1917 ev.auxtrace.reference = ref; in __auxtrace_mmap__read()
1918 ev.auxtrace.idx = mm->idx; in __auxtrace_mmap__read()
1919 ev.auxtrace.tid = mm->tid; in __auxtrace_mmap__read()
1920 ev.auxtrace.cpu = mm->cpu; in __auxtrace_mmap__read()
1923 return -1; in __auxtrace_mmap__read()
1925 mm->prev = head; in __auxtrace_mmap__read()
1934 if (itr->read_finish) { in __auxtrace_mmap__read()
1935 err = itr->read_finish(itr, mm->idx); in __auxtrace_mmap__read()
1959 * struct auxtrace_cache - hash table to implement a cache
1997 c->hashtable = ht; in auxtrace_cache__new()
1998 c->sz = sz; in auxtrace_cache__new()
1999 c->entry_size = entry_size; in auxtrace_cache__new()
2000 c->limit = (c->sz * limit_percent) / 100; in auxtrace_cache__new()
2001 c->bits = bits; in auxtrace_cache__new()
2019 for (i = 0; i < c->sz; i++) { in auxtrace_cache__drop()
2020 hlist_for_each_entry_safe(entry, tmp, &c->hashtable[i], hash) { in auxtrace_cache__drop()
2021 hlist_del(&entry->hash); in auxtrace_cache__drop()
2026 c->cnt = 0; in auxtrace_cache__drop()
2035 zfree(&c->hashtable); in auxtrace_cache__free()
2041 return malloc(c->entry_size); in auxtrace_cache__alloc_entry()
2053 if (c->limit && ++c->cnt > c->limit) in auxtrace_cache__add()
2056 entry->key = key; in auxtrace_cache__add()
2057 hlist_add_head(&entry->hash, &c->hashtable[hash_32(key, c->bits)]); in auxtrace_cache__add()
2072 hlist = &c->hashtable[hash_32(key, c->bits)]; in auxtrace_cache__rm()
2074 if (entry->key == key) { in auxtrace_cache__rm()
2075 hlist_del(&entry->hash); in auxtrace_cache__rm()
2098 hlist = &c->hashtable[hash_32(key, c->bits)]; in auxtrace_cache__lookup()
2100 if (entry->key == key) in auxtrace_cache__lookup()
2109 zfree(&filt->str); in addr_filter__free_str()
2110 filt->action = NULL; in addr_filter__free_str()
2111 filt->sym_from = NULL; in addr_filter__free_str()
2112 filt->sym_to = NULL; in addr_filter__free_str()
2113 filt->filename = NULL; in addr_filter__free_str()
2121 INIT_LIST_HEAD(&filt->list); in addr_filter__new()
2136 list_add_tail(&filt->list, &filts->head); in addr_filters__add()
2137 filts->cnt += 1; in addr_filters__add()
2143 list_del_init(&filt->list); in addr_filters__del()
2144 filts->cnt -= 1; in addr_filters__del()
2149 INIT_LIST_HEAD(&filts->head); in addr_filters__init()
2150 filts->cnt = 0; in addr_filters__init()
2157 list_for_each_entry_safe(filt, n, &filts->head, list) { in addr_filters__exit()
2172 return -EINVAL; in parse_num_or_str()
2176 return -errno; in parse_num_or_str()
2178 return -EINVAL; in parse_num_or_str()
2184 return -EINVAL; in parse_num_or_str()
2189 return -EINVAL; in parse_num_or_str()
2201 if (!strcmp(filt->action, "filter")) { in parse_action()
2202 filt->start = true; in parse_action()
2203 filt->range = true; in parse_action()
2204 } else if (!strcmp(filt->action, "start")) { in parse_action()
2205 filt->start = true; in parse_action()
2206 } else if (!strcmp(filt->action, "stop")) { in parse_action()
2207 filt->start = false; in parse_action()
2208 } else if (!strcmp(filt->action, "tracestop")) { in parse_action()
2209 filt->start = false; in parse_action()
2210 filt->range = true; in parse_action()
2211 filt->action += 5; /* Change 'tracestop' to 'stop' */ in parse_action()
2213 return -EINVAL; in parse_action()
2220 *idx = -1; in parse_sym_idx()
2239 return -errno; in parse_sym_idx()
2241 return -EINVAL; in parse_sym_idx()
2264 filt->str = fstr = strdup(*filter_inp); in parse_one_filter()
2266 return -ENOMEM; in parse_one_filter()
2268 err = parse_num_or_str(&fstr, NULL, &filt->action, " "); in parse_one_filter()
2276 err = parse_addr_size(&fstr, &filt->addr, &filt->sym_from, in parse_one_filter()
2277 &filt->sym_from_idx); in parse_one_filter()
2285 err = parse_addr_size(&fstr, &filt->size, &filt->sym_to, in parse_one_filter()
2286 &filt->sym_to_idx); in parse_one_filter()
2289 filt->range = true; in parse_one_filter()
2296 err = parse_num_or_str(&fstr, NULL, &filt->filename, " ,"); in parse_one_filter()
2303 *filter_inp += fstr - filt->str; in parse_one_filter()
2359 kern_sym_name_match(name, args->name) && in kern_sym_match()
2360 ((args->global && isupper(type)) || in kern_sym_match()
2361 (args->selected && ++(args->cnt) == args->idx) || in kern_sym_match()
2362 (!args->global && !args->selected)); in kern_sym_match()
2369 if (args->started) { in find_kern_sym_cb()
2370 if (!args->size) in find_kern_sym_cb()
2371 args->size = start - args->start; in find_kern_sym_cb()
2372 if (args->selected) { in find_kern_sym_cb()
2373 if (args->size) in find_kern_sym_cb()
2376 args->duplicate = true; in find_kern_sym_cb()
2380 args->started = true; in find_kern_sym_cb()
2381 args->start = start; in find_kern_sym_cb()
2393 ++args->cnt, start, type, name); in print_kern_sym_cb()
2394 args->near = true; in print_kern_sym_cb()
2395 } else if (args->near) { in print_kern_sym_cb()
2396 args->near = false; in print_kern_sym_cb()
2415 return -EINVAL; in sym_not_found_error()
2444 return -EINVAL; in find_kern_sym()
2467 if (!args->started) { in find_entire_kern_cb()
2468 args->started = true; in find_entire_kern_cb()
2469 args->start = start; in find_entire_kern_cb()
2472 size = round_up(start, page_size) + page_size - args->start; in find_entire_kern_cb()
2473 if (size > args->size) in find_entire_kern_cb()
2474 args->size = size; in find_entire_kern_cb()
2490 filt->addr = args.start; in addr_filter__entire_kernel()
2491 filt->size = args.size; in addr_filter__entire_kernel()
2498 if (start + size >= filt->addr) in check_end_after_start()
2501 if (filt->sym_from) { in check_end_after_start()
2503 filt->sym_to, start, filt->sym_from, filt->addr); in check_end_after_start()
2506 filt->sym_to, start, filt->addr); in check_end_after_start()
2509 return -EINVAL; in check_end_after_start()
2520 return -EINVAL; in addr_filter__resolve_kernel_syms()
2523 if (filt->sym_from && !strcmp(filt->sym_from, "*")) in addr_filter__resolve_kernel_syms()
2526 if (filt->sym_from) { in addr_filter__resolve_kernel_syms()
2527 err = find_kern_sym(filt->sym_from, &start, &size, in addr_filter__resolve_kernel_syms()
2528 filt->sym_from_idx); in addr_filter__resolve_kernel_syms()
2531 filt->addr = start; in addr_filter__resolve_kernel_syms()
2532 if (filt->range && !filt->size && !filt->sym_to) { in addr_filter__resolve_kernel_syms()
2533 filt->size = size; in addr_filter__resolve_kernel_syms()
2538 if (filt->sym_to) { in addr_filter__resolve_kernel_syms()
2539 err = find_kern_sym(filt->sym_to, &start, &size, in addr_filter__resolve_kernel_syms()
2540 filt->sym_to_idx); in addr_filter__resolve_kernel_syms()
2547 filt->size = start + size - filt->addr; in addr_filter__resolve_kernel_syms()
2554 filt->sym_to ? filt->sym_to : filt->sym_from); in addr_filter__resolve_kernel_syms()
2555 return -EINVAL; in addr_filter__resolve_kernel_syms()
2571 pr_err("File '%s' not found or has no symbols.\n", name); in load_dso()
2584 return !arch__compare_symbol_names(name, sym->name) && in dso_sym_match()
2585 ((!idx && sym->binding == STB_GLOBAL) || in dso_sym_match()
2600 if (dso_sym_match(sym, sym_name, &cnt, -1)) { in print_duplicate_syms()
2602 ++cnt, sym->start, in print_duplicate_syms()
2603 sym->binding == STB_GLOBAL ? 'g' : in print_duplicate_syms()
2604 sym->binding == STB_LOCAL ? 'l' : 'w', in print_duplicate_syms()
2605 sym->name); in print_duplicate_syms()
2609 pr_err("\t\twhich is near\t\t%s\n", sym->name); in print_duplicate_syms()
2632 *size = sym->start - *start; in find_dso_sym()
2638 return -EINVAL; in find_dso_sym()
2641 *start = sym->start; in find_dso_sym()
2642 *size = sym->end - sym->start; in find_dso_sym()
2657 filt->filename); in addr_filter__entire_dso()
2658 return -EINVAL; in addr_filter__entire_dso()
2661 filt->addr = 0; in addr_filter__entire_dso()
2662 filt->size = dso__data(dso)->file_size; in addr_filter__entire_dso()
2673 if (!filt->sym_from && !filt->sym_to) in addr_filter__resolve_syms()
2676 if (!filt->filename) in addr_filter__resolve_syms()
2679 dso = load_dso(filt->filename); in addr_filter__resolve_syms()
2681 pr_err("Failed to load symbols from: %s\n", filt->filename); in addr_filter__resolve_syms()
2682 return -EINVAL; in addr_filter__resolve_syms()
2685 if (filt->sym_from && !strcmp(filt->sym_from, "*")) { in addr_filter__resolve_syms()
2690 if (filt->sym_from) { in addr_filter__resolve_syms()
2691 err = find_dso_sym(dso, filt->sym_from, &start, &size, in addr_filter__resolve_syms()
2692 filt->sym_from_idx); in addr_filter__resolve_syms()
2695 filt->addr = start; in addr_filter__resolve_syms()
2696 if (filt->range && !filt->size && !filt->sym_to) in addr_filter__resolve_syms()
2697 filt->size = size; in addr_filter__resolve_syms()
2700 if (filt->sym_to) { in addr_filter__resolve_syms()
2701 err = find_dso_sym(dso, filt->sym_to, &start, &size, in addr_filter__resolve_syms()
2702 filt->sym_to_idx); in addr_filter__resolve_syms()
2710 filt->size = start + size - filt->addr; in addr_filter__resolve_syms()
2727 if (filt->filename) { in addr_filter__to_str()
2729 fn = realpath(filt->filename, filename_buf); in addr_filter__to_str()
2734 if (filt->range) { in addr_filter__to_str()
2736 filt->action, filt->addr, filt->size, at, fn); in addr_filter__to_str()
2739 filt->action, filt->addr, at, fn); in addr_filter__to_str()
2761 err = -EINVAL; in parse_addr_filter()
2774 err = -ENOMEM; in parse_addr_filter()
2779 err = -ENOMEM; in parse_addr_filter()
2816 filter = evsel->filter; in auxtrace_parse_filters()
2820 evsel->filter = NULL; in auxtrace_parse_filters()
2825 pr_debug("Address filter: %s\n", evsel->filter); in auxtrace_parse_filters()
2834 if (!session->auxtrace) in auxtrace__process_event()
2837 return session->auxtrace->process_event(session, event, sample, tool); in auxtrace__process_event()
2843 if (!session->auxtrace || !session->auxtrace->dump_auxtrace_sample || in auxtrace__dump_auxtrace_sample()
2847 session->auxtrace->dump_auxtrace_sample(session, sample); in auxtrace__dump_auxtrace_sample()
2852 if (!session->auxtrace) in auxtrace__flush_events()
2855 return session->auxtrace->flush_events(session, tool); in auxtrace__flush_events()
2860 if (!session->auxtrace) in auxtrace__free_events()
2863 return session->auxtrace->free_events(session); in auxtrace__free_events()
2868 if (!session->auxtrace) in auxtrace__free()
2871 return session->auxtrace->free(session); in auxtrace__free()
2877 if (!session->auxtrace || !session->auxtrace->evsel_is_auxtrace) in auxtrace__evsel_is_auxtrace()
2880 return session->auxtrace->evsel_is_auxtrace(session, evsel); in auxtrace__evsel_is_auxtrace()