Lines Matching full:event
39 union perf_event *event, u64 file_offset) in perf_session__process_compressed_event() argument
69 src = (void *)event + sizeof(struct perf_record_compressed); in perf_session__process_compressed_event()
70 src_size = event->pack.header.size - sizeof(struct perf_record_compressed); in perf_session__process_compressed_event()
99 union perf_event *event,
177 struct ordered_event *event) in ordered_events__deliver_event() argument
182 return perf_session__deliver_event(session, event->event, in ordered_events__deliver_event()
183 session->tool, event->file_offset); in ordered_events__deliver_event()
247 * kernel MMAP event, in perf_event__process_mmap(). in perf_session__new()
309 union perf_event *event in process_event_synth_tracing_data_stub()
317 union perf_event *event __maybe_unused, in process_event_synth_attr_stub()
326 union perf_event *event __maybe_unused, in process_event_synth_event_update_stub()
331 perf_event__fprintf_event_update(event, stdout); in process_event_synth_event_update_stub()
338 union perf_event *event __maybe_unused, in process_event_sample_stub()
348 union perf_event *event __maybe_unused, in process_event_stub()
357 union perf_event *event __maybe_unused, in process_finished_round_stub()
365 union perf_event *event,
384 union perf_event *event) in process_event_auxtrace_stub() argument
388 skipn(perf_data__fd(session->data), event->auxtrace.size); in process_event_auxtrace_stub()
389 return event->auxtrace.size; in process_event_auxtrace_stub()
393 union perf_event *event __maybe_unused) in process_event_op2_stub()
402 union perf_event *event __maybe_unused) in process_event_thread_map_stub()
405 perf_event__fprintf_thread_map(event, stdout); in process_event_thread_map_stub()
413 union perf_event *event __maybe_unused) in process_event_cpu_map_stub()
416 perf_event__fprintf_cpu_map(event, stdout); in process_event_cpu_map_stub()
424 union perf_event *event __maybe_unused) in process_event_stat_config_stub()
427 perf_event__fprintf_stat_config(event, stdout); in process_event_stat_config_stub()
434 union perf_event *event) in process_stat_stub() argument
437 perf_event__fprintf_stat(event, stdout); in process_stat_stub()
444 union perf_event *event) in process_stat_round_stub() argument
447 perf_event__fprintf_stat_round(event, stdout); in process_stat_round_stub()
454 union perf_event *event __maybe_unused, in perf_session__process_compressed_event_stub()
541 static void swap_sample_id_all(union perf_event *event, void *data) in swap_sample_id_all() argument
543 void *end = (void *) event + event->header.size; in swap_sample_id_all()
550 static void perf_event__all64_swap(union perf_event *event, in perf_event__all64_swap() argument
553 struct perf_event_header *hdr = &event->header; in perf_event__all64_swap()
554 mem_bswap_64(hdr + 1, event->header.size - sizeof(*hdr)); in perf_event__all64_swap()
557 static void perf_event__comm_swap(union perf_event *event, bool sample_id_all) in perf_event__comm_swap() argument
559 event->comm.pid = bswap_32(event->comm.pid); in perf_event__comm_swap()
560 event->comm.tid = bswap_32(event->comm.tid); in perf_event__comm_swap()
563 void *data = &event->comm.comm; in perf_event__comm_swap()
566 swap_sample_id_all(event, data); in perf_event__comm_swap()
570 static void perf_event__mmap_swap(union perf_event *event, in perf_event__mmap_swap() argument
573 event->mmap.pid = bswap_32(event->mmap.pid); in perf_event__mmap_swap()
574 event->mmap.tid = bswap_32(event->mmap.tid); in perf_event__mmap_swap()
575 event->mmap.start = bswap_64(event->mmap.start); in perf_event__mmap_swap()
576 event->mmap.len = bswap_64(event->mmap.len); in perf_event__mmap_swap()
577 event->mmap.pgoff = bswap_64(event->mmap.pgoff); in perf_event__mmap_swap()
580 void *data = &event->mmap.filename; in perf_event__mmap_swap()
583 swap_sample_id_all(event, data); in perf_event__mmap_swap()
587 static void perf_event__mmap2_swap(union perf_event *event, in perf_event__mmap2_swap() argument
590 event->mmap2.pid = bswap_32(event->mmap2.pid); in perf_event__mmap2_swap()
591 event->mmap2.tid = bswap_32(event->mmap2.tid); in perf_event__mmap2_swap()
592 event->mmap2.start = bswap_64(event->mmap2.start); in perf_event__mmap2_swap()
593 event->mmap2.len = bswap_64(event->mmap2.len); in perf_event__mmap2_swap()
594 event->mmap2.pgoff = bswap_64(event->mmap2.pgoff); in perf_event__mmap2_swap()
595 event->mmap2.maj = bswap_32(event->mmap2.maj); in perf_event__mmap2_swap()
596 event->mmap2.min = bswap_32(event->mmap2.min); in perf_event__mmap2_swap()
597 event->mmap2.ino = bswap_64(event->mmap2.ino); in perf_event__mmap2_swap()
598 event->mmap2.ino_generation = bswap_64(event->mmap2.ino_generation); in perf_event__mmap2_swap()
601 void *data = &event->mmap2.filename; in perf_event__mmap2_swap()
604 swap_sample_id_all(event, data); in perf_event__mmap2_swap()
607 static void perf_event__task_swap(union perf_event *event, bool sample_id_all) in perf_event__task_swap() argument
609 event->fork.pid = bswap_32(event->fork.pid); in perf_event__task_swap()
610 event->fork.tid = bswap_32(event->fork.tid); in perf_event__task_swap()
611 event->fork.ppid = bswap_32(event->fork.ppid); in perf_event__task_swap()
612 event->fork.ptid = bswap_32(event->fork.ptid); in perf_event__task_swap()
613 event->fork.time = bswap_64(event->fork.time); in perf_event__task_swap()
616 swap_sample_id_all(event, &event->fork + 1); in perf_event__task_swap()
619 static void perf_event__read_swap(union perf_event *event, bool sample_id_all) in perf_event__read_swap() argument
621 event->read.pid = bswap_32(event->read.pid); in perf_event__read_swap()
622 event->read.tid = bswap_32(event->read.tid); in perf_event__read_swap()
623 event->read.value = bswap_64(event->read.value); in perf_event__read_swap()
624 event->read.time_enabled = bswap_64(event->read.time_enabled); in perf_event__read_swap()
625 event->read.time_running = bswap_64(event->read.time_running); in perf_event__read_swap()
626 event->read.id = bswap_64(event->read.id); in perf_event__read_swap()
629 swap_sample_id_all(event, &event->read + 1); in perf_event__read_swap()
632 static void perf_event__aux_swap(union perf_event *event, bool sample_id_all) in perf_event__aux_swap() argument
634 event->aux.aux_offset = bswap_64(event->aux.aux_offset); in perf_event__aux_swap()
635 event->aux.aux_size = bswap_64(event->aux.aux_size); in perf_event__aux_swap()
636 event->aux.flags = bswap_64(event->aux.flags); in perf_event__aux_swap()
639 swap_sample_id_all(event, &event->aux + 1); in perf_event__aux_swap()
642 static void perf_event__itrace_start_swap(union perf_event *event, in perf_event__itrace_start_swap() argument
645 event->itrace_start.pid = bswap_32(event->itrace_start.pid); in perf_event__itrace_start_swap()
646 event->itrace_start.tid = bswap_32(event->itrace_start.tid); in perf_event__itrace_start_swap()
649 swap_sample_id_all(event, &event->itrace_start + 1); in perf_event__itrace_start_swap()
652 static void perf_event__switch_swap(union perf_event *event, bool sample_id_all) in perf_event__switch_swap() argument
654 if (event->header.type == PERF_RECORD_SWITCH_CPU_WIDE) { in perf_event__switch_swap()
655 event->context_switch.next_prev_pid = in perf_event__switch_swap()
656 bswap_32(event->context_switch.next_prev_pid); in perf_event__switch_swap()
657 event->context_switch.next_prev_tid = in perf_event__switch_swap()
658 bswap_32(event->context_switch.next_prev_tid); in perf_event__switch_swap()
662 swap_sample_id_all(event, &event->context_switch + 1); in perf_event__switch_swap()
665 static void perf_event__text_poke_swap(union perf_event *event, bool sample_id_all) in perf_event__text_poke_swap() argument
667 event->text_poke.addr = bswap_64(event->text_poke.addr); in perf_event__text_poke_swap()
668 event->text_poke.old_len = bswap_16(event->text_poke.old_len); in perf_event__text_poke_swap()
669 event->text_poke.new_len = bswap_16(event->text_poke.new_len); in perf_event__text_poke_swap()
672 size_t len = sizeof(event->text_poke.old_len) + in perf_event__text_poke_swap()
673 sizeof(event->text_poke.new_len) + in perf_event__text_poke_swap()
674 event->text_poke.old_len + in perf_event__text_poke_swap()
675 event->text_poke.new_len; in perf_event__text_poke_swap()
676 void *data = &event->text_poke.old_len; in perf_event__text_poke_swap()
679 swap_sample_id_all(event, data); in perf_event__text_poke_swap()
683 static void perf_event__throttle_swap(union perf_event *event, in perf_event__throttle_swap() argument
686 event->throttle.time = bswap_64(event->throttle.time); in perf_event__throttle_swap()
687 event->throttle.id = bswap_64(event->throttle.id); in perf_event__throttle_swap()
688 event->throttle.stream_id = bswap_64(event->throttle.stream_id); in perf_event__throttle_swap()
691 swap_sample_id_all(event, &event->throttle + 1); in perf_event__throttle_swap()
694 static void perf_event__namespaces_swap(union perf_event *event, in perf_event__namespaces_swap() argument
699 event->namespaces.pid = bswap_32(event->namespaces.pid); in perf_event__namespaces_swap()
700 event->namespaces.tid = bswap_32(event->namespaces.tid); in perf_event__namespaces_swap()
701 event->namespaces.nr_namespaces = bswap_64(event->namespaces.nr_namespaces); in perf_event__namespaces_swap()
703 for (i = 0; i < event->namespaces.nr_namespaces; i++) { in perf_event__namespaces_swap()
704 struct perf_ns_link_info *ns = &event->namespaces.link_info[i]; in perf_event__namespaces_swap()
711 swap_sample_id_all(event, &event->namespaces.link_info[i]); in perf_event__namespaces_swap()
714 static void perf_event__cgroup_swap(union perf_event *event, bool sample_id_all) in perf_event__cgroup_swap() argument
716 event->cgroup.id = bswap_64(event->cgroup.id); in perf_event__cgroup_swap()
719 void *data = &event->cgroup.path; in perf_event__cgroup_swap()
722 swap_sample_id_all(event, data); in perf_event__cgroup_swap()
804 static void perf_event__hdr_attr_swap(union perf_event *event, in perf_event__hdr_attr_swap() argument
809 perf_event__attr_swap(&event->attr.attr); in perf_event__hdr_attr_swap()
811 size = event->header.size; in perf_event__hdr_attr_swap()
812 size -= (void *)&event->attr.id - (void *)event; in perf_event__hdr_attr_swap()
813 mem_bswap_64(event->attr.id, size); in perf_event__hdr_attr_swap()
816 static void perf_event__event_update_swap(union perf_event *event, in perf_event__event_update_swap() argument
819 event->event_update.type = bswap_64(event->event_update.type); in perf_event__event_update_swap()
820 event->event_update.id = bswap_64(event->event_update.id); in perf_event__event_update_swap()
823 static void perf_event__event_type_swap(union perf_event *event, in perf_event__event_type_swap() argument
826 event->event_type.event_type.event_id = in perf_event__event_type_swap()
827 bswap_64(event->event_type.event_type.event_id); in perf_event__event_type_swap()
830 static void perf_event__tracing_data_swap(union perf_event *event, in perf_event__tracing_data_swap() argument
833 event->tracing_data.size = bswap_32(event->tracing_data.size); in perf_event__tracing_data_swap()
836 static void perf_event__auxtrace_info_swap(union perf_event *event, in perf_event__auxtrace_info_swap() argument
841 event->auxtrace_info.type = bswap_32(event->auxtrace_info.type); in perf_event__auxtrace_info_swap()
843 size = event->header.size; in perf_event__auxtrace_info_swap()
844 size -= (void *)&event->auxtrace_info.priv - (void *)event; in perf_event__auxtrace_info_swap()
845 mem_bswap_64(event->auxtrace_info.priv, size); in perf_event__auxtrace_info_swap()
848 static void perf_event__auxtrace_swap(union perf_event *event, in perf_event__auxtrace_swap() argument
851 event->auxtrace.size = bswap_64(event->auxtrace.size); in perf_event__auxtrace_swap()
852 event->auxtrace.offset = bswap_64(event->auxtrace.offset); in perf_event__auxtrace_swap()
853 event->auxtrace.reference = bswap_64(event->auxtrace.reference); in perf_event__auxtrace_swap()
854 event->auxtrace.idx = bswap_32(event->auxtrace.idx); in perf_event__auxtrace_swap()
855 event->auxtrace.tid = bswap_32(event->auxtrace.tid); in perf_event__auxtrace_swap()
856 event->auxtrace.cpu = bswap_32(event->auxtrace.cpu); in perf_event__auxtrace_swap()
859 static void perf_event__auxtrace_error_swap(union perf_event *event, in perf_event__auxtrace_error_swap() argument
862 event->auxtrace_error.type = bswap_32(event->auxtrace_error.type); in perf_event__auxtrace_error_swap()
863 event->auxtrace_error.code = bswap_32(event->auxtrace_error.code); in perf_event__auxtrace_error_swap()
864 event->auxtrace_error.cpu = bswap_32(event->auxtrace_error.cpu); in perf_event__auxtrace_error_swap()
865 event->auxtrace_error.pid = bswap_32(event->auxtrace_error.pid); in perf_event__auxtrace_error_swap()
866 event->auxtrace_error.tid = bswap_32(event->auxtrace_error.tid); in perf_event__auxtrace_error_swap()
867 event->auxtrace_error.fmt = bswap_32(event->auxtrace_error.fmt); in perf_event__auxtrace_error_swap()
868 event->auxtrace_error.ip = bswap_64(event->auxtrace_error.ip); in perf_event__auxtrace_error_swap()
869 if (event->auxtrace_error.fmt) in perf_event__auxtrace_error_swap()
870 event->auxtrace_error.time = bswap_64(event->auxtrace_error.time); in perf_event__auxtrace_error_swap()
873 static void perf_event__thread_map_swap(union perf_event *event, in perf_event__thread_map_swap() argument
878 event->thread_map.nr = bswap_64(event->thread_map.nr); in perf_event__thread_map_swap()
880 for (i = 0; i < event->thread_map.nr; i++) in perf_event__thread_map_swap()
881 event->thread_map.entries[i].pid = bswap_64(event->thread_map.entries[i].pid); in perf_event__thread_map_swap()
884 static void perf_event__cpu_map_swap(union perf_event *event, in perf_event__cpu_map_swap() argument
887 struct perf_record_cpu_map_data *data = &event->cpu_map.data; in perf_event__cpu_map_swap()
920 static void perf_event__stat_config_swap(union perf_event *event, in perf_event__stat_config_swap() argument
925 size = event->stat_config.nr * sizeof(event->stat_config.data[0]); in perf_event__stat_config_swap()
927 mem_bswap_64(&event->stat_config.nr, size); in perf_event__stat_config_swap()
930 static void perf_event__stat_swap(union perf_event *event, in perf_event__stat_swap() argument
933 event->stat.id = bswap_64(event->stat.id); in perf_event__stat_swap()
934 event->stat.thread = bswap_32(event->stat.thread); in perf_event__stat_swap()
935 event->stat.cpu = bswap_32(event->stat.cpu); in perf_event__stat_swap()
936 event->stat.val = bswap_64(event->stat.val); in perf_event__stat_swap()
937 event->stat.ena = bswap_64(event->stat.ena); in perf_event__stat_swap()
938 event->stat.run = bswap_64(event->stat.run); in perf_event__stat_swap()
941 static void perf_event__stat_round_swap(union perf_event *event, in perf_event__stat_round_swap() argument
944 event->stat_round.type = bswap_64(event->stat_round.type); in perf_event__stat_round_swap()
945 event->stat_round.time = bswap_64(event->stat_round.time); in perf_event__stat_round_swap()
948 typedef void (*perf_event__swap_op)(union perf_event *event,
990 * event.
1028 union perf_event *event __maybe_unused, in process_finished_round()
1036 int perf_session__queue_event(struct perf_session *s, union perf_event *event, in perf_session__queue_event() argument
1039 return ordered_events__queue(&s->ordered_events, event, timestamp, file_offset); in perf_session__queue_event()
1195 union perf_event *event, in perf_evlist__print_tstamp() argument
1200 if (event->header.type != PERF_RECORD_SAMPLE && in perf_evlist__print_tstamp()
1243 static void dump_event(struct evlist *evlist, union perf_event *event, in dump_event() argument
1249 printf("\n%#" PRIx64 " [%#x]: event: %d\n", in dump_event()
1250 file_offset, event->header.size, event->header.type); in dump_event()
1252 trace_event(event); in dump_event()
1253 if (event->header.type == PERF_RECORD_SAMPLE && evlist->trace_event_sample_raw) in dump_event()
1254 evlist->trace_event_sample_raw(evlist, event, sample); in dump_event()
1257 perf_evlist__print_tstamp(evlist, event, sample); in dump_event()
1260 event->header.size, perf_event__name(event->header.type)); in dump_event()
1263 static void dump_sample(struct evsel *evsel, union perf_event *event, in dump_sample() argument
1272 event->header.misc, sample->pid, sample->tid, sample->ip, in dump_sample()
1308 static void dump_read(struct evsel *evsel, union perf_event *event) in dump_read() argument
1310 struct perf_record_read *read_event = &event->read; in dump_read()
1316 printf(": %d %d %s %" PRI_lu64 "\n", event->read.pid, event->read.tid, in dump_read()
1317 evsel__name(evsel), event->read.value); in dump_read()
1335 union perf_event *event, in machines__find_for_cpumode() argument
1345 if (event->header.type == PERF_RECORD_MMAP in machines__find_for_cpumode()
1346 || event->header.type == PERF_RECORD_MMAP2) in machines__find_for_cpumode()
1347 pid = event->mmap.pid; in machines__find_for_cpumode()
1362 union perf_event *event, in deliver_sample_value() argument
1389 return tool->sample(tool, event, sample, evsel, machine); in deliver_sample_value()
1394 union perf_event *event, in deliver_sample_group() argument
1402 ret = deliver_sample_value(evlist, tool, event, sample, in deliver_sample_group()
1415 union perf_event *event, in perf_evlist__deliver_sample() argument
1426 return tool->sample(tool, event, sample, evsel, machine); in perf_evlist__deliver_sample()
1430 return deliver_sample_group(evlist, tool, event, sample, in perf_evlist__deliver_sample()
1433 return deliver_sample_value(evlist, tool, event, sample, in perf_evlist__deliver_sample()
1439 union perf_event *event, in machines__deliver_event() argument
1446 dump_event(evlist, event, file_offset, sample); in machines__deliver_event()
1450 machine = machines__find_for_cpumode(machines, event, sample); in machines__deliver_event()
1452 switch (event->header.type) { in machines__deliver_event()
1458 dump_sample(evsel, event, sample); in machines__deliver_event()
1463 return perf_evlist__deliver_sample(evlist, tool, event, sample, evsel, machine); in machines__deliver_event()
1465 return tool->mmap(tool, event, sample, machine); in machines__deliver_event()
1467 if (event->header.misc & PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT) in machines__deliver_event()
1469 return tool->mmap2(tool, event, sample, machine); in machines__deliver_event()
1471 return tool->comm(tool, event, sample, machine); in machines__deliver_event()
1473 return tool->namespaces(tool, event, sample, machine); in machines__deliver_event()
1475 return tool->cgroup(tool, event, sample, machine); in machines__deliver_event()
1477 return tool->fork(tool, event, sample, machine); in machines__deliver_event()
1479 return tool->exit(tool, event, sample, machine); in machines__deliver_event()
1482 evlist->stats.total_lost += event->lost.lost; in machines__deliver_event()
1483 return tool->lost(tool, event, sample, machine); in machines__deliver_event()
1486 evlist->stats.total_lost_samples += event->lost_samples.lost; in machines__deliver_event()
1487 return tool->lost_samples(tool, event, sample, machine); in machines__deliver_event()
1489 dump_read(evsel, event); in machines__deliver_event()
1490 return tool->read(tool, event, sample, evsel, machine); in machines__deliver_event()
1492 return tool->throttle(tool, event, sample, machine); in machines__deliver_event()
1494 return tool->unthrottle(tool, event, sample, machine); in machines__deliver_event()
1497 if (event->aux.flags & PERF_AUX_FLAG_TRUNCATED) in machines__deliver_event()
1499 if (event->aux.flags & PERF_AUX_FLAG_PARTIAL) in machines__deliver_event()
1502 return tool->aux(tool, event, sample, machine); in machines__deliver_event()
1504 return tool->itrace_start(tool, event, sample, machine); in machines__deliver_event()
1507 return tool->context_switch(tool, event, sample, machine); in machines__deliver_event()
1509 return tool->ksymbol(tool, event, sample, machine); in machines__deliver_event()
1511 return tool->bpf(tool, event, sample, machine); in machines__deliver_event()
1513 return tool->text_poke(tool, event, sample, machine); in machines__deliver_event()
1521 union perf_event *event, in perf_session__deliver_event() argument
1528 ret = perf_evlist__parse_sample(session->evlist, event, &sample); in perf_session__deliver_event()
1534 ret = auxtrace__process_event(session, event, &sample, tool); in perf_session__deliver_event()
1541 event, &sample, tool, file_offset); in perf_session__deliver_event()
1550 union perf_event *event, in perf_session__process_user_event() argument
1559 if (event->header.type != PERF_RECORD_COMPRESSED || in perf_session__process_user_event()
1561 dump_event(session->evlist, event, file_offset, &sample); in perf_session__process_user_event()
1564 switch (event->header.type) { in perf_session__process_user_event()
1566 err = tool->attr(tool, event, &session->evlist); in perf_session__process_user_event()
1573 return tool->event_update(tool, event, &session->evlist); in perf_session__process_user_event()
1588 return tool->tracing_data(session, event); in perf_session__process_user_event()
1590 return tool->build_id(session, event); in perf_session__process_user_event()
1592 return tool->finished_round(tool, event, oe); in perf_session__process_user_event()
1594 return tool->id_index(session, event); in perf_session__process_user_event()
1596 return tool->auxtrace_info(session, event); in perf_session__process_user_event()
1599 lseek(fd, file_offset + event->header.size, SEEK_SET); in perf_session__process_user_event()
1600 return tool->auxtrace(session, event); in perf_session__process_user_event()
1602 perf_session__auxtrace_error_inc(session, event); in perf_session__process_user_event()
1603 return tool->auxtrace_error(session, event); in perf_session__process_user_event()
1605 return tool->thread_map(session, event); in perf_session__process_user_event()
1607 return tool->cpu_map(session, event); in perf_session__process_user_event()
1609 return tool->stat_config(session, event); in perf_session__process_user_event()
1611 return tool->stat(session, event); in perf_session__process_user_event()
1613 return tool->stat_round(session, event); in perf_session__process_user_event()
1615 session->time_conv = event->time_conv; in perf_session__process_user_event()
1616 return tool->time_conv(session, event); in perf_session__process_user_event()
1618 return tool->feature(session, event); in perf_session__process_user_event()
1620 err = tool->compressed(session, event, file_offset); in perf_session__process_user_event()
1622 dump_event(session->evlist, event, file_offset, &sample); in perf_session__process_user_event()
1630 union perf_event *event, in perf_session__deliver_synth_event() argument
1636 events_stats__inc(&evlist->stats, event->header.type); in perf_session__deliver_synth_event()
1638 if (event->header.type >= PERF_RECORD_USER_TYPE_START) in perf_session__deliver_synth_event()
1639 return perf_session__process_user_event(session, event, 0); in perf_session__deliver_synth_event()
1641 return machines__deliver_event(&session->machines, evlist, event, sample, tool, 0); in perf_session__deliver_synth_event()
1644 static void event_swap(union perf_event *event, bool sample_id_all) in event_swap() argument
1648 swap = perf_event__swap_ops[event->header.type]; in event_swap()
1650 swap(event, sample_id_all); in event_swap()
1658 union perf_event *event; in perf_session__peek_event() local
1663 event = file_offset - session->one_mmap_offset + in perf_session__peek_event()
1681 event = (union perf_event *)buf; in perf_session__peek_event()
1684 perf_event_header__bswap(&event->header); in perf_session__peek_event()
1686 if (event->header.size < hdr_sz || event->header.size > buf_sz) in perf_session__peek_event()
1689 rest = event->header.size - hdr_sz; in perf_session__peek_event()
1695 event_swap(event, evlist__sample_id_all(session->evlist)); in perf_session__peek_event()
1699 if (sample && event->header.type < PERF_RECORD_USER_TYPE_START && in perf_session__peek_event()
1700 perf_evlist__parse_sample(session->evlist, event, sample)) in perf_session__peek_event()
1703 *event_ptr = event; in perf_session__peek_event()
1713 union perf_event *event; in perf_session__peek_events() local
1718 PERF_SAMPLE_MAX_SIZE, &event, in perf_session__peek_events()
1723 err = cb(session, event, offset, data); in perf_session__peek_events()
1727 offset += event->header.size; in perf_session__peek_events()
1728 if (event->header.type == PERF_RECORD_AUXTRACE) in perf_session__peek_events()
1729 offset += event->auxtrace.size; in perf_session__peek_events()
1737 union perf_event *event, u64 file_offset) in perf_session__process_event() argument
1744 event_swap(event, evlist__sample_id_all(evlist)); in perf_session__process_event()
1746 if (event->header.type >= PERF_RECORD_HEADER_MAX) in perf_session__process_event()
1749 events_stats__inc(&evlist->stats, event->header.type); in perf_session__process_event()
1751 if (event->header.type >= PERF_RECORD_USER_TYPE_START) in perf_session__process_event()
1752 return perf_session__process_user_event(session, event, file_offset); in perf_session__process_event()
1757 ret = perf_evlist__parse_sample_timestamp(evlist, event, ×tamp); in perf_session__process_event()
1761 ret = perf_session__queue_event(session, event, timestamp, file_offset); in perf_session__process_event()
1766 return perf_session__deliver_event(session, event, tool, file_offset); in perf_session__process_event()
1941 union perf_event *event; in __perf_session__process_pipe_events() local
1959 event = buf; in __perf_session__process_pipe_events()
1960 err = readn(fd, event, sizeof(struct perf_event_header)); in __perf_session__process_pipe_events()
1965 pr_err("failed to read event header\n"); in __perf_session__process_pipe_events()
1970 perf_event_header__bswap(&event->header); in __perf_session__process_pipe_events()
1972 size = event->header.size; in __perf_session__process_pipe_events()
1974 pr_err("bad event header size\n"); in __perf_session__process_pipe_events()
1981 pr_err("failed to allocate memory to read event\n"); in __perf_session__process_pipe_events()
1986 event = buf; in __perf_session__process_pipe_events()
1988 p = event; in __perf_session__process_pipe_events()
1995 pr_err("unexpected end of event stream\n"); in __perf_session__process_pipe_events()
1999 pr_err("failed to read event data\n"); in __perf_session__process_pipe_events()
2004 if ((skip = perf_session__process_event(session, event, head)) < 0) { in __perf_session__process_pipe_events()
2006 head, event->header.size, event->header.type); in __perf_session__process_pipe_events()
2044 union perf_event *event; in prefetch_event() local
2048 * the size of the event in the headers. in prefetch_event()
2050 if (head + sizeof(event->header) > mmap_size) in prefetch_event()
2053 event = (union perf_event *)(buf + head); in prefetch_event()
2055 perf_event_header__bswap(&event->header); in prefetch_event()
2057 if (head + event->header.size <= mmap_size) in prefetch_event()
2058 return event; in prefetch_event()
2060 /* We're not fetching the event so swap back again */ in prefetch_event()
2062 perf_event_header__bswap(&event->header); in prefetch_event()
2064 pr_debug("%s: head=%#" PRIx64 " event->header_size=%#x, mmap_size=%#zx:" in prefetch_event()
2065 " fuzzed or compressed perf.data?\n",__func__, head, event->header.size, mmap_size); in prefetch_event()
2092 union perf_event *event = fetch_decomp_event(decomp->head, decomp->size, decomp->data, in __perf_session__process_decomp_events() local
2095 if (!event) in __perf_session__process_decomp_events()
2098 size = event->header.size; in __perf_session__process_decomp_events()
2101 (skip = perf_session__process_event(session, event, file_pos)) < 0) { in __perf_session__process_decomp_events()
2103 decomp->file_pos + decomp->head, event->header.size, event->header.type); in __perf_session__process_decomp_events()
2131 union perf_event *event,
2150 union perf_event *event; in reader__process_events() local
2193 event = fetch_mmaped_event(head, mmap_size, buf, session->header.needs_swap); in reader__process_events()
2194 if (IS_ERR(event)) in reader__process_events()
2195 return PTR_ERR(event); in reader__process_events()
2197 if (!event) { in reader__process_events()
2209 size = event->header.size; in reader__process_events()
2214 (skip = rd->process(session, event, file_pos)) < 0) { in reader__process_events()
2216 file_offset + head, event->header.size, in reader__process_events()
2217 event->header.type, strerror(-skip)); in reader__process_events()
2245 union perf_event *event, in process_simple() argument
2248 return perf_session__process_event(session, event, file_offset); in process_simple()
2453 union perf_event *event) in perf_event__process_id_index() argument
2456 struct perf_record_id_index *ie = &event->id_index; in perf_event__process_id_index()