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"
73 return -EINVAL; in evlist__regroup()
80 evsel->core.nr_members <= 1))) in evlist__regroup()
81 return -EINVAL; in evlist__regroup()
94 if (leader->core.nr_members < 1) in evlist__regroup()
95 leader->core.nr_members = 1; in evlist__regroup()
96 leader->core.nr_members += 1; in evlist__regroup()
110 return !session->itrace_synth_opts || in auxtrace__dont_decode()
111 session->itrace_synth_opts->dont_decode; in auxtrace__dont_decode()
120 WARN_ONCE(mm->base, "Uninitialized auxtrace_mmap\n"); in auxtrace_mmap__mmap()
122 mm->userpg = userpg; in auxtrace_mmap__mmap()
123 mm->mask = mp->mask; in auxtrace_mmap__mmap()
124 mm->len = mp->len; in auxtrace_mmap__mmap()
125 mm->prev = 0; in auxtrace_mmap__mmap()
126 mm->idx = mp->idx; in auxtrace_mmap__mmap()
127 mm->tid = mp->tid; in auxtrace_mmap__mmap()
128 mm->cpu = mp->cpu.cpu; in auxtrace_mmap__mmap()
130 if (!mp->len || !mp->mmap_needed) { in auxtrace_mmap__mmap()
131 mm->base = NULL; in auxtrace_mmap__mmap()
135 pc->aux_offset = mp->offset; in auxtrace_mmap__mmap()
136 pc->aux_size = mp->len; in auxtrace_mmap__mmap()
138 mm->base = mmap(NULL, mp->len, mp->prot, MAP_SHARED, fd, mp->offset); in auxtrace_mmap__mmap()
139 if (mm->base == MAP_FAILED) { in auxtrace_mmap__mmap()
141 mm->base = NULL; in auxtrace_mmap__mmap()
142 return -1; in auxtrace_mmap__mmap()
150 if (mm->base) { in auxtrace_mmap__munmap()
151 munmap(mm->base, mm->len); in auxtrace_mmap__munmap()
152 mm->base = NULL; in auxtrace_mmap__munmap()
162 mp->offset = auxtrace_offset; in auxtrace_mmap_params__init()
163 mp->len = auxtrace_pages * (size_t)page_size; in auxtrace_mmap_params__init()
164 mp->mask = is_power_of_2(mp->len) ? mp->len - 1 : 0; in auxtrace_mmap_params__init()
165 mp->prot = PROT_READ | (auxtrace_overwrite ? 0 : PROT_WRITE); in auxtrace_mmap_params__init()
166 pr_debug2("AUX area mmap length %zu\n", mp->len); in auxtrace_mmap_params__init()
168 mp->len = 0; in auxtrace_mmap_params__init()
176 bool per_cpu = !perf_cpu_map__empty(evlist->core.user_requested_cpus); in auxtrace_mmap_params__set_idx()
178 mp->mmap_needed = evsel->needs_auxtrace_mmap; in auxtrace_mmap_params__set_idx()
180 if (!mp->mmap_needed) in auxtrace_mmap_params__set_idx()
183 mp->idx = idx; in auxtrace_mmap_params__set_idx()
186 mp->cpu = perf_cpu_map__cpu(evlist->core.all_cpus, idx); in auxtrace_mmap_params__set_idx()
187 if (evlist->core.threads) in auxtrace_mmap_params__set_idx()
188 mp->tid = perf_thread_map__pid(evlist->core.threads, 0); in auxtrace_mmap_params__set_idx()
190 mp->tid = -1; in auxtrace_mmap_params__set_idx()
192 mp->cpu.cpu = -1; in auxtrace_mmap_params__set_idx()
193 mp->tid = perf_thread_map__pid(evlist->core.threads, idx); in auxtrace_mmap_params__set_idx()
222 queues->nr_queues = AUXTRACE_INIT_NR_QUEUES; in auxtrace_queues__init()
223 queues->queue_array = auxtrace_alloc_queue_array(queues->nr_queues); in auxtrace_queues__init()
224 if (!queues->queue_array) in auxtrace_queues__init()
225 return -ENOMEM; in auxtrace_queues__init()
232 unsigned int nr_queues = queues->nr_queues; in auxtrace_queues__grow()
242 if (nr_queues < queues->nr_queues || nr_queues < new_nr_queues) in auxtrace_queues__grow()
243 return -EINVAL; in auxtrace_queues__grow()
247 return -ENOMEM; in auxtrace_queues__grow()
249 for (i = 0; i < queues->nr_queues; i++) { in auxtrace_queues__grow()
250 list_splice_tail(&queues->queue_array[i].head, in auxtrace_queues__grow()
252 queue_array[i].tid = queues->queue_array[i].tid; in auxtrace_queues__grow()
253 queue_array[i].cpu = queues->queue_array[i].cpu; in auxtrace_queues__grow()
254 queue_array[i].set = queues->queue_array[i].set; in auxtrace_queues__grow()
255 queue_array[i].priv = queues->queue_array[i].priv; in auxtrace_queues__grow()
258 queues->nr_queues = nr_queues; in auxtrace_queues__grow()
259 queues->queue_array = queue_array; in auxtrace_queues__grow()
266 int fd = perf_data__fd(session->data); in auxtrace_copy_data()
293 if (idx >= queues->nr_queues) { in auxtrace_queues__queue_buffer()
299 queue = &queues->queue_array[idx]; in auxtrace_queues__queue_buffer()
301 if (!queue->set) { in auxtrace_queues__queue_buffer()
302 queue->set = true; in auxtrace_queues__queue_buffer()
303 queue->tid = buffer->tid; in auxtrace_queues__queue_buffer()
304 queue->cpu = buffer->cpu.cpu; in auxtrace_queues__queue_buffer()
307 buffer->buffer_nr = queues->next_buffer_nr++; in auxtrace_queues__queue_buffer()
309 list_add_tail(&buffer->list, &queue->head); in auxtrace_queues__queue_buffer()
311 queues->new_data = true; in auxtrace_queues__queue_buffer()
312 queues->populated = true; in auxtrace_queues__queue_buffer()
317 /* Limit buffers to 32MiB on 32-bit */
324 u64 sz = buffer->size; in auxtrace_queues__split_buffer()
332 return -ENOMEM; in auxtrace_queues__split_buffer()
333 b->size = BUFFER_LIMIT_FOR_32_BIT; in auxtrace_queues__split_buffer()
334 b->consecutive = consecutive; in auxtrace_queues__split_buffer()
340 buffer->data_offset += BUFFER_LIMIT_FOR_32_BIT; in auxtrace_queues__split_buffer()
341 sz -= BUFFER_LIMIT_FOR_32_BIT; in auxtrace_queues__split_buffer()
345 buffer->size = sz; in auxtrace_queues__split_buffer()
346 buffer->consecutive = consecutive; in auxtrace_queues__split_buffer()
353 unsigned long *cpu_bitmap = session->itrace_synth_opts->cpu_bitmap; in filter_cpu()
355 return cpu_bitmap && cpu.cpu != -1 && !test_bit(cpu.cpu, cpu_bitmap); in filter_cpu()
364 int err = -ENOMEM; in auxtrace_queues__add_buffer()
366 if (filter_cpu(session, buffer->cpu)) in auxtrace_queues__add_buffer()
371 return -ENOMEM; in auxtrace_queues__add_buffer()
373 if (session->one_mmap) { in auxtrace_queues__add_buffer()
374 buffer->data = buffer->data_offset - session->one_mmap_offset + in auxtrace_queues__add_buffer()
375 session->one_mmap_addr; in auxtrace_queues__add_buffer()
376 } else if (perf_data__is_pipe(session->data)) { in auxtrace_queues__add_buffer()
377 buffer->data = auxtrace_copy_data(buffer->size, session); in auxtrace_queues__add_buffer()
378 if (!buffer->data) in auxtrace_queues__add_buffer()
380 buffer->data_needs_freeing = true; in auxtrace_queues__add_buffer()
382 buffer->size > BUFFER_LIMIT_FOR_32_BIT) { in auxtrace_queues__add_buffer()
409 .pid = -1, in auxtrace_queues__add_event()
410 .tid = event->auxtrace.tid, in auxtrace_queues__add_event()
411 .cpu = { event->auxtrace.cpu }, in auxtrace_queues__add_event()
413 .offset = event->auxtrace.offset, in auxtrace_queues__add_event()
414 .reference = event->auxtrace.reference, in auxtrace_queues__add_event()
415 .size = event->auxtrace.size, in auxtrace_queues__add_event()
417 unsigned int idx = event->auxtrace.idx; in auxtrace_queues__add_event()
436 if (event->header.type == PERF_RECORD_AUXTRACE) { in auxtrace_queues__add_indexed_event()
437 if (event->header.size < sizeof(struct perf_record_auxtrace) || in auxtrace_queues__add_indexed_event()
438 event->header.size != sz) { in auxtrace_queues__add_indexed_event()
439 err = -EINVAL; in auxtrace_queues__add_indexed_event()
442 file_offset += event->header.size; in auxtrace_queues__add_indexed_event()
454 for (i = 0; i < queues->nr_queues; i++) { in auxtrace_queues__free()
455 while (!list_empty(&queues->queue_array[i].head)) { in auxtrace_queues__free()
458 buffer = list_entry(queues->queue_array[i].head.next, in auxtrace_queues__free()
460 list_del_init(&buffer->list); in auxtrace_queues__free()
465 zfree(&queues->queue_array); in auxtrace_queues__free()
466 queues->nr_queues = 0; in auxtrace_queues__free()
476 parent = (pos - 1) >> 1; in auxtrace_heapify()
491 if (queue_nr >= heap->heap_sz) { in auxtrace_heap__add()
496 heap_array = realloc(heap->heap_array, in auxtrace_heap__add()
499 return -ENOMEM; in auxtrace_heap__add()
500 heap->heap_array = heap_array; in auxtrace_heap__add()
501 heap->heap_sz = heap_sz; in auxtrace_heap__add()
504 auxtrace_heapify(heap->heap_array, heap->heap_cnt++, queue_nr, ordinal); in auxtrace_heap__add()
511 zfree(&heap->heap_array); in auxtrace_heap__free()
512 heap->heap_cnt = 0; in auxtrace_heap__free()
513 heap->heap_sz = 0; in auxtrace_heap__free()
518 unsigned int pos, last, heap_cnt = heap->heap_cnt; in auxtrace_heap__pop()
524 heap->heap_cnt -= 1; in auxtrace_heap__pop()
526 heap_array = heap->heap_array; in auxtrace_heap__pop()
549 last = heap_cnt - 1; in auxtrace_heap__pop()
558 return itr->info_priv_size(itr, evlist); in auxtrace_record__info_priv_size()
565 return -EINVAL; in auxtrace_not_supported()
574 return itr->info_fill(itr, session, auxtrace_info, priv_size); in auxtrace_record__info_fill()
581 itr->free(itr); in auxtrace_record__free()
586 if (itr && itr->snapshot_start) in auxtrace_record__snapshot_start()
587 return itr->snapshot_start(itr); in auxtrace_record__snapshot_start()
593 if (!on_exit && itr && itr->snapshot_finish) in auxtrace_record__snapshot_finish()
594 return itr->snapshot_finish(itr); in auxtrace_record__snapshot_finish()
602 if (itr && itr->find_snapshot) in auxtrace_record__find_snapshot()
603 return itr->find_snapshot(itr, idx, mm, data, head, old); in auxtrace_record__find_snapshot()
612 itr->evlist = evlist; in auxtrace_record__options()
613 return itr->recording_options(itr, evlist, opts); in auxtrace_record__options()
621 return itr->reference(itr); in auxtrace_record__reference()
631 /* PMU-agnostic options */ in auxtrace_parse_snapshot_options()
634 opts->auxtrace_snapshot_on_exit = true; in auxtrace_parse_snapshot_options()
641 if (itr && itr->parse_snapshot_options) in auxtrace_parse_snapshot_options()
642 return itr->parse_snapshot_options(itr, opts, str); in auxtrace_parse_snapshot_options()
645 return -EINVAL; in auxtrace_parse_snapshot_options()
650 bool per_cpu_mmaps = !perf_cpu_map__empty(evlist->core.user_requested_cpus); in evlist__enable_event_idx()
653 struct perf_cpu evlist_cpu = perf_cpu_map__cpu(evlist->core.all_cpus, idx); in evlist__enable_event_idx()
654 int cpu_map_idx = perf_cpu_map__idx(evsel->core.cpus, evlist_cpu); in evlist__enable_event_idx()
656 if (cpu_map_idx == -1) in evlist__enable_event_idx()
657 return -EINVAL; in evlist__enable_event_idx()
658 return perf_evsel__enable_cpu(&evsel->core, cpu_map_idx); in evlist__enable_event_idx()
661 return perf_evsel__enable_thread(&evsel->core, idx); in evlist__enable_event_idx()
668 if (!itr->evlist || !itr->pmu) in auxtrace_record__read_finish()
669 return -EINVAL; in auxtrace_record__read_finish()
671 evlist__for_each_entry(itr->evlist, evsel) { in auxtrace_record__read_finish()
672 if (evsel->core.attr.type == itr->pmu->type) { in auxtrace_record__read_finish()
673 if (evsel->disabled) in auxtrace_record__read_finish()
675 return evlist__enable_event_idx(itr->evlist, evsel, idx); in auxtrace_record__read_finish()
678 return -EINVAL; in auxtrace_record__read_finish()
682 * Event record size is 16-bit which results in a maximum size of about 64KiB.
699 sz = evsel->core.attr.aux_sample_size; in auxtrace_validate_aux_sample_size()
707 return -EINVAL; in auxtrace_validate_aux_sample_size()
713 return -EINVAL; in auxtrace_validate_aux_sample_size()
718 return -EINVAL; in auxtrace_validate_aux_sample_size()
721 opts->auxtrace_sample_mode = true; in auxtrace_validate_aux_sample_size()
727 if (!opts->auxtrace_sample_mode) { in auxtrace_validate_aux_sample_size()
729 return -EINVAL; in auxtrace_validate_aux_sample_size()
734 return -EINVAL; in auxtrace_validate_aux_sample_size()
744 struct evsel_config_term *term; in auxtrace_parse_sample_options() local
757 return -EINVAL; in auxtrace_parse_sample_options()
763 return -EINVAL; in auxtrace_parse_sample_options()
767 sz = itr->default_aux_sample_size; in auxtrace_parse_sample_options()
772 /* Set aux_sample_size based on --aux-sample option */ in auxtrace_parse_sample_options()
777 evsel->core.attr.aux_sample_size = sz; in auxtrace_parse_sample_options()
782 /* Override with aux_sample_size from config term */ in auxtrace_parse_sample_options()
786 term = evsel__get_config_term(evsel, AUX_SAMPLE_SIZE); in auxtrace_parse_sample_options()
787 if (term) { in auxtrace_parse_sample_options()
789 evsel->core.attr.aux_sample_size = term->val.aux_sample_size; in auxtrace_parse_sample_options()
791 if (aux_evsel && evsel->core.attr.aux_sample_size) in auxtrace_parse_sample_options()
801 return -EINVAL; in auxtrace_parse_sample_options()
810 struct evsel_config_term *term; in auxtrace_regroup_aux_output() local
815 term = evsel__get_config_term(evsel, AUX_OUTPUT); in auxtrace_regroup_aux_output()
817 if (term && aux_evsel) in auxtrace_regroup_aux_output()
835 return -ENOMEM; in auxtrace_index__alloc()
837 auxtrace_index->nr = 0; in auxtrace_index__alloc()
838 INIT_LIST_HEAD(&auxtrace_index->list); in auxtrace_index__alloc()
840 list_add_tail(&auxtrace_index->list, head); in auxtrace_index__alloc()
850 list_del_init(&auxtrace_index->list); in auxtrace_index__free()
866 auxtrace_index = list_entry(head->prev, struct auxtrace_index, list); in auxtrace_index__last()
868 if (auxtrace_index->nr >= PERF_AUXTRACE_INDEX_ENTRY_COUNT) { in auxtrace_index__last()
872 auxtrace_index = list_entry(head->prev, struct auxtrace_index, in auxtrace_index__last()
887 return -ENOMEM; in auxtrace_index__auxtrace_event()
889 nr = auxtrace_index->nr; in auxtrace_index__auxtrace_event()
890 auxtrace_index->entries[nr].file_offset = file_offset; in auxtrace_index__auxtrace_event()
891 auxtrace_index->entries[nr].sz = event->header.size; in auxtrace_index__auxtrace_event()
892 auxtrace_index->nr += 1; in auxtrace_index__auxtrace_event()
903 for (i = 0; i < auxtrace_index->nr; i++) { in auxtrace_index__do_write()
904 ent.file_offset = auxtrace_index->entries[i].file_offset; in auxtrace_index__do_write()
905 ent.sz = auxtrace_index->entries[i].sz; in auxtrace_index__do_write()
907 return -errno; in auxtrace_index__do_write()
919 total += auxtrace_index->nr; in auxtrace_index__write()
922 return -errno; in auxtrace_index__write()
941 return -1; in auxtrace_index__process_entry()
945 return -1; in auxtrace_index__process_entry()
947 nr = auxtrace_index->nr; in auxtrace_index__process_entry()
949 auxtrace_index->entries[nr].file_offset = in auxtrace_index__process_entry()
951 auxtrace_index->entries[nr].sz = bswap_64(ent.sz); in auxtrace_index__process_entry()
953 auxtrace_index->entries[nr].file_offset = ent.file_offset; in auxtrace_index__process_entry()
954 auxtrace_index->entries[nr].sz = ent.sz; in auxtrace_index__process_entry()
957 auxtrace_index->nr = nr + 1; in auxtrace_index__process_entry()
965 struct list_head *head = &session->auxtrace_index; in auxtrace_index__process()
969 return -1; in auxtrace_index__process()
975 return -1; in auxtrace_index__process()
977 while (nr--) { in auxtrace_index__process()
982 return -1; in auxtrace_index__process()
993 ent->file_offset, ent->sz); in auxtrace_queues__process_index_entry()
1007 list_for_each_entry(auxtrace_index, &session->auxtrace_index, list) { in auxtrace_queues__process_index()
1008 for (i = 0; i < auxtrace_index->nr; i++) { in auxtrace_queues__process_index()
1009 ent = &auxtrace_index->entries[i]; in auxtrace_queues__process_index()
1024 if (list_is_last(&buffer->list, &queue->head)) in auxtrace_buffer__next()
1026 return list_entry(buffer->list.next, struct auxtrace_buffer, in auxtrace_buffer__next()
1029 if (list_empty(&queue->head)) in auxtrace_buffer__next()
1031 return list_entry(queue->head.next, struct auxtrace_buffer, in auxtrace_buffer__next()
1044 id = sample->id; in auxtrace_queues__sample_queue()
1048 sid = evlist__id2sid(session->evlist, id); in auxtrace_queues__sample_queue()
1052 idx = sid->idx; in auxtrace_queues__sample_queue()
1054 if (idx >= queues->nr_queues) in auxtrace_queues__sample_queue()
1057 return &queues->queue_array[idx]; in auxtrace_queues__sample_queue()
1066 .pid = -1, in auxtrace_queues__add_sample()
1069 .size = sample->aux_sample.size, in auxtrace_queues__add_sample()
1072 u64 id = sample->id; in auxtrace_queues__add_sample()
1076 return -EINVAL; in auxtrace_queues__add_sample()
1078 sid = evlist__id2sid(session->evlist, id); in auxtrace_queues__add_sample()
1080 return -ENOENT; in auxtrace_queues__add_sample()
1082 idx = sid->idx; in auxtrace_queues__add_sample()
1083 buffer.tid = sid->tid; in auxtrace_queues__add_sample()
1084 buffer.cpu = sid->cpu; in auxtrace_queues__add_sample()
1102 if (qd->events && event->header.type == PERF_RECORD_AUXTRACE) { in auxtrace_queue_data_cb()
1103 if (event->header.size < sizeof(struct perf_record_auxtrace)) in auxtrace_queue_data_cb()
1104 return -EINVAL; in auxtrace_queue_data_cb()
1105 offset += event->header.size; in auxtrace_queue_data_cb()
1106 return session->auxtrace->queue_data(session, NULL, event, in auxtrace_queue_data_cb()
1110 if (!qd->samples || event->header.type != PERF_RECORD_SAMPLE) in auxtrace_queue_data_cb()
1113 err = evlist__parse_sample(session->evlist, event, &sample); in auxtrace_queue_data_cb()
1120 offset += sample.aux_sample.data - (void *)event; in auxtrace_queue_data_cb()
1122 return session->auxtrace->queue_data(session, &sample, NULL, offset); in auxtrace_queue_data_cb()
1135 if (!session->auxtrace || !session->auxtrace->queue_data) in auxtrace_queue_data()
1136 return -EINVAL; in auxtrace_queue_data()
1138 return perf_session__peek_events(session, session->header.data_offset, in auxtrace_queue_data()
1139 session->header.data_size, in auxtrace_queue_data()
1146 size_t adj = buffer->data_offset & (page_size - 1); in auxtrace_buffer__get_data_rw() local
1147 size_t size = buffer->size + adj; in auxtrace_buffer__get_data_rw()
1148 off_t file_offset = buffer->data_offset - adj; in auxtrace_buffer__get_data_rw()
1151 if (buffer->data) in auxtrace_buffer__get_data_rw()
1152 return buffer->data; in auxtrace_buffer__get_data_rw()
1158 buffer->mmap_addr = addr; in auxtrace_buffer__get_data_rw()
1159 buffer->mmap_size = size; in auxtrace_buffer__get_data_rw()
1161 buffer->data = addr + adj; in auxtrace_buffer__get_data_rw()
1163 return buffer->data; in auxtrace_buffer__get_data_rw()
1168 if (!buffer->data || !buffer->mmap_addr) in auxtrace_buffer__put_data()
1170 munmap(buffer->mmap_addr, buffer->mmap_size); in auxtrace_buffer__put_data()
1171 buffer->mmap_addr = NULL; in auxtrace_buffer__put_data()
1172 buffer->mmap_size = 0; in auxtrace_buffer__put_data()
1173 buffer->data = NULL; in auxtrace_buffer__put_data()
1174 buffer->use_data = NULL; in auxtrace_buffer__put_data()
1180 if (buffer->data_needs_freeing) { in auxtrace_buffer__drop_data()
1181 buffer->data_needs_freeing = false; in auxtrace_buffer__drop_data()
1182 zfree(&buffer->data); in auxtrace_buffer__drop_data()
1183 buffer->use_data = NULL; in auxtrace_buffer__drop_data()
1184 buffer->size = 0; in auxtrace_buffer__drop_data()
1203 auxtrace_error->header.type = PERF_RECORD_AUXTRACE_ERROR; in auxtrace_synth_guest_error()
1204 auxtrace_error->type = type; in auxtrace_synth_guest_error()
1205 auxtrace_error->code = code; in auxtrace_synth_guest_error()
1206 auxtrace_error->cpu = cpu; in auxtrace_synth_guest_error()
1207 auxtrace_error->pid = pid; in auxtrace_synth_guest_error()
1208 auxtrace_error->tid = tid; in auxtrace_synth_guest_error()
1209 auxtrace_error->fmt = 1; in auxtrace_synth_guest_error()
1210 auxtrace_error->ip = ip; in auxtrace_synth_guest_error()
1211 auxtrace_error->time = timestamp; in auxtrace_synth_guest_error()
1212 strlcpy(auxtrace_error->msg, msg, MAX_AUXTRACE_ERROR_MSG); in auxtrace_synth_guest_error()
1214 auxtrace_error->fmt = 2; in auxtrace_synth_guest_error()
1215 auxtrace_error->machine_pid = machine_pid; in auxtrace_synth_guest_error()
1216 auxtrace_error->vcpu = vcpu; in auxtrace_synth_guest_error()
1219 size = (void *)auxtrace_error->msg - (void *)auxtrace_error + in auxtrace_synth_guest_error()
1220 strlen(auxtrace_error->msg) + 1; in auxtrace_synth_guest_error()
1222 auxtrace_error->header.size = PERF_ALIGN(size, sizeof(u64)); in auxtrace_synth_guest_error()
1230 ip, msg, timestamp, 0, -1); in auxtrace_synth_error()
1243 priv_size = auxtrace_record__info_priv_size(itr, session->evlist); in perf_event__synthesize_auxtrace_info()
1246 return -ENOMEM; in perf_event__synthesize_auxtrace_info()
1248 ev->auxtrace_info.header.type = PERF_RECORD_AUXTRACE_INFO; in perf_event__synthesize_auxtrace_info()
1249 ev->auxtrace_info.header.size = sizeof(struct perf_record_auxtrace_info) + in perf_event__synthesize_auxtrace_info()
1251 err = auxtrace_record__info_fill(itr, session, &ev->auxtrace_info, in perf_event__synthesize_auxtrace_info()
1278 zfree(&new_leader->group_name); in unleader_evsel()
1279 new_leader->group_name = leader->group_name; in unleader_evsel()
1280 leader->group_name = NULL; in unleader_evsel()
1282 new_leader->core.nr_members = leader->core.nr_members - 1; in unleader_evsel()
1283 leader->core.nr_members = 1; in unleader_evsel()
1291 evlist__for_each_entry(session->evlist, evsel) { in unleader_auxtrace()
1294 unleader_evsel(session->evlist, evsel); in unleader_auxtrace()
1302 enum auxtrace_type type = event->auxtrace_info.type; in perf_event__process_auxtrace_info()
1329 return -EINVAL; in perf_event__process_auxtrace_info()
1347 event->auxtrace.size, event->auxtrace.offset, in perf_event__process_auxtrace()
1348 event->auxtrace.reference, event->auxtrace.idx, in perf_event__process_auxtrace()
1349 event->auxtrace.tid, event->auxtrace.cpu); in perf_event__process_auxtrace()
1352 return event->auxtrace.size; in perf_event__process_auxtrace()
1354 if (!session->auxtrace || event->header.type != PERF_RECORD_AUXTRACE) in perf_event__process_auxtrace()
1355 return -EINVAL; in perf_event__process_auxtrace()
1357 err = session->auxtrace->process_auxtrace_event(session, event, session->tool); in perf_event__process_auxtrace()
1361 return event->auxtrace.size; in perf_event__process_auxtrace()
1374 synth_opts->branches = true; in itrace_synth_opts__set_default()
1375 synth_opts->transactions = true; in itrace_synth_opts__set_default()
1376 synth_opts->ptwrites = true; in itrace_synth_opts__set_default()
1377 synth_opts->pwr_events = true; in itrace_synth_opts__set_default()
1378 synth_opts->other_events = true; in itrace_synth_opts__set_default()
1379 synth_opts->intr_events = true; in itrace_synth_opts__set_default()
1380 synth_opts->errors = true; in itrace_synth_opts__set_default()
1381 synth_opts->flc = true; in itrace_synth_opts__set_default()
1382 synth_opts->llc = true; in itrace_synth_opts__set_default()
1383 synth_opts->tlb = true; in itrace_synth_opts__set_default()
1384 synth_opts->mem = true; in itrace_synth_opts__set_default()
1385 synth_opts->remote_access = true; in itrace_synth_opts__set_default()
1388 synth_opts->period_type = PERF_ITRACE_PERIOD_INSTRUCTIONS; in itrace_synth_opts__set_default()
1389 synth_opts->period = 1; in itrace_synth_opts__set_default()
1390 synth_opts->calls = true; in itrace_synth_opts__set_default()
1392 synth_opts->instructions = true; in itrace_synth_opts__set_default()
1393 synth_opts->period_type = PERF_ITRACE_DEFAULT_PERIOD_TYPE; in itrace_synth_opts__set_default()
1394 synth_opts->period = PERF_ITRACE_DEFAULT_PERIOD; in itrace_synth_opts__set_default()
1396 synth_opts->callchain_sz = PERF_ITRACE_DEFAULT_CALLCHAIN_SZ; in itrace_synth_opts__set_default()
1397 synth_opts->last_branch_sz = PERF_ITRACE_DEFAULT_LAST_BRANCH_SZ; in itrace_synth_opts__set_default()
1398 synth_opts->initial_skip = 0; in itrace_synth_opts__set_default()
1407 *flags |= 1 << (c - 'a'); in get_flag()
1414 return -1; in get_flag()
1426 return -1; in get_flags()
1428 case '-': in get_flags()
1431 return -1; in get_flags()
1448 perf_config_scan("itrace.debug-log-buffer-size", "%u", &sz); in itrace_log_on_error_size()
1453 * Please check tools/perf/Documentation/perf-script.txt for information
1465 synth_opts->set = true; in itrace_do_parse_synth_opts()
1468 synth_opts->dont_decode = true; in itrace_do_parse_synth_opts()
1474 synth_opts->default_no_sample); in itrace_do_parse_synth_opts()
1481 synth_opts->instructions = true; in itrace_do_parse_synth_opts()
1485 synth_opts->period = strtoull(p, &endptr, 10); in itrace_do_parse_synth_opts()
1492 synth_opts->period_type = in itrace_do_parse_synth_opts()
1497 synth_opts->period_type = in itrace_do_parse_synth_opts()
1502 synth_opts->period *= 1000; in itrace_do_parse_synth_opts()
1505 synth_opts->period *= 1000; in itrace_do_parse_synth_opts()
1510 synth_opts->period_type = in itrace_do_parse_synth_opts()
1522 synth_opts->branches = true; in itrace_do_parse_synth_opts()
1525 synth_opts->transactions = true; in itrace_do_parse_synth_opts()
1528 synth_opts->ptwrites = true; in itrace_do_parse_synth_opts()
1531 synth_opts->pwr_events = true; in itrace_do_parse_synth_opts()
1534 synth_opts->other_events = true; in itrace_do_parse_synth_opts()
1537 synth_opts->intr_events = true; in itrace_do_parse_synth_opts()
1540 synth_opts->errors = true; in itrace_do_parse_synth_opts()
1541 if (get_flags(&p, &synth_opts->error_plus_flags, in itrace_do_parse_synth_opts()
1542 &synth_opts->error_minus_flags)) in itrace_do_parse_synth_opts()
1546 synth_opts->log = true; in itrace_do_parse_synth_opts()
1547 if (get_flags(&p, &synth_opts->log_plus_flags, in itrace_do_parse_synth_opts()
1548 &synth_opts->log_minus_flags)) in itrace_do_parse_synth_opts()
1550 if (synth_opts->log_plus_flags & AUXTRACE_LOG_FLG_ON_ERROR) in itrace_do_parse_synth_opts()
1551 synth_opts->log_on_error_size = itrace_log_on_error_size(); in itrace_do_parse_synth_opts()
1554 synth_opts->branches = true; in itrace_do_parse_synth_opts()
1555 synth_opts->calls = true; in itrace_do_parse_synth_opts()
1558 synth_opts->branches = true; in itrace_do_parse_synth_opts()
1559 synth_opts->returns = true; in itrace_do_parse_synth_opts()
1563 if (p[-1] == 'G') in itrace_do_parse_synth_opts()
1564 synth_opts->add_callchain = true; in itrace_do_parse_synth_opts()
1566 synth_opts->callchain = true; in itrace_do_parse_synth_opts()
1567 synth_opts->callchain_sz = in itrace_do_parse_synth_opts()
1578 synth_opts->callchain_sz = val; in itrace_do_parse_synth_opts()
1583 if (p[-1] == 'L') in itrace_do_parse_synth_opts()
1584 synth_opts->add_last_branch = true; in itrace_do_parse_synth_opts()
1586 synth_opts->last_branch = true; in itrace_do_parse_synth_opts()
1587 synth_opts->last_branch_sz = in itrace_do_parse_synth_opts()
1599 synth_opts->last_branch_sz = val; in itrace_do_parse_synth_opts()
1603 synth_opts->initial_skip = strtoul(p, &endptr, 10); in itrace_do_parse_synth_opts()
1609 synth_opts->flc = true; in itrace_do_parse_synth_opts()
1612 synth_opts->llc = true; in itrace_do_parse_synth_opts()
1615 synth_opts->tlb = true; in itrace_do_parse_synth_opts()
1618 synth_opts->remote_access = true; in itrace_do_parse_synth_opts()
1621 synth_opts->mem = true; in itrace_do_parse_synth_opts()
1624 synth_opts->quick += 1; in itrace_do_parse_synth_opts()
1627 synth_opts->approx_ipc = true; in itrace_do_parse_synth_opts()
1630 synth_opts->timeless_decoding = true; in itrace_do_parse_synth_opts()
1640 if (synth_opts->instructions) { in itrace_do_parse_synth_opts()
1642 synth_opts->period_type = in itrace_do_parse_synth_opts()
1645 synth_opts->period = PERF_ITRACE_DEFAULT_PERIOD; in itrace_do_parse_synth_opts()
1652 return -EINVAL; in itrace_do_parse_synth_opts()
1657 return itrace_do_parse_synth_opts(opt->value, str, unset); in itrace_parse_synth_opts()
1677 struct perf_record_auxtrace_error *e = &event->auxtrace_error; in perf_event__fprintf_auxtrace_error()
1678 unsigned long long nsecs = e->time; in perf_event__fprintf_auxtrace_error()
1679 const char *msg = e->msg; in perf_event__fprintf_auxtrace_error()
1683 auxtrace_error_name(e->type), e->type); in perf_event__fprintf_auxtrace_error()
1685 if (e->fmt && nsecs) { in perf_event__fprintf_auxtrace_error()
1688 nsecs -= secs * NSEC_PER_SEC; in perf_event__fprintf_auxtrace_error()
1694 if (!e->fmt) in perf_event__fprintf_auxtrace_error()
1695 msg = (const char *)&e->time; in perf_event__fprintf_auxtrace_error()
1697 if (e->fmt >= 2 && e->machine_pid) in perf_event__fprintf_auxtrace_error()
1698 ret += fprintf(fp, " machine_pid %d vcpu %d", e->machine_pid, e->vcpu); in perf_event__fprintf_auxtrace_error()
1701 e->cpu, e->pid, e->tid, e->ip, e->code, msg); in perf_event__fprintf_auxtrace_error()
1708 struct perf_record_auxtrace_error *e = &event->auxtrace_error; in perf_session__auxtrace_error_inc()
1710 if (e->type < PERF_AUXTRACE_ERROR_MAX) in perf_session__auxtrace_error_inc()
1711 session->evlist->stats.nr_auxtrace_errors[e->type] += 1; in perf_session__auxtrace_error_inc()
1719 if (!stats->nr_auxtrace_errors[i]) in events_stats__auxtrace_error_warn()
1722 stats->nr_auxtrace_errors[i], in events_stats__auxtrace_error_warn()
1738 * In the compat mode kernel runs in 64-bit and perf tool runs in 32-bit mode,
1739 * 32-bit perf tool cannot access 64-bit value atomically, which might lead to
1741 * accesses either the load operation or the store operation for 64-bit value,
1743 * is for accessing the low 32-bit value and another is for the high 32-bit;
1745 * 64-bit value, and thus leads to the unexpected load values.
1747 * kernel (64-bit) user (32-bit)
1749 * if (LOAD ->aux_tail) { --, LOAD ->aux_head_lo
1750 * STORE $aux_data | ,--->
1751 * FLUSH $aux_data | | LOAD ->aux_head_hi
1752 * STORE ->aux_head --|-------` smp_rmb()
1755 * | STORE ->aux_tail_lo
1756 * `----------->
1757 * STORE ->aux_tail_hi
1764 * high 32-bit.
1777 * promise the atomicity for 64-bit write, so return '-1' in this case to tell
1782 struct perf_event_mmap_page *pc = mm->userpg; in compat_auxtrace_mmap__read_head()
1787 first = READ_ONCE(pc->aux_head); in compat_auxtrace_mmap__read_head()
1790 second = READ_ONCE(pc->aux_head); in compat_auxtrace_mmap__read_head()
1793 last = READ_ONCE(pc->aux_head); in compat_auxtrace_mmap__read_head()
1801 struct perf_event_mmap_page *pc = mm->userpg; in compat_auxtrace_mmap__write_tail()
1805 return -1; in compat_auxtrace_mmap__write_tail()
1809 WRITE_ONCE(pc->aux_tail, tail); in compat_auxtrace_mmap__write_tail()
1818 struct auxtrace_mmap *mm = &map->auxtrace_mmap; in __auxtrace_mmap__read()
1819 u64 head, old = mm->prev, offset, ref; in __auxtrace_mmap__read()
1820 unsigned char *data = mm->base; in __auxtrace_mmap__read()
1829 auxtrace_record__find_snapshot(itr, mm->idx, mm, data, &head, &old)) in __auxtrace_mmap__read()
1830 return -1; in __auxtrace_mmap__read()
1836 mm->idx, old, head, head - old); in __auxtrace_mmap__read()
1838 if (mm->mask) { in __auxtrace_mmap__read()
1839 head_off = head & mm->mask; in __auxtrace_mmap__read()
1840 old_off = old & mm->mask; in __auxtrace_mmap__read()
1842 head_off = head % mm->len; in __auxtrace_mmap__read()
1843 old_off = old % mm->len; in __auxtrace_mmap__read()
1847 size = head_off - old_off; in __auxtrace_mmap__read()
1849 size = mm->len - (old_off - head_off); in __auxtrace_mmap__read()
1856 if (head > old || size <= head || mm->mask) { in __auxtrace_mmap__read()
1857 offset = head - size; in __auxtrace_mmap__read()
1864 u64 rem = (0ULL - mm->len) % mm->len; in __auxtrace_mmap__read()
1866 offset = head - size - rem; in __auxtrace_mmap__read()
1870 len1 = size - head_off; in __auxtrace_mmap__read()
1871 data1 = &data[mm->len - len1]; in __auxtrace_mmap__read()
1876 data1 = &data[head_off - len1]; in __auxtrace_mmap__read()
1881 if (itr->alignment) { in __auxtrace_mmap__read()
1882 unsigned int unwanted = len1 % itr->alignment; in __auxtrace_mmap__read()
1884 len1 -= unwanted; in __auxtrace_mmap__read()
1885 size -= unwanted; in __auxtrace_mmap__read()
1889 padding = size & (PERF_AUXTRACE_RECORD_ALIGNMENT - 1); in __auxtrace_mmap__read()
1891 padding = PERF_AUXTRACE_RECORD_ALIGNMENT - padding; in __auxtrace_mmap__read()
1899 ev.auxtrace.idx = mm->idx; in __auxtrace_mmap__read()
1900 ev.auxtrace.tid = mm->tid; in __auxtrace_mmap__read()
1901 ev.auxtrace.cpu = mm->cpu; in __auxtrace_mmap__read()
1904 return -1; in __auxtrace_mmap__read()
1906 mm->prev = head; in __auxtrace_mmap__read()
1915 if (itr->read_finish) { in __auxtrace_mmap__read()
1916 err = itr->read_finish(itr, mm->idx); in __auxtrace_mmap__read()
1940 * struct auxtrace_cache - hash table to implement a cache
1978 c->hashtable = ht; in auxtrace_cache__new()
1979 c->sz = sz; in auxtrace_cache__new()
1980 c->entry_size = entry_size; in auxtrace_cache__new()
1981 c->limit = (c->sz * limit_percent) / 100; in auxtrace_cache__new()
1982 c->bits = bits; in auxtrace_cache__new()
2000 for (i = 0; i < c->sz; i++) { in auxtrace_cache__drop()
2001 hlist_for_each_entry_safe(entry, tmp, &c->hashtable[i], hash) { in auxtrace_cache__drop()
2002 hlist_del(&entry->hash); in auxtrace_cache__drop()
2007 c->cnt = 0; in auxtrace_cache__drop()
2016 zfree(&c->hashtable); in auxtrace_cache__free()
2022 return malloc(c->entry_size); in auxtrace_cache__alloc_entry()
2034 if (c->limit && ++c->cnt > c->limit) in auxtrace_cache__add()
2037 entry->key = key; in auxtrace_cache__add()
2038 hlist_add_head(&entry->hash, &c->hashtable[hash_32(key, c->bits)]); in auxtrace_cache__add()
2053 hlist = &c->hashtable[hash_32(key, c->bits)]; in auxtrace_cache__rm()
2055 if (entry->key == key) { in auxtrace_cache__rm()
2056 hlist_del(&entry->hash); in auxtrace_cache__rm()
2079 hlist = &c->hashtable[hash_32(key, c->bits)]; in auxtrace_cache__lookup()
2081 if (entry->key == key) in auxtrace_cache__lookup()
2090 zfree(&filt->str); in addr_filter__free_str()
2091 filt->action = NULL; in addr_filter__free_str()
2092 filt->sym_from = NULL; in addr_filter__free_str()
2093 filt->sym_to = NULL; in addr_filter__free_str()
2094 filt->filename = NULL; in addr_filter__free_str()
2102 INIT_LIST_HEAD(&filt->list); in addr_filter__new()
2117 list_add_tail(&filt->list, &filts->head); in addr_filters__add()
2118 filts->cnt += 1; in addr_filters__add()
2124 list_del_init(&filt->list); in addr_filters__del()
2125 filts->cnt -= 1; in addr_filters__del()
2130 INIT_LIST_HEAD(&filts->head); in addr_filters__init()
2131 filts->cnt = 0; in addr_filters__init()
2138 list_for_each_entry_safe(filt, n, &filts->head, list) { in addr_filters__exit()
2153 return -EINVAL; in parse_num_or_str()
2157 return -errno; in parse_num_or_str()
2159 return -EINVAL; in parse_num_or_str()
2165 return -EINVAL; in parse_num_or_str()
2170 return -EINVAL; in parse_num_or_str()
2182 if (!strcmp(filt->action, "filter")) { in parse_action()
2183 filt->start = true; in parse_action()
2184 filt->range = true; in parse_action()
2185 } else if (!strcmp(filt->action, "start")) { in parse_action()
2186 filt->start = true; in parse_action()
2187 } else if (!strcmp(filt->action, "stop")) { in parse_action()
2188 filt->start = false; in parse_action()
2189 } else if (!strcmp(filt->action, "tracestop")) { in parse_action()
2190 filt->start = false; in parse_action()
2191 filt->range = true; in parse_action()
2192 filt->action += 5; /* Change 'tracestop' to 'stop' */ in parse_action()
2194 return -EINVAL; in parse_action()
2201 *idx = -1; in parse_sym_idx()
2220 return -errno; in parse_sym_idx()
2222 return -EINVAL; in parse_sym_idx()
2245 filt->str = fstr = strdup(*filter_inp); in parse_one_filter()
2247 return -ENOMEM; in parse_one_filter()
2249 err = parse_num_or_str(&fstr, NULL, &filt->action, " "); in parse_one_filter()
2257 err = parse_addr_size(&fstr, &filt->addr, &filt->sym_from, in parse_one_filter()
2258 &filt->sym_from_idx); in parse_one_filter()
2266 err = parse_addr_size(&fstr, &filt->size, &filt->sym_to, in parse_one_filter()
2267 &filt->sym_to_idx); in parse_one_filter()
2270 filt->range = true; in parse_one_filter()
2277 err = parse_num_or_str(&fstr, NULL, &filt->filename, " ,"); in parse_one_filter()
2284 *filter_inp += fstr - filt->str; in parse_one_filter()
2340 kern_sym_name_match(name, args->name) && in kern_sym_match()
2341 ((args->global && isupper(type)) || in kern_sym_match()
2342 (args->selected && ++(args->cnt) == args->idx) || in kern_sym_match()
2343 (!args->global && !args->selected)); in kern_sym_match()
2350 if (args->started) { in find_kern_sym_cb()
2351 if (!args->size) in find_kern_sym_cb()
2352 args->size = start - args->start; in find_kern_sym_cb()
2353 if (args->selected) { in find_kern_sym_cb()
2354 if (args->size) in find_kern_sym_cb()
2357 args->duplicate = true; in find_kern_sym_cb()
2361 args->started = true; in find_kern_sym_cb()
2362 args->start = start; in find_kern_sym_cb()
2374 ++args->cnt, start, type, name); in print_kern_sym_cb()
2375 args->near = true; in print_kern_sym_cb()
2376 } else if (args->near) { in print_kern_sym_cb()
2377 args->near = false; in print_kern_sym_cb()
2396 return -EINVAL; in sym_not_found_error()
2425 return -EINVAL; in find_kern_sym()
2447 if (!args->started) { in find_entire_kern_cb()
2448 args->started = true; in find_entire_kern_cb()
2449 args->start = start; in find_entire_kern_cb()
2452 args->size = round_up(start, page_size) + page_size - args->start; in find_entire_kern_cb()
2468 filt->addr = args.start; in addr_filter__entire_kernel()
2469 filt->size = args.size; in addr_filter__entire_kernel()
2476 if (start + size >= filt->addr) in check_end_after_start()
2479 if (filt->sym_from) { in check_end_after_start()
2481 filt->sym_to, start, filt->sym_from, filt->addr); in check_end_after_start()
2484 filt->sym_to, start, filt->addr); in check_end_after_start()
2487 return -EINVAL; in check_end_after_start()
2498 return -EINVAL; in addr_filter__resolve_kernel_syms()
2501 if (filt->sym_from && !strcmp(filt->sym_from, "*")) in addr_filter__resolve_kernel_syms()
2504 if (filt->sym_from) { in addr_filter__resolve_kernel_syms()
2505 err = find_kern_sym(filt->sym_from, &start, &size, in addr_filter__resolve_kernel_syms()
2506 filt->sym_from_idx); in addr_filter__resolve_kernel_syms()
2509 filt->addr = start; in addr_filter__resolve_kernel_syms()
2510 if (filt->range && !filt->size && !filt->sym_to) { in addr_filter__resolve_kernel_syms()
2511 filt->size = size; in addr_filter__resolve_kernel_syms()
2516 if (filt->sym_to) { in addr_filter__resolve_kernel_syms()
2517 err = find_kern_sym(filt->sym_to, &start, &size, in addr_filter__resolve_kernel_syms()
2518 filt->sym_to_idx); in addr_filter__resolve_kernel_syms()
2525 filt->size = start + size - filt->addr; in addr_filter__resolve_kernel_syms()
2532 filt->sym_to ? filt->sym_to : filt->sym_from); in addr_filter__resolve_kernel_syms()
2533 return -EINVAL; in addr_filter__resolve_kernel_syms()
2551 dso = dso__get(map->dso); in load_dso()
2562 return !arch__compare_symbol_names(name, sym->name) && in dso_sym_match()
2563 ((!idx && sym->binding == STB_GLOBAL) || in dso_sym_match()
2578 if (dso_sym_match(sym, sym_name, &cnt, -1)) { in print_duplicate_syms()
2580 ++cnt, sym->start, in print_duplicate_syms()
2581 sym->binding == STB_GLOBAL ? 'g' : in print_duplicate_syms()
2582 sym->binding == STB_LOCAL ? 'l' : 'w', in print_duplicate_syms()
2583 sym->name); in print_duplicate_syms()
2587 pr_err("\t\twhich is near\t\t%s\n", sym->name); in print_duplicate_syms()
2610 *size = sym->start - *start; in find_dso_sym()
2616 return -EINVAL; in find_dso_sym()
2619 *start = sym->start; in find_dso_sym()
2620 *size = sym->end - sym->start; in find_dso_sym()
2635 filt->filename); in addr_filter__entire_dso()
2636 return -EINVAL; in addr_filter__entire_dso()
2639 filt->addr = 0; in addr_filter__entire_dso()
2640 filt->size = dso->data.file_size; in addr_filter__entire_dso()
2651 if (!filt->sym_from && !filt->sym_to) in addr_filter__resolve_syms()
2654 if (!filt->filename) in addr_filter__resolve_syms()
2657 dso = load_dso(filt->filename); in addr_filter__resolve_syms()
2659 pr_err("Failed to load symbols from: %s\n", filt->filename); in addr_filter__resolve_syms()
2660 return -EINVAL; in addr_filter__resolve_syms()
2663 if (filt->sym_from && !strcmp(filt->sym_from, "*")) { in addr_filter__resolve_syms()
2668 if (filt->sym_from) { in addr_filter__resolve_syms()
2669 err = find_dso_sym(dso, filt->sym_from, &start, &size, in addr_filter__resolve_syms()
2670 filt->sym_from_idx); in addr_filter__resolve_syms()
2673 filt->addr = start; in addr_filter__resolve_syms()
2674 if (filt->range && !filt->size && !filt->sym_to) in addr_filter__resolve_syms()
2675 filt->size = size; in addr_filter__resolve_syms()
2678 if (filt->sym_to) { in addr_filter__resolve_syms()
2679 err = find_dso_sym(dso, filt->sym_to, &start, &size, in addr_filter__resolve_syms()
2680 filt->sym_to_idx); in addr_filter__resolve_syms()
2688 filt->size = start + size - filt->addr; in addr_filter__resolve_syms()
2705 if (filt->filename) { in addr_filter__to_str()
2707 fn = realpath(filt->filename, filename_buf); in addr_filter__to_str()
2712 if (filt->range) { in addr_filter__to_str()
2714 filt->action, filt->addr, filt->size, at, fn); in addr_filter__to_str()
2717 filt->action, filt->addr, at, fn); in addr_filter__to_str()
2739 err = -EINVAL; in parse_addr_filter()
2752 err = -ENOMEM; in parse_addr_filter()
2757 err = -ENOMEM; in parse_addr_filter()
2794 filter = evsel->filter; in auxtrace_parse_filters()
2798 evsel->filter = NULL; in auxtrace_parse_filters()
2803 pr_debug("Address filter: %s\n", evsel->filter); in auxtrace_parse_filters()
2812 if (!session->auxtrace) in auxtrace__process_event()
2815 return session->auxtrace->process_event(session, event, sample, tool); in auxtrace__process_event()
2821 if (!session->auxtrace || !session->auxtrace->dump_auxtrace_sample || in auxtrace__dump_auxtrace_sample()
2825 session->auxtrace->dump_auxtrace_sample(session, sample); in auxtrace__dump_auxtrace_sample()
2830 if (!session->auxtrace) in auxtrace__flush_events()
2833 return session->auxtrace->flush_events(session, tool); in auxtrace__flush_events()
2838 if (!session->auxtrace) in auxtrace__free_events()
2841 return session->auxtrace->free_events(session); in auxtrace__free_events()
2846 if (!session->auxtrace) in auxtrace__free()
2849 return session->auxtrace->free(session); in auxtrace__free()
2855 if (!session->auxtrace || !session->auxtrace->evsel_is_auxtrace) in auxtrace__evsel_is_auxtrace()
2858 return session->auxtrace->evsel_is_auxtrace(session, evsel); in auxtrace__evsel_is_auxtrace()