Lines Matching +full:term +full:- +full:range +full:- +full:adj
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__empty(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 = AUXTRACE_INIT_NR_QUEUES; in auxtrace_queues__init()
224 queues->queue_array = auxtrace_alloc_queue_array(queues->nr_queues); in auxtrace_queues__init()
225 if (!queues->queue_array) in auxtrace_queues__init()
226 return -ENOMEM; in auxtrace_queues__init()
233 unsigned int nr_queues = queues->nr_queues; in auxtrace_queues__grow()
243 if (nr_queues < queues->nr_queues || nr_queues < new_nr_queues) in auxtrace_queues__grow()
244 return -EINVAL; in auxtrace_queues__grow()
248 return -ENOMEM; in auxtrace_queues__grow()
250 for (i = 0; i < queues->nr_queues; i++) { in auxtrace_queues__grow()
251 list_splice_tail(&queues->queue_array[i].head, in auxtrace_queues__grow()
253 queue_array[i].tid = queues->queue_array[i].tid; in auxtrace_queues__grow()
254 queue_array[i].cpu = queues->queue_array[i].cpu; in auxtrace_queues__grow()
255 queue_array[i].set = queues->queue_array[i].set; in auxtrace_queues__grow()
256 queue_array[i].priv = queues->queue_array[i].priv; in auxtrace_queues__grow()
259 queues->nr_queues = nr_queues; in auxtrace_queues__grow()
260 queues->queue_array = queue_array; in auxtrace_queues__grow()
267 int fd = perf_data__fd(session->data); in auxtrace_copy_data()
294 if (idx >= queues->nr_queues) { in auxtrace_queues__queue_buffer()
300 queue = &queues->queue_array[idx]; in auxtrace_queues__queue_buffer()
302 if (!queue->set) { in auxtrace_queues__queue_buffer()
303 queue->set = true; in auxtrace_queues__queue_buffer()
304 queue->tid = buffer->tid; in auxtrace_queues__queue_buffer()
305 queue->cpu = buffer->cpu.cpu; in auxtrace_queues__queue_buffer()
308 buffer->buffer_nr = queues->next_buffer_nr++; in auxtrace_queues__queue_buffer()
310 list_add_tail(&buffer->list, &queue->head); in auxtrace_queues__queue_buffer()
312 queues->new_data = true; in auxtrace_queues__queue_buffer()
313 queues->populated = true; in auxtrace_queues__queue_buffer()
318 /* Limit buffers to 32MiB on 32-bit */
325 u64 sz = buffer->size; in auxtrace_queues__split_buffer()
333 return -ENOMEM; in auxtrace_queues__split_buffer()
334 b->size = BUFFER_LIMIT_FOR_32_BIT; in auxtrace_queues__split_buffer()
335 b->consecutive = consecutive; in auxtrace_queues__split_buffer()
341 buffer->data_offset += BUFFER_LIMIT_FOR_32_BIT; in auxtrace_queues__split_buffer()
342 sz -= BUFFER_LIMIT_FOR_32_BIT; in auxtrace_queues__split_buffer()
346 buffer->size = sz; in auxtrace_queues__split_buffer()
347 buffer->consecutive = consecutive; in auxtrace_queues__split_buffer()
354 unsigned long *cpu_bitmap = session->itrace_synth_opts->cpu_bitmap; in filter_cpu()
356 return cpu_bitmap && cpu.cpu != -1 && !test_bit(cpu.cpu, cpu_bitmap); in filter_cpu()
365 int err = -ENOMEM; in auxtrace_queues__add_buffer()
367 if (filter_cpu(session, buffer->cpu)) in auxtrace_queues__add_buffer()
372 return -ENOMEM; in auxtrace_queues__add_buffer()
374 if (session->one_mmap) { in auxtrace_queues__add_buffer()
375 buffer->data = buffer->data_offset - session->one_mmap_offset + in auxtrace_queues__add_buffer()
376 session->one_mmap_addr; in auxtrace_queues__add_buffer()
377 } else if (perf_data__is_pipe(session->data)) { in auxtrace_queues__add_buffer()
378 buffer->data = auxtrace_copy_data(buffer->size, session); in auxtrace_queues__add_buffer()
379 if (!buffer->data) in auxtrace_queues__add_buffer()
381 buffer->data_needs_freeing = true; in auxtrace_queues__add_buffer()
383 buffer->size > BUFFER_LIMIT_FOR_32_BIT) { in auxtrace_queues__add_buffer()
410 .pid = -1, in auxtrace_queues__add_event()
411 .tid = event->auxtrace.tid, in auxtrace_queues__add_event()
412 .cpu = { event->auxtrace.cpu }, in auxtrace_queues__add_event()
414 .offset = event->auxtrace.offset, in auxtrace_queues__add_event()
415 .reference = event->auxtrace.reference, in auxtrace_queues__add_event()
416 .size = event->auxtrace.size, in auxtrace_queues__add_event()
418 unsigned int idx = event->auxtrace.idx; in auxtrace_queues__add_event()
437 if (event->header.type == PERF_RECORD_AUXTRACE) { in auxtrace_queues__add_indexed_event()
438 if (event->header.size < sizeof(struct perf_record_auxtrace) || in auxtrace_queues__add_indexed_event()
439 event->header.size != sz) { in auxtrace_queues__add_indexed_event()
440 err = -EINVAL; in auxtrace_queues__add_indexed_event()
443 file_offset += event->header.size; in auxtrace_queues__add_indexed_event()
455 for (i = 0; i < queues->nr_queues; i++) { in auxtrace_queues__free()
456 while (!list_empty(&queues->queue_array[i].head)) { in auxtrace_queues__free()
459 buffer = list_entry(queues->queue_array[i].head.next, in auxtrace_queues__free()
461 list_del_init(&buffer->list); in auxtrace_queues__free()
466 zfree(&queues->queue_array); in auxtrace_queues__free()
467 queues->nr_queues = 0; in auxtrace_queues__free()
477 parent = (pos - 1) >> 1; in auxtrace_heapify()
492 if (queue_nr >= heap->heap_sz) { in auxtrace_heap__add()
497 heap_array = realloc(heap->heap_array, in auxtrace_heap__add()
500 return -ENOMEM; in auxtrace_heap__add()
501 heap->heap_array = heap_array; in auxtrace_heap__add()
502 heap->heap_sz = heap_sz; in auxtrace_heap__add()
505 auxtrace_heapify(heap->heap_array, heap->heap_cnt++, queue_nr, ordinal); in auxtrace_heap__add()
512 zfree(&heap->heap_array); in auxtrace_heap__free()
513 heap->heap_cnt = 0; in auxtrace_heap__free()
514 heap->heap_sz = 0; in auxtrace_heap__free()
519 unsigned int pos, last, heap_cnt = heap->heap_cnt; in auxtrace_heap__pop()
525 heap->heap_cnt -= 1; in auxtrace_heap__pop()
527 heap_array = heap->heap_array; in auxtrace_heap__pop()
550 last = heap_cnt - 1; in auxtrace_heap__pop()
559 return itr->info_priv_size(itr, evlist); in auxtrace_record__info_priv_size()
566 return -EINVAL; in auxtrace_not_supported()
575 return itr->info_fill(itr, session, auxtrace_info, priv_size); in auxtrace_record__info_fill()
582 itr->free(itr); in auxtrace_record__free()
587 if (itr && itr->snapshot_start) in auxtrace_record__snapshot_start()
588 return itr->snapshot_start(itr); in auxtrace_record__snapshot_start()
594 if (!on_exit && itr && itr->snapshot_finish) in auxtrace_record__snapshot_finish()
595 return itr->snapshot_finish(itr); in auxtrace_record__snapshot_finish()
603 if (itr && itr->find_snapshot) in auxtrace_record__find_snapshot()
604 return itr->find_snapshot(itr, idx, mm, data, head, old); in auxtrace_record__find_snapshot()
613 itr->evlist = evlist; in auxtrace_record__options()
614 return itr->recording_options(itr, evlist, opts); in auxtrace_record__options()
622 return itr->reference(itr); in auxtrace_record__reference()
632 /* PMU-agnostic options */ in auxtrace_parse_snapshot_options()
635 opts->auxtrace_snapshot_on_exit = true; in auxtrace_parse_snapshot_options()
642 if (itr && itr->parse_snapshot_options) in auxtrace_parse_snapshot_options()
643 return itr->parse_snapshot_options(itr, opts, str); in auxtrace_parse_snapshot_options()
646 return -EINVAL; in auxtrace_parse_snapshot_options()
651 bool per_cpu_mmaps = !perf_cpu_map__empty(evlist->core.user_requested_cpus); in evlist__enable_event_idx()
654 struct perf_cpu evlist_cpu = perf_cpu_map__cpu(evlist->core.all_cpus, idx); in evlist__enable_event_idx()
655 int cpu_map_idx = perf_cpu_map__idx(evsel->core.cpus, evlist_cpu); in evlist__enable_event_idx()
657 if (cpu_map_idx == -1) in evlist__enable_event_idx()
658 return -EINVAL; in evlist__enable_event_idx()
659 return perf_evsel__enable_cpu(&evsel->core, cpu_map_idx); in evlist__enable_event_idx()
662 return perf_evsel__enable_thread(&evsel->core, idx); in evlist__enable_event_idx()
669 if (!itr->evlist || !itr->pmu) in auxtrace_record__read_finish()
670 return -EINVAL; in auxtrace_record__read_finish()
672 evlist__for_each_entry(itr->evlist, evsel) { in auxtrace_record__read_finish()
673 if (evsel->core.attr.type == itr->pmu->type) { in auxtrace_record__read_finish()
674 if (evsel->disabled) in auxtrace_record__read_finish()
676 return evlist__enable_event_idx(itr->evlist, evsel, idx); in auxtrace_record__read_finish()
679 return -EINVAL; in auxtrace_record__read_finish()
683 * Event record size is 16-bit which results in a maximum size of about 64KiB.
700 sz = evsel->core.attr.aux_sample_size; in auxtrace_validate_aux_sample_size()
708 return -EINVAL; in auxtrace_validate_aux_sample_size()
714 return -EINVAL; in auxtrace_validate_aux_sample_size()
719 return -EINVAL; in auxtrace_validate_aux_sample_size()
722 opts->auxtrace_sample_mode = true; in auxtrace_validate_aux_sample_size()
728 if (!opts->auxtrace_sample_mode) { in auxtrace_validate_aux_sample_size()
730 return -EINVAL; in auxtrace_validate_aux_sample_size()
735 return -EINVAL; in auxtrace_validate_aux_sample_size()
745 struct evsel_config_term *term; in auxtrace_parse_sample_options() local
758 return -EINVAL; in auxtrace_parse_sample_options()
764 return -EINVAL; in auxtrace_parse_sample_options()
768 sz = itr->default_aux_sample_size; in auxtrace_parse_sample_options()
773 /* Set aux_sample_size based on --aux-sample option */ in auxtrace_parse_sample_options()
778 evsel->core.attr.aux_sample_size = sz; in auxtrace_parse_sample_options()
783 /* Override with aux_sample_size from config term */ in auxtrace_parse_sample_options()
787 term = evsel__get_config_term(evsel, AUX_SAMPLE_SIZE); in auxtrace_parse_sample_options()
788 if (term) { in auxtrace_parse_sample_options()
790 evsel->core.attr.aux_sample_size = term->val.aux_sample_size; in auxtrace_parse_sample_options()
792 if (aux_evsel && evsel->core.attr.aux_sample_size) in auxtrace_parse_sample_options()
802 return -EINVAL; in auxtrace_parse_sample_options()
811 struct evsel_config_term *term; in auxtrace_regroup_aux_output() local
816 term = evsel__get_config_term(evsel, AUX_OUTPUT); in auxtrace_regroup_aux_output()
818 if (term && aux_evsel) in auxtrace_regroup_aux_output()
836 return -ENOMEM; in auxtrace_index__alloc()
838 auxtrace_index->nr = 0; in auxtrace_index__alloc()
839 INIT_LIST_HEAD(&auxtrace_index->list); in auxtrace_index__alloc()
841 list_add_tail(&auxtrace_index->list, head); in auxtrace_index__alloc()
851 list_del_init(&auxtrace_index->list); in auxtrace_index__free()
867 auxtrace_index = list_entry(head->prev, struct auxtrace_index, list); in auxtrace_index__last()
869 if (auxtrace_index->nr >= PERF_AUXTRACE_INDEX_ENTRY_COUNT) { in auxtrace_index__last()
873 auxtrace_index = list_entry(head->prev, struct auxtrace_index, in auxtrace_index__last()
888 return -ENOMEM; in auxtrace_index__auxtrace_event()
890 nr = auxtrace_index->nr; in auxtrace_index__auxtrace_event()
891 auxtrace_index->entries[nr].file_offset = file_offset; in auxtrace_index__auxtrace_event()
892 auxtrace_index->entries[nr].sz = event->header.size; in auxtrace_index__auxtrace_event()
893 auxtrace_index->nr += 1; in auxtrace_index__auxtrace_event()
904 for (i = 0; i < auxtrace_index->nr; i++) { in auxtrace_index__do_write()
905 ent.file_offset = auxtrace_index->entries[i].file_offset; in auxtrace_index__do_write()
906 ent.sz = auxtrace_index->entries[i].sz; in auxtrace_index__do_write()
908 return -errno; in auxtrace_index__do_write()
920 total += auxtrace_index->nr; in auxtrace_index__write()
923 return -errno; in auxtrace_index__write()
942 return -1; in auxtrace_index__process_entry()
946 return -1; in auxtrace_index__process_entry()
948 nr = auxtrace_index->nr; in auxtrace_index__process_entry()
950 auxtrace_index->entries[nr].file_offset = in auxtrace_index__process_entry()
952 auxtrace_index->entries[nr].sz = bswap_64(ent.sz); in auxtrace_index__process_entry()
954 auxtrace_index->entries[nr].file_offset = ent.file_offset; in auxtrace_index__process_entry()
955 auxtrace_index->entries[nr].sz = ent.sz; in auxtrace_index__process_entry()
958 auxtrace_index->nr = nr + 1; in auxtrace_index__process_entry()
966 struct list_head *head = &session->auxtrace_index; in auxtrace_index__process()
970 return -1; in auxtrace_index__process()
976 return -1; in auxtrace_index__process()
978 while (nr--) { in auxtrace_index__process()
983 return -1; in auxtrace_index__process()
994 ent->file_offset, ent->sz); in auxtrace_queues__process_index_entry()
1008 list_for_each_entry(auxtrace_index, &session->auxtrace_index, list) { in auxtrace_queues__process_index()
1009 for (i = 0; i < auxtrace_index->nr; i++) { in auxtrace_queues__process_index()
1010 ent = &auxtrace_index->entries[i]; in auxtrace_queues__process_index()
1025 if (list_is_last(&buffer->list, &queue->head)) in auxtrace_buffer__next()
1027 return list_entry(buffer->list.next, struct auxtrace_buffer, in auxtrace_buffer__next()
1030 if (list_empty(&queue->head)) in auxtrace_buffer__next()
1032 return list_entry(queue->head.next, struct auxtrace_buffer, in auxtrace_buffer__next()
1045 id = sample->id; in auxtrace_queues__sample_queue()
1049 sid = evlist__id2sid(session->evlist, id); in auxtrace_queues__sample_queue()
1053 idx = sid->idx; in auxtrace_queues__sample_queue()
1055 if (idx >= queues->nr_queues) in auxtrace_queues__sample_queue()
1058 return &queues->queue_array[idx]; in auxtrace_queues__sample_queue()
1067 .pid = -1, in auxtrace_queues__add_sample()
1070 .size = sample->aux_sample.size, in auxtrace_queues__add_sample()
1073 u64 id = sample->id; in auxtrace_queues__add_sample()
1077 return -EINVAL; in auxtrace_queues__add_sample()
1079 sid = evlist__id2sid(session->evlist, id); in auxtrace_queues__add_sample()
1081 return -ENOENT; in auxtrace_queues__add_sample()
1083 idx = sid->idx; in auxtrace_queues__add_sample()
1084 buffer.tid = sid->tid; in auxtrace_queues__add_sample()
1085 buffer.cpu = sid->cpu; in auxtrace_queues__add_sample()
1103 if (qd->events && event->header.type == PERF_RECORD_AUXTRACE) { in auxtrace_queue_data_cb()
1104 if (event->header.size < sizeof(struct perf_record_auxtrace)) in auxtrace_queue_data_cb()
1105 return -EINVAL; in auxtrace_queue_data_cb()
1106 offset += event->header.size; in auxtrace_queue_data_cb()
1107 return session->auxtrace->queue_data(session, NULL, event, in auxtrace_queue_data_cb()
1111 if (!qd->samples || event->header.type != PERF_RECORD_SAMPLE) in auxtrace_queue_data_cb()
1114 err = evlist__parse_sample(session->evlist, event, &sample); in auxtrace_queue_data_cb()
1121 offset += sample.aux_sample.data - (void *)event; in auxtrace_queue_data_cb()
1123 return session->auxtrace->queue_data(session, &sample, NULL, offset); in auxtrace_queue_data_cb()
1136 if (perf_data__is_pipe(session->data)) in auxtrace_queue_data()
1139 if (!session->auxtrace || !session->auxtrace->queue_data) in auxtrace_queue_data()
1140 return -EINVAL; in auxtrace_queue_data()
1142 return perf_session__peek_events(session, session->header.data_offset, in auxtrace_queue_data()
1143 session->header.data_size, in auxtrace_queue_data()
1150 size_t adj = buffer->data_offset & (page_size - 1); in auxtrace_buffer__get_data_rw() local
1151 size_t size = buffer->size + adj; in auxtrace_buffer__get_data_rw()
1152 off_t file_offset = buffer->data_offset - adj; in auxtrace_buffer__get_data_rw()
1155 if (buffer->data) in auxtrace_buffer__get_data_rw()
1156 return buffer->data; in auxtrace_buffer__get_data_rw()
1162 buffer->mmap_addr = addr; in auxtrace_buffer__get_data_rw()
1163 buffer->mmap_size = size; in auxtrace_buffer__get_data_rw()
1165 buffer->data = addr + adj; in auxtrace_buffer__get_data_rw()
1167 return buffer->data; in auxtrace_buffer__get_data_rw()
1172 if (!buffer->data || !buffer->mmap_addr) in auxtrace_buffer__put_data()
1174 munmap(buffer->mmap_addr, buffer->mmap_size); in auxtrace_buffer__put_data()
1175 buffer->mmap_addr = NULL; in auxtrace_buffer__put_data()
1176 buffer->mmap_size = 0; in auxtrace_buffer__put_data()
1177 buffer->data = NULL; in auxtrace_buffer__put_data()
1178 buffer->use_data = NULL; in auxtrace_buffer__put_data()
1184 if (buffer->data_needs_freeing) { in auxtrace_buffer__drop_data()
1185 buffer->data_needs_freeing = false; in auxtrace_buffer__drop_data()
1186 zfree(&buffer->data); in auxtrace_buffer__drop_data()
1187 buffer->use_data = NULL; in auxtrace_buffer__drop_data()
1188 buffer->size = 0; in auxtrace_buffer__drop_data()
1207 auxtrace_error->header.type = PERF_RECORD_AUXTRACE_ERROR; in auxtrace_synth_guest_error()
1208 auxtrace_error->type = type; in auxtrace_synth_guest_error()
1209 auxtrace_error->code = code; in auxtrace_synth_guest_error()
1210 auxtrace_error->cpu = cpu; in auxtrace_synth_guest_error()
1211 auxtrace_error->pid = pid; in auxtrace_synth_guest_error()
1212 auxtrace_error->tid = tid; in auxtrace_synth_guest_error()
1213 auxtrace_error->fmt = 1; in auxtrace_synth_guest_error()
1214 auxtrace_error->ip = ip; in auxtrace_synth_guest_error()
1215 auxtrace_error->time = timestamp; in auxtrace_synth_guest_error()
1216 strlcpy(auxtrace_error->msg, msg, MAX_AUXTRACE_ERROR_MSG); in auxtrace_synth_guest_error()
1218 auxtrace_error->fmt = 2; in auxtrace_synth_guest_error()
1219 auxtrace_error->machine_pid = machine_pid; in auxtrace_synth_guest_error()
1220 auxtrace_error->vcpu = vcpu; in auxtrace_synth_guest_error()
1223 size = (void *)auxtrace_error->msg - (void *)auxtrace_error + in auxtrace_synth_guest_error()
1224 strlen(auxtrace_error->msg) + 1; in auxtrace_synth_guest_error()
1226 auxtrace_error->header.size = PERF_ALIGN(size, sizeof(u64)); in auxtrace_synth_guest_error()
1234 ip, msg, timestamp, 0, -1); in auxtrace_synth_error()
1247 priv_size = auxtrace_record__info_priv_size(itr, session->evlist); in perf_event__synthesize_auxtrace_info()
1250 return -ENOMEM; in perf_event__synthesize_auxtrace_info()
1252 ev->auxtrace_info.header.type = PERF_RECORD_AUXTRACE_INFO; in perf_event__synthesize_auxtrace_info()
1253 ev->auxtrace_info.header.size = sizeof(struct perf_record_auxtrace_info) + in perf_event__synthesize_auxtrace_info()
1255 err = auxtrace_record__info_fill(itr, session, &ev->auxtrace_info, in perf_event__synthesize_auxtrace_info()
1282 zfree(&new_leader->group_name); in unleader_evsel()
1283 new_leader->group_name = leader->group_name; in unleader_evsel()
1284 leader->group_name = NULL; in unleader_evsel()
1286 new_leader->core.nr_members = leader->core.nr_members - 1; in unleader_evsel()
1287 leader->core.nr_members = 1; in unleader_evsel()
1295 evlist__for_each_entry(session->evlist, evsel) { in unleader_auxtrace()
1298 unleader_evsel(session->evlist, evsel); in unleader_auxtrace()
1306 enum auxtrace_type type = event->auxtrace_info.type; in perf_event__process_auxtrace_info()
1333 return -EINVAL; in perf_event__process_auxtrace_info()
1351 event->auxtrace.size, event->auxtrace.offset, in perf_event__process_auxtrace()
1352 event->auxtrace.reference, event->auxtrace.idx, in perf_event__process_auxtrace()
1353 event->auxtrace.tid, event->auxtrace.cpu); in perf_event__process_auxtrace()
1356 return event->auxtrace.size; in perf_event__process_auxtrace()
1358 if (!session->auxtrace || event->header.type != PERF_RECORD_AUXTRACE) in perf_event__process_auxtrace()
1359 return -EINVAL; in perf_event__process_auxtrace()
1361 err = session->auxtrace->process_auxtrace_event(session, event, session->tool); in perf_event__process_auxtrace()
1365 return event->auxtrace.size; in perf_event__process_auxtrace()
1378 synth_opts->branches = true; in itrace_synth_opts__set_default()
1379 synth_opts->transactions = true; in itrace_synth_opts__set_default()
1380 synth_opts->ptwrites = true; in itrace_synth_opts__set_default()
1381 synth_opts->pwr_events = true; in itrace_synth_opts__set_default()
1382 synth_opts->other_events = true; in itrace_synth_opts__set_default()
1383 synth_opts->intr_events = true; in itrace_synth_opts__set_default()
1384 synth_opts->errors = true; in itrace_synth_opts__set_default()
1385 synth_opts->flc = true; in itrace_synth_opts__set_default()
1386 synth_opts->llc = true; in itrace_synth_opts__set_default()
1387 synth_opts->tlb = true; in itrace_synth_opts__set_default()
1388 synth_opts->mem = true; in itrace_synth_opts__set_default()
1389 synth_opts->remote_access = true; in itrace_synth_opts__set_default()
1392 synth_opts->period_type = PERF_ITRACE_PERIOD_INSTRUCTIONS; in itrace_synth_opts__set_default()
1393 synth_opts->period = 1; in itrace_synth_opts__set_default()
1394 synth_opts->calls = true; in itrace_synth_opts__set_default()
1396 synth_opts->instructions = true; in itrace_synth_opts__set_default()
1397 synth_opts->cycles = true; in itrace_synth_opts__set_default()
1398 synth_opts->period_type = PERF_ITRACE_DEFAULT_PERIOD_TYPE; in itrace_synth_opts__set_default()
1399 synth_opts->period = PERF_ITRACE_DEFAULT_PERIOD; in itrace_synth_opts__set_default()
1401 synth_opts->callchain_sz = PERF_ITRACE_DEFAULT_CALLCHAIN_SZ; in itrace_synth_opts__set_default()
1402 synth_opts->last_branch_sz = PERF_ITRACE_DEFAULT_LAST_BRANCH_SZ; in itrace_synth_opts__set_default()
1403 synth_opts->initial_skip = 0; in itrace_synth_opts__set_default()
1412 *flags |= 1 << (c - 'a'); in get_flag()
1419 return -1; in get_flag()
1431 return -1; in get_flags()
1433 case '-': in get_flags()
1436 return -1; in get_flags()
1453 perf_config_scan("itrace.debug-log-buffer-size", "%u", &sz); in itrace_log_on_error_size()
1458 * Please check tools/perf/Documentation/perf-script.txt for information
1471 synth_opts->set = true; in itrace_do_parse_synth_opts()
1474 synth_opts->dont_decode = true; in itrace_do_parse_synth_opts()
1480 synth_opts->default_no_sample); in itrace_do_parse_synth_opts()
1489 if (p[-1] == 'y') in itrace_do_parse_synth_opts()
1490 synth_opts->cycles = true; in itrace_do_parse_synth_opts()
1492 synth_opts->instructions = true; in itrace_do_parse_synth_opts()
1496 synth_opts->period = strtoull(p, &endptr, 10); in itrace_do_parse_synth_opts()
1503 synth_opts->period_type = in itrace_do_parse_synth_opts()
1508 synth_opts->period_type = in itrace_do_parse_synth_opts()
1513 synth_opts->period *= 1000; in itrace_do_parse_synth_opts()
1516 synth_opts->period *= 1000; in itrace_do_parse_synth_opts()
1521 synth_opts->period_type = in itrace_do_parse_synth_opts()
1533 synth_opts->branches = true; in itrace_do_parse_synth_opts()
1536 synth_opts->transactions = true; in itrace_do_parse_synth_opts()
1539 synth_opts->ptwrites = true; in itrace_do_parse_synth_opts()
1542 synth_opts->pwr_events = true; in itrace_do_parse_synth_opts()
1545 synth_opts->other_events = true; in itrace_do_parse_synth_opts()
1548 synth_opts->intr_events = true; in itrace_do_parse_synth_opts()
1551 synth_opts->errors = true; in itrace_do_parse_synth_opts()
1552 if (get_flags(&p, &synth_opts->error_plus_flags, in itrace_do_parse_synth_opts()
1553 &synth_opts->error_minus_flags)) in itrace_do_parse_synth_opts()
1557 synth_opts->log = true; in itrace_do_parse_synth_opts()
1558 if (get_flags(&p, &synth_opts->log_plus_flags, in itrace_do_parse_synth_opts()
1559 &synth_opts->log_minus_flags)) in itrace_do_parse_synth_opts()
1561 if (synth_opts->log_plus_flags & AUXTRACE_LOG_FLG_ON_ERROR) in itrace_do_parse_synth_opts()
1562 synth_opts->log_on_error_size = itrace_log_on_error_size(); in itrace_do_parse_synth_opts()
1565 synth_opts->branches = true; in itrace_do_parse_synth_opts()
1566 synth_opts->calls = true; in itrace_do_parse_synth_opts()
1569 synth_opts->branches = true; in itrace_do_parse_synth_opts()
1570 synth_opts->returns = true; in itrace_do_parse_synth_opts()
1574 if (p[-1] == 'G') in itrace_do_parse_synth_opts()
1575 synth_opts->add_callchain = true; in itrace_do_parse_synth_opts()
1577 synth_opts->callchain = true; in itrace_do_parse_synth_opts()
1578 synth_opts->callchain_sz = in itrace_do_parse_synth_opts()
1589 synth_opts->callchain_sz = val; in itrace_do_parse_synth_opts()
1594 if (p[-1] == 'L') in itrace_do_parse_synth_opts()
1595 synth_opts->add_last_branch = true; in itrace_do_parse_synth_opts()
1597 synth_opts->last_branch = true; in itrace_do_parse_synth_opts()
1598 synth_opts->last_branch_sz = in itrace_do_parse_synth_opts()
1610 synth_opts->last_branch_sz = val; in itrace_do_parse_synth_opts()
1614 synth_opts->initial_skip = strtoul(p, &endptr, 10); in itrace_do_parse_synth_opts()
1620 synth_opts->flc = true; in itrace_do_parse_synth_opts()
1623 synth_opts->llc = true; in itrace_do_parse_synth_opts()
1626 synth_opts->tlb = true; in itrace_do_parse_synth_opts()
1629 synth_opts->remote_access = true; in itrace_do_parse_synth_opts()
1632 synth_opts->mem = true; in itrace_do_parse_synth_opts()
1635 synth_opts->quick += 1; in itrace_do_parse_synth_opts()
1638 synth_opts->approx_ipc = true; in itrace_do_parse_synth_opts()
1641 synth_opts->timeless_decoding = true; in itrace_do_parse_synth_opts()
1653 synth_opts->period_type = in itrace_do_parse_synth_opts()
1656 synth_opts->period = PERF_ITRACE_DEFAULT_PERIOD; in itrace_do_parse_synth_opts()
1663 return -EINVAL; in itrace_do_parse_synth_opts()
1668 return itrace_do_parse_synth_opts(opt->value, str, unset); in itrace_parse_synth_opts()
1688 struct perf_record_auxtrace_error *e = &event->auxtrace_error; in perf_event__fprintf_auxtrace_error()
1689 unsigned long long nsecs = e->time; in perf_event__fprintf_auxtrace_error()
1690 const char *msg = e->msg; in perf_event__fprintf_auxtrace_error()
1694 auxtrace_error_name(e->type), e->type); in perf_event__fprintf_auxtrace_error()
1696 if (e->fmt && nsecs) { in perf_event__fprintf_auxtrace_error()
1699 nsecs -= secs * NSEC_PER_SEC; in perf_event__fprintf_auxtrace_error()
1705 if (!e->fmt) in perf_event__fprintf_auxtrace_error()
1706 msg = (const char *)&e->time; in perf_event__fprintf_auxtrace_error()
1708 if (e->fmt >= 2 && e->machine_pid) in perf_event__fprintf_auxtrace_error()
1709 ret += fprintf(fp, " machine_pid %d vcpu %d", e->machine_pid, e->vcpu); in perf_event__fprintf_auxtrace_error()
1712 e->cpu, e->pid, e->tid, e->ip, e->code, msg); in perf_event__fprintf_auxtrace_error()
1719 struct perf_record_auxtrace_error *e = &event->auxtrace_error; in perf_session__auxtrace_error_inc()
1721 if (e->type < PERF_AUXTRACE_ERROR_MAX) in perf_session__auxtrace_error_inc()
1722 session->evlist->stats.nr_auxtrace_errors[e->type] += 1; in perf_session__auxtrace_error_inc()
1730 if (!stats->nr_auxtrace_errors[i]) in events_stats__auxtrace_error_warn()
1733 stats->nr_auxtrace_errors[i], in events_stats__auxtrace_error_warn()
1749 * In the compat mode kernel runs in 64-bit and perf tool runs in 32-bit mode,
1750 * 32-bit perf tool cannot access 64-bit value atomically, which might lead to
1752 * accesses either the load operation or the store operation for 64-bit value,
1754 * is for accessing the low 32-bit value and another is for the high 32-bit;
1756 * 64-bit value, and thus leads to the unexpected load values.
1758 * kernel (64-bit) user (32-bit)
1760 * if (LOAD ->aux_tail) { --, LOAD ->aux_head_lo
1761 * STORE $aux_data | ,--->
1762 * FLUSH $aux_data | | LOAD ->aux_head_hi
1763 * STORE ->aux_head --|-------` smp_rmb()
1766 * | STORE ->aux_tail_lo
1767 * `----------->
1768 * STORE ->aux_tail_hi
1775 * high 32-bit.
1788 * promise the atomicity for 64-bit write, so return '-1' in this case to tell
1793 struct perf_event_mmap_page *pc = mm->userpg; in compat_auxtrace_mmap__read_head()
1798 first = READ_ONCE(pc->aux_head); in compat_auxtrace_mmap__read_head()
1801 second = READ_ONCE(pc->aux_head); in compat_auxtrace_mmap__read_head()
1804 last = READ_ONCE(pc->aux_head); in compat_auxtrace_mmap__read_head()
1812 struct perf_event_mmap_page *pc = mm->userpg; in compat_auxtrace_mmap__write_tail()
1816 return -1; in compat_auxtrace_mmap__write_tail()
1820 WRITE_ONCE(pc->aux_tail, tail); in compat_auxtrace_mmap__write_tail()
1829 struct auxtrace_mmap *mm = &map->auxtrace_mmap; in __auxtrace_mmap__read()
1830 u64 head, old = mm->prev, offset, ref; in __auxtrace_mmap__read()
1831 unsigned char *data = mm->base; in __auxtrace_mmap__read()
1840 auxtrace_record__find_snapshot(itr, mm->idx, mm, data, &head, &old)) in __auxtrace_mmap__read()
1841 return -1; in __auxtrace_mmap__read()
1847 mm->idx, old, head, head - old); in __auxtrace_mmap__read()
1849 if (mm->mask) { in __auxtrace_mmap__read()
1850 head_off = head & mm->mask; in __auxtrace_mmap__read()
1851 old_off = old & mm->mask; in __auxtrace_mmap__read()
1853 head_off = head % mm->len; in __auxtrace_mmap__read()
1854 old_off = old % mm->len; in __auxtrace_mmap__read()
1858 size = head_off - old_off; in __auxtrace_mmap__read()
1860 size = mm->len - (old_off - head_off); in __auxtrace_mmap__read()
1867 if (head > old || size <= head || mm->mask) { in __auxtrace_mmap__read()
1868 offset = head - size; in __auxtrace_mmap__read()
1875 u64 rem = (0ULL - mm->len) % mm->len; in __auxtrace_mmap__read()
1877 offset = head - size - rem; in __auxtrace_mmap__read()
1881 len1 = size - head_off; in __auxtrace_mmap__read()
1882 data1 = &data[mm->len - len1]; in __auxtrace_mmap__read()
1887 data1 = &data[head_off - len1]; in __auxtrace_mmap__read()
1892 if (itr->alignment) { in __auxtrace_mmap__read()
1893 unsigned int unwanted = len1 % itr->alignment; in __auxtrace_mmap__read()
1895 len1 -= unwanted; in __auxtrace_mmap__read()
1896 size -= unwanted; in __auxtrace_mmap__read()
1900 padding = size & (PERF_AUXTRACE_RECORD_ALIGNMENT - 1); in __auxtrace_mmap__read()
1902 padding = PERF_AUXTRACE_RECORD_ALIGNMENT - padding; in __auxtrace_mmap__read()
1910 ev.auxtrace.idx = mm->idx; in __auxtrace_mmap__read()
1911 ev.auxtrace.tid = mm->tid; in __auxtrace_mmap__read()
1912 ev.auxtrace.cpu = mm->cpu; in __auxtrace_mmap__read()
1915 return -1; in __auxtrace_mmap__read()
1917 mm->prev = head; in __auxtrace_mmap__read()
1926 if (itr->read_finish) { in __auxtrace_mmap__read()
1927 err = itr->read_finish(itr, mm->idx); in __auxtrace_mmap__read()
1951 * struct auxtrace_cache - hash table to implement a cache
1989 c->hashtable = ht; in auxtrace_cache__new()
1990 c->sz = sz; in auxtrace_cache__new()
1991 c->entry_size = entry_size; in auxtrace_cache__new()
1992 c->limit = (c->sz * limit_percent) / 100; in auxtrace_cache__new()
1993 c->bits = bits; in auxtrace_cache__new()
2011 for (i = 0; i < c->sz; i++) { in auxtrace_cache__drop()
2012 hlist_for_each_entry_safe(entry, tmp, &c->hashtable[i], hash) { in auxtrace_cache__drop()
2013 hlist_del(&entry->hash); in auxtrace_cache__drop()
2018 c->cnt = 0; in auxtrace_cache__drop()
2027 zfree(&c->hashtable); in auxtrace_cache__free()
2033 return malloc(c->entry_size); in auxtrace_cache__alloc_entry()
2045 if (c->limit && ++c->cnt > c->limit) in auxtrace_cache__add()
2048 entry->key = key; in auxtrace_cache__add()
2049 hlist_add_head(&entry->hash, &c->hashtable[hash_32(key, c->bits)]); in auxtrace_cache__add()
2064 hlist = &c->hashtable[hash_32(key, c->bits)]; in auxtrace_cache__rm()
2066 if (entry->key == key) { in auxtrace_cache__rm()
2067 hlist_del(&entry->hash); in auxtrace_cache__rm()
2090 hlist = &c->hashtable[hash_32(key, c->bits)]; in auxtrace_cache__lookup()
2092 if (entry->key == key) in auxtrace_cache__lookup()
2101 zfree(&filt->str); in addr_filter__free_str()
2102 filt->action = NULL; in addr_filter__free_str()
2103 filt->sym_from = NULL; in addr_filter__free_str()
2104 filt->sym_to = NULL; in addr_filter__free_str()
2105 filt->filename = NULL; in addr_filter__free_str()
2113 INIT_LIST_HEAD(&filt->list); in addr_filter__new()
2128 list_add_tail(&filt->list, &filts->head); in addr_filters__add()
2129 filts->cnt += 1; in addr_filters__add()
2135 list_del_init(&filt->list); in addr_filters__del()
2136 filts->cnt -= 1; in addr_filters__del()
2141 INIT_LIST_HEAD(&filts->head); in addr_filters__init()
2142 filts->cnt = 0; in addr_filters__init()
2149 list_for_each_entry_safe(filt, n, &filts->head, list) { in addr_filters__exit()
2164 return -EINVAL; in parse_num_or_str()
2168 return -errno; in parse_num_or_str()
2170 return -EINVAL; in parse_num_or_str()
2176 return -EINVAL; in parse_num_or_str()
2181 return -EINVAL; in parse_num_or_str()
2193 if (!strcmp(filt->action, "filter")) { in parse_action()
2194 filt->start = true; in parse_action()
2195 filt->range = true; in parse_action()
2196 } else if (!strcmp(filt->action, "start")) { in parse_action()
2197 filt->start = true; in parse_action()
2198 } else if (!strcmp(filt->action, "stop")) { in parse_action()
2199 filt->start = false; in parse_action()
2200 } else if (!strcmp(filt->action, "tracestop")) { in parse_action()
2201 filt->start = false; in parse_action()
2202 filt->range = true; in parse_action()
2203 filt->action += 5; /* Change 'tracestop' to 'stop' */ in parse_action()
2205 return -EINVAL; in parse_action()
2212 *idx = -1; in parse_sym_idx()
2231 return -errno; in parse_sym_idx()
2233 return -EINVAL; in parse_sym_idx()
2256 filt->str = fstr = strdup(*filter_inp); in parse_one_filter()
2258 return -ENOMEM; in parse_one_filter()
2260 err = parse_num_or_str(&fstr, NULL, &filt->action, " "); in parse_one_filter()
2268 err = parse_addr_size(&fstr, &filt->addr, &filt->sym_from, in parse_one_filter()
2269 &filt->sym_from_idx); in parse_one_filter()
2277 err = parse_addr_size(&fstr, &filt->size, &filt->sym_to, in parse_one_filter()
2278 &filt->sym_to_idx); in parse_one_filter()
2281 filt->range = true; in parse_one_filter()
2288 err = parse_num_or_str(&fstr, NULL, &filt->filename, " ,"); in parse_one_filter()
2295 *filter_inp += fstr - filt->str; in parse_one_filter()
2351 kern_sym_name_match(name, args->name) && in kern_sym_match()
2352 ((args->global && isupper(type)) || in kern_sym_match()
2353 (args->selected && ++(args->cnt) == args->idx) || in kern_sym_match()
2354 (!args->global && !args->selected)); in kern_sym_match()
2361 if (args->started) { in find_kern_sym_cb()
2362 if (!args->size) in find_kern_sym_cb()
2363 args->size = start - args->start; in find_kern_sym_cb()
2364 if (args->selected) { in find_kern_sym_cb()
2365 if (args->size) in find_kern_sym_cb()
2368 args->duplicate = true; in find_kern_sym_cb()
2372 args->started = true; in find_kern_sym_cb()
2373 args->start = start; in find_kern_sym_cb()
2385 ++args->cnt, start, type, name); in print_kern_sym_cb()
2386 args->near = true; in print_kern_sym_cb()
2387 } else if (args->near) { in print_kern_sym_cb()
2388 args->near = false; in print_kern_sym_cb()
2407 return -EINVAL; in sym_not_found_error()
2436 return -EINVAL; in find_kern_sym()
2459 if (!args->started) { in find_entire_kern_cb()
2460 args->started = true; in find_entire_kern_cb()
2461 args->start = start; in find_entire_kern_cb()
2464 size = round_up(start, page_size) + page_size - args->start; in find_entire_kern_cb()
2465 if (size > args->size) in find_entire_kern_cb()
2466 args->size = size; in find_entire_kern_cb()
2482 filt->addr = args.start; in addr_filter__entire_kernel()
2483 filt->size = args.size; in addr_filter__entire_kernel()
2490 if (start + size >= filt->addr) in check_end_after_start()
2493 if (filt->sym_from) { in check_end_after_start()
2495 filt->sym_to, start, filt->sym_from, filt->addr); in check_end_after_start()
2498 filt->sym_to, start, filt->addr); in check_end_after_start()
2501 return -EINVAL; in check_end_after_start()
2512 return -EINVAL; in addr_filter__resolve_kernel_syms()
2515 if (filt->sym_from && !strcmp(filt->sym_from, "*")) in addr_filter__resolve_kernel_syms()
2518 if (filt->sym_from) { in addr_filter__resolve_kernel_syms()
2519 err = find_kern_sym(filt->sym_from, &start, &size, in addr_filter__resolve_kernel_syms()
2520 filt->sym_from_idx); in addr_filter__resolve_kernel_syms()
2523 filt->addr = start; in addr_filter__resolve_kernel_syms()
2524 if (filt->range && !filt->size && !filt->sym_to) { in addr_filter__resolve_kernel_syms()
2525 filt->size = size; in addr_filter__resolve_kernel_syms()
2530 if (filt->sym_to) { in addr_filter__resolve_kernel_syms()
2531 err = find_kern_sym(filt->sym_to, &start, &size, in addr_filter__resolve_kernel_syms()
2532 filt->sym_to_idx); in addr_filter__resolve_kernel_syms()
2539 filt->size = start + size - filt->addr; in addr_filter__resolve_kernel_syms()
2546 filt->sym_to ? filt->sym_to : filt->sym_from); in addr_filter__resolve_kernel_syms()
2547 return -EINVAL; in addr_filter__resolve_kernel_syms()
2576 return !arch__compare_symbol_names(name, sym->name) && in dso_sym_match()
2577 ((!idx && sym->binding == STB_GLOBAL) || in dso_sym_match()
2592 if (dso_sym_match(sym, sym_name, &cnt, -1)) { in print_duplicate_syms()
2594 ++cnt, sym->start, in print_duplicate_syms()
2595 sym->binding == STB_GLOBAL ? 'g' : in print_duplicate_syms()
2596 sym->binding == STB_LOCAL ? 'l' : 'w', in print_duplicate_syms()
2597 sym->name); in print_duplicate_syms()
2601 pr_err("\t\twhich is near\t\t%s\n", sym->name); in print_duplicate_syms()
2624 *size = sym->start - *start; in find_dso_sym()
2630 return -EINVAL; in find_dso_sym()
2633 *start = sym->start; in find_dso_sym()
2634 *size = sym->end - sym->start; in find_dso_sym()
2649 filt->filename); in addr_filter__entire_dso()
2650 return -EINVAL; in addr_filter__entire_dso()
2653 filt->addr = 0; in addr_filter__entire_dso()
2654 filt->size = dso->data.file_size; in addr_filter__entire_dso()
2665 if (!filt->sym_from && !filt->sym_to) in addr_filter__resolve_syms()
2668 if (!filt->filename) in addr_filter__resolve_syms()
2671 dso = load_dso(filt->filename); in addr_filter__resolve_syms()
2673 pr_err("Failed to load symbols from: %s\n", filt->filename); in addr_filter__resolve_syms()
2674 return -EINVAL; in addr_filter__resolve_syms()
2677 if (filt->sym_from && !strcmp(filt->sym_from, "*")) { in addr_filter__resolve_syms()
2682 if (filt->sym_from) { in addr_filter__resolve_syms()
2683 err = find_dso_sym(dso, filt->sym_from, &start, &size, in addr_filter__resolve_syms()
2684 filt->sym_from_idx); in addr_filter__resolve_syms()
2687 filt->addr = start; in addr_filter__resolve_syms()
2688 if (filt->range && !filt->size && !filt->sym_to) in addr_filter__resolve_syms()
2689 filt->size = size; in addr_filter__resolve_syms()
2692 if (filt->sym_to) { in addr_filter__resolve_syms()
2693 err = find_dso_sym(dso, filt->sym_to, &start, &size, in addr_filter__resolve_syms()
2694 filt->sym_to_idx); in addr_filter__resolve_syms()
2702 filt->size = start + size - filt->addr; in addr_filter__resolve_syms()
2719 if (filt->filename) { in addr_filter__to_str()
2721 fn = realpath(filt->filename, filename_buf); in addr_filter__to_str()
2726 if (filt->range) { in addr_filter__to_str()
2728 filt->action, filt->addr, filt->size, at, fn); in addr_filter__to_str()
2731 filt->action, filt->addr, at, fn); in addr_filter__to_str()
2753 err = -EINVAL; in parse_addr_filter()
2766 err = -ENOMEM; in parse_addr_filter()
2771 err = -ENOMEM; in parse_addr_filter()
2808 filter = evsel->filter; in auxtrace_parse_filters()
2812 evsel->filter = NULL; in auxtrace_parse_filters()
2817 pr_debug("Address filter: %s\n", evsel->filter); in auxtrace_parse_filters()
2826 if (!session->auxtrace) in auxtrace__process_event()
2829 return session->auxtrace->process_event(session, event, sample, tool); in auxtrace__process_event()
2835 if (!session->auxtrace || !session->auxtrace->dump_auxtrace_sample || in auxtrace__dump_auxtrace_sample()
2839 session->auxtrace->dump_auxtrace_sample(session, sample); in auxtrace__dump_auxtrace_sample()
2844 if (!session->auxtrace) in auxtrace__flush_events()
2847 return session->auxtrace->flush_events(session, tool); in auxtrace__flush_events()
2852 if (!session->auxtrace) in auxtrace__free_events()
2855 return session->auxtrace->free_events(session); in auxtrace__free_events()
2860 if (!session->auxtrace) in auxtrace__free()
2863 return session->auxtrace->free(session); in auxtrace__free()
2869 if (!session->auxtrace || !session->auxtrace->evsel_is_auxtrace) in auxtrace__evsel_is_auxtrace()
2872 return session->auxtrace->evsel_is_auxtrace(session, evsel); in auxtrace__evsel_is_auxtrace()