Lines Matching full:event

43 				       union perf_event *event,
127 struct ordered_event *event) in ordered_events__deliver_event() argument
132 return perf_session__deliver_event(session, event->event, in ordered_events__deliver_event()
133 session->tool, event->file_offset, in ordered_events__deliver_event()
134 event->file_path); in ordered_events__deliver_event()
201 * kernel MMAP event, in perf_event__process_mmap(). in __perf_session__new()
262 static void swap_sample_id_all(union perf_event *event, void *data) in swap_sample_id_all() argument
264 void *end = (void *) event + event->header.size; in swap_sample_id_all()
271 static void perf_event__all64_swap(union perf_event *event, in perf_event__all64_swap() argument
274 struct perf_event_header *hdr = &event->header; in perf_event__all64_swap()
275 mem_bswap_64(hdr + 1, event->header.size - sizeof(*hdr)); in perf_event__all64_swap()
278 static void perf_event__comm_swap(union perf_event *event, bool sample_id_all) in perf_event__comm_swap() argument
280 event->comm.pid = bswap_32(event->comm.pid); in perf_event__comm_swap()
281 event->comm.tid = bswap_32(event->comm.tid); in perf_event__comm_swap()
284 void *data = &event->comm.comm; in perf_event__comm_swap()
287 swap_sample_id_all(event, data); in perf_event__comm_swap()
291 static void perf_event__mmap_swap(union perf_event *event, in perf_event__mmap_swap() argument
294 event->mmap.pid = bswap_32(event->mmap.pid); in perf_event__mmap_swap()
295 event->mmap.tid = bswap_32(event->mmap.tid); in perf_event__mmap_swap()
296 event->mmap.start = bswap_64(event->mmap.start); in perf_event__mmap_swap()
297 event->mmap.len = bswap_64(event->mmap.len); in perf_event__mmap_swap()
298 event->mmap.pgoff = bswap_64(event->mmap.pgoff); in perf_event__mmap_swap()
301 void *data = &event->mmap.filename; in perf_event__mmap_swap()
304 swap_sample_id_all(event, data); in perf_event__mmap_swap()
308 static void perf_event__mmap2_swap(union perf_event *event, in perf_event__mmap2_swap() argument
311 event->mmap2.pid = bswap_32(event->mmap2.pid); in perf_event__mmap2_swap()
312 event->mmap2.tid = bswap_32(event->mmap2.tid); in perf_event__mmap2_swap()
313 event->mmap2.start = bswap_64(event->mmap2.start); in perf_event__mmap2_swap()
314 event->mmap2.len = bswap_64(event->mmap2.len); in perf_event__mmap2_swap()
315 event->mmap2.pgoff = bswap_64(event->mmap2.pgoff); in perf_event__mmap2_swap()
317 if (!(event->header.misc & PERF_RECORD_MISC_MMAP_BUILD_ID)) { in perf_event__mmap2_swap()
318 event->mmap2.maj = bswap_32(event->mmap2.maj); in perf_event__mmap2_swap()
319 event->mmap2.min = bswap_32(event->mmap2.min); in perf_event__mmap2_swap()
320 event->mmap2.ino = bswap_64(event->mmap2.ino); in perf_event__mmap2_swap()
321 event->mmap2.ino_generation = bswap_64(event->mmap2.ino_generation); in perf_event__mmap2_swap()
325 void *data = &event->mmap2.filename; in perf_event__mmap2_swap()
328 swap_sample_id_all(event, data); in perf_event__mmap2_swap()
331 static void perf_event__task_swap(union perf_event *event, bool sample_id_all) in perf_event__task_swap() argument
333 event->fork.pid = bswap_32(event->fork.pid); in perf_event__task_swap()
334 event->fork.tid = bswap_32(event->fork.tid); in perf_event__task_swap()
335 event->fork.ppid = bswap_32(event->fork.ppid); in perf_event__task_swap()
336 event->fork.ptid = bswap_32(event->fork.ptid); in perf_event__task_swap()
337 event->fork.time = bswap_64(event->fork.time); in perf_event__task_swap()
340 swap_sample_id_all(event, &event->fork + 1); in perf_event__task_swap()
343 static void perf_event__read_swap(union perf_event *event, bool sample_id_all) in perf_event__read_swap() argument
345 event->read.pid = bswap_32(event->read.pid); in perf_event__read_swap()
346 event->read.tid = bswap_32(event->read.tid); in perf_event__read_swap()
347 event->read.value = bswap_64(event->read.value); in perf_event__read_swap()
348 event->read.time_enabled = bswap_64(event->read.time_enabled); in perf_event__read_swap()
349 event->read.time_running = bswap_64(event->read.time_running); in perf_event__read_swap()
350 event->read.id = bswap_64(event->read.id); in perf_event__read_swap()
353 swap_sample_id_all(event, &event->read + 1); in perf_event__read_swap()
356 static void perf_event__aux_swap(union perf_event *event, bool sample_id_all) in perf_event__aux_swap() argument
358 event->aux.aux_offset = bswap_64(event->aux.aux_offset); in perf_event__aux_swap()
359 event->aux.aux_size = bswap_64(event->aux.aux_size); in perf_event__aux_swap()
360 event->aux.flags = bswap_64(event->aux.flags); in perf_event__aux_swap()
363 swap_sample_id_all(event, &event->aux + 1); in perf_event__aux_swap()
366 static void perf_event__itrace_start_swap(union perf_event *event, in perf_event__itrace_start_swap() argument
369 event->itrace_start.pid = bswap_32(event->itrace_start.pid); in perf_event__itrace_start_swap()
370 event->itrace_start.tid = bswap_32(event->itrace_start.tid); in perf_event__itrace_start_swap()
373 swap_sample_id_all(event, &event->itrace_start + 1); in perf_event__itrace_start_swap()
376 static void perf_event__switch_swap(union perf_event *event, bool sample_id_all) in perf_event__switch_swap() argument
378 if (event->header.type == PERF_RECORD_SWITCH_CPU_WIDE) { in perf_event__switch_swap()
379 event->context_switch.next_prev_pid = in perf_event__switch_swap()
380 bswap_32(event->context_switch.next_prev_pid); in perf_event__switch_swap()
381 event->context_switch.next_prev_tid = in perf_event__switch_swap()
382 bswap_32(event->context_switch.next_prev_tid); in perf_event__switch_swap()
386 swap_sample_id_all(event, &event->context_switch + 1); in perf_event__switch_swap()
389 static void perf_event__text_poke_swap(union perf_event *event, bool sample_id_all) in perf_event__text_poke_swap() argument
391 event->text_poke.addr = bswap_64(event->text_poke.addr); in perf_event__text_poke_swap()
392 event->text_poke.old_len = bswap_16(event->text_poke.old_len); in perf_event__text_poke_swap()
393 event->text_poke.new_len = bswap_16(event->text_poke.new_len); in perf_event__text_poke_swap()
396 size_t len = sizeof(event->text_poke.old_len) + in perf_event__text_poke_swap()
397 sizeof(event->text_poke.new_len) + in perf_event__text_poke_swap()
398 event->text_poke.old_len + in perf_event__text_poke_swap()
399 event->text_poke.new_len; in perf_event__text_poke_swap()
400 void *data = &event->text_poke.old_len; in perf_event__text_poke_swap()
403 swap_sample_id_all(event, data); in perf_event__text_poke_swap()
407 static void perf_event__throttle_swap(union perf_event *event, in perf_event__throttle_swap() argument
410 event->throttle.time = bswap_64(event->throttle.time); in perf_event__throttle_swap()
411 event->throttle.id = bswap_64(event->throttle.id); in perf_event__throttle_swap()
412 event->throttle.stream_id = bswap_64(event->throttle.stream_id); in perf_event__throttle_swap()
415 swap_sample_id_all(event, &event->throttle + 1); in perf_event__throttle_swap()
418 static void perf_event__namespaces_swap(union perf_event *event, in perf_event__namespaces_swap() argument
423 event->namespaces.pid = bswap_32(event->namespaces.pid); in perf_event__namespaces_swap()
424 event->namespaces.tid = bswap_32(event->namespaces.tid); in perf_event__namespaces_swap()
425 event->namespaces.nr_namespaces = bswap_64(event->namespaces.nr_namespaces); in perf_event__namespaces_swap()
427 for (i = 0; i < event->namespaces.nr_namespaces; i++) { in perf_event__namespaces_swap()
428 struct perf_ns_link_info *ns = &event->namespaces.link_info[i]; in perf_event__namespaces_swap()
435 swap_sample_id_all(event, &event->namespaces.link_info[i]); in perf_event__namespaces_swap()
438 static void perf_event__cgroup_swap(union perf_event *event, bool sample_id_all) in perf_event__cgroup_swap() argument
440 event->cgroup.id = bswap_64(event->cgroup.id); in perf_event__cgroup_swap()
443 void *data = &event->cgroup.path; in perf_event__cgroup_swap()
446 swap_sample_id_all(event, data); in perf_event__cgroup_swap()
528 static void perf_event__hdr_attr_swap(union perf_event *event, in perf_event__hdr_attr_swap() argument
533 perf_event__attr_swap(&event->attr.attr); in perf_event__hdr_attr_swap()
535 size = event->header.size; in perf_event__hdr_attr_swap()
536 size -= perf_record_header_attr_id(event) - (void *)event; in perf_event__hdr_attr_swap()
537 mem_bswap_64(perf_record_header_attr_id(event), size); in perf_event__hdr_attr_swap()
540 static void perf_event__event_update_swap(union perf_event *event, in perf_event__event_update_swap() argument
543 event->event_update.type = bswap_64(event->event_update.type); in perf_event__event_update_swap()
544 event->event_update.id = bswap_64(event->event_update.id); in perf_event__event_update_swap()
547 static void perf_event__event_type_swap(union perf_event *event, in perf_event__event_type_swap() argument
550 event->event_type.event_type.event_id = in perf_event__event_type_swap()
551 bswap_64(event->event_type.event_type.event_id); in perf_event__event_type_swap()
554 static void perf_event__tracing_data_swap(union perf_event *event, in perf_event__tracing_data_swap() argument
557 event->tracing_data.size = bswap_32(event->tracing_data.size); in perf_event__tracing_data_swap()
560 static void perf_event__auxtrace_info_swap(union perf_event *event, in perf_event__auxtrace_info_swap() argument
565 event->auxtrace_info.type = bswap_32(event->auxtrace_info.type); in perf_event__auxtrace_info_swap()
567 size = event->header.size; in perf_event__auxtrace_info_swap()
568 size -= (void *)&event->auxtrace_info.priv - (void *)event; in perf_event__auxtrace_info_swap()
569 mem_bswap_64(event->auxtrace_info.priv, size); in perf_event__auxtrace_info_swap()
572 static void perf_event__auxtrace_swap(union perf_event *event, in perf_event__auxtrace_swap() argument
575 event->auxtrace.size = bswap_64(event->auxtrace.size); in perf_event__auxtrace_swap()
576 event->auxtrace.offset = bswap_64(event->auxtrace.offset); in perf_event__auxtrace_swap()
577 event->auxtrace.reference = bswap_64(event->auxtrace.reference); in perf_event__auxtrace_swap()
578 event->auxtrace.idx = bswap_32(event->auxtrace.idx); in perf_event__auxtrace_swap()
579 event->auxtrace.tid = bswap_32(event->auxtrace.tid); in perf_event__auxtrace_swap()
580 event->auxtrace.cpu = bswap_32(event->auxtrace.cpu); in perf_event__auxtrace_swap()
583 static void perf_event__auxtrace_error_swap(union perf_event *event, in perf_event__auxtrace_error_swap() argument
586 event->auxtrace_error.type = bswap_32(event->auxtrace_error.type); in perf_event__auxtrace_error_swap()
587 event->auxtrace_error.code = bswap_32(event->auxtrace_error.code); in perf_event__auxtrace_error_swap()
588 event->auxtrace_error.cpu = bswap_32(event->auxtrace_error.cpu); in perf_event__auxtrace_error_swap()
589 event->auxtrace_error.pid = bswap_32(event->auxtrace_error.pid); in perf_event__auxtrace_error_swap()
590 event->auxtrace_error.tid = bswap_32(event->auxtrace_error.tid); in perf_event__auxtrace_error_swap()
591 event->auxtrace_error.fmt = bswap_32(event->auxtrace_error.fmt); in perf_event__auxtrace_error_swap()
592 event->auxtrace_error.ip = bswap_64(event->auxtrace_error.ip); in perf_event__auxtrace_error_swap()
593 if (event->auxtrace_error.fmt) in perf_event__auxtrace_error_swap()
594 event->auxtrace_error.time = bswap_64(event->auxtrace_error.time); in perf_event__auxtrace_error_swap()
595 if (event->auxtrace_error.fmt >= 2) { in perf_event__auxtrace_error_swap()
596 event->auxtrace_error.machine_pid = bswap_32(event->auxtrace_error.machine_pid); in perf_event__auxtrace_error_swap()
597 event->auxtrace_error.vcpu = bswap_32(event->auxtrace_error.vcpu); in perf_event__auxtrace_error_swap()
601 static void perf_event__thread_map_swap(union perf_event *event, in perf_event__thread_map_swap() argument
606 event->thread_map.nr = bswap_64(event->thread_map.nr); in perf_event__thread_map_swap()
608 for (i = 0; i < event->thread_map.nr; i++) in perf_event__thread_map_swap()
609 event->thread_map.entries[i].pid = bswap_64(event->thread_map.entries[i].pid); in perf_event__thread_map_swap()
612 static void perf_event__cpu_map_swap(union perf_event *event, in perf_event__cpu_map_swap() argument
615 struct perf_record_cpu_map_data *data = &event->cpu_map.data; in perf_event__cpu_map_swap()
653 static void perf_event__stat_config_swap(union perf_event *event, in perf_event__stat_config_swap() argument
658 size = bswap_64(event->stat_config.nr) * sizeof(event->stat_config.data[0]); in perf_event__stat_config_swap()
660 mem_bswap_64(&event->stat_config.nr, size); in perf_event__stat_config_swap()
663 static void perf_event__stat_swap(union perf_event *event, in perf_event__stat_swap() argument
666 event->stat.id = bswap_64(event->stat.id); in perf_event__stat_swap()
667 event->stat.thread = bswap_32(event->stat.thread); in perf_event__stat_swap()
668 event->stat.cpu = bswap_32(event->stat.cpu); in perf_event__stat_swap()
669 event->stat.val = bswap_64(event->stat.val); in perf_event__stat_swap()
670 event->stat.ena = bswap_64(event->stat.ena); in perf_event__stat_swap()
671 event->stat.run = bswap_64(event->stat.run); in perf_event__stat_swap()
674 static void perf_event__stat_round_swap(union perf_event *event, in perf_event__stat_round_swap() argument
677 event->stat_round.type = bswap_64(event->stat_round.type); in perf_event__stat_round_swap()
678 event->stat_round.time = bswap_64(event->stat_round.time); in perf_event__stat_round_swap()
681 static void perf_event__time_conv_swap(union perf_event *event, in perf_event__time_conv_swap() argument
684 event->time_conv.time_shift = bswap_64(event->time_conv.time_shift); in perf_event__time_conv_swap()
685 event->time_conv.time_mult = bswap_64(event->time_conv.time_mult); in perf_event__time_conv_swap()
686 event->time_conv.time_zero = bswap_64(event->time_conv.time_zero); in perf_event__time_conv_swap()
688 if (event_contains(event->time_conv, time_cycles)) { in perf_event__time_conv_swap()
689 event->time_conv.time_cycles = bswap_64(event->time_conv.time_cycles); in perf_event__time_conv_swap()
690 event->time_conv.time_mask = bswap_64(event->time_conv.time_mask); in perf_event__time_conv_swap()
694 typedef void (*perf_event__swap_op)(union perf_event *event,
737 * event.
775 union perf_event *event __maybe_unused, in perf_event__process_finished_round()
783 int perf_session__queue_event(struct perf_session *s, union perf_event *event, in perf_session__queue_event() argument
786 return ordered_events__queue(&s->ordered_events, event, timestamp, file_offset, file_path); in perf_session__queue_event()
972 static void evlist__print_tstamp(struct evlist *evlist, union perf_event *event, struct perf_sample… in evlist__print_tstamp() argument
976 if (event->header.type != PERF_RECORD_SAMPLE && in evlist__print_tstamp()
1023 static void dump_event(struct evlist *evlist, union perf_event *event, in dump_event() argument
1030 printf("\n%#" PRIx64 "@%s [%#x]: event: %d\n", in dump_event()
1031 file_offset, file_path, event->header.size, event->header.type); in dump_event()
1033 trace_event(event); in dump_event()
1034 if (event->header.type == PERF_RECORD_SAMPLE && evlist->trace_event_sample_raw) in dump_event()
1035 evlist->trace_event_sample_raw(evlist, event, sample); in dump_event()
1038 evlist__print_tstamp(evlist, event, sample); in dump_event()
1041 event->header.size, perf_event__name(event->header.type)); in dump_event()
1052 static void dump_sample(struct evsel *evsel, union perf_event *event, in dump_sample() argument
1062 event->header.misc, sample->pid, sample->tid, sample->ip, in dump_sample()
1110 static void dump_read(struct evsel *evsel, union perf_event *event) in dump_read() argument
1112 struct perf_record_read *read_event = &event->read; in dump_read()
1118 printf(": %d %d %s %" PRI_lu64 "\n", event->read.pid, event->read.tid, in dump_read()
1119 evsel__name(evsel), event->read.value); in dump_read()
1140 union perf_event *event, in machines__find_for_cpumode() argument
1150 else if (event->header.type == PERF_RECORD_MMAP in machines__find_for_cpumode()
1151 || event->header.type == PERF_RECORD_MMAP2) in machines__find_for_cpumode()
1152 pid = event->mmap.pid; in machines__find_for_cpumode()
1171 union perf_event *event, in deliver_sample_value() argument
1198 return tool->sample(tool, event, sample, evsel, machine); in deliver_sample_value()
1203 union perf_event *event, in deliver_sample_group() argument
1212 return deliver_sample_value(evlist, tool, event, sample, v, machine); in deliver_sample_group()
1215 ret = deliver_sample_value(evlist, tool, event, sample, v, in deliver_sample_group()
1225 union perf_event *event, struct perf_sample *sample, in evlist__deliver_sample() argument
1234 return tool->sample(tool, event, sample, evsel, machine); in evlist__deliver_sample()
1238 return deliver_sample_group(evlist, tool, event, sample, in evlist__deliver_sample()
1241 return deliver_sample_value(evlist, tool, event, sample, in evlist__deliver_sample()
1247 union perf_event *event, in machines__deliver_event() argument
1255 dump_event(evlist, event, file_offset, sample, file_path); in machines__deliver_event()
1259 machine = machines__find_for_cpumode(machines, event, sample); in machines__deliver_event()
1261 switch (event->header.type) { in machines__deliver_event()
1269 dump_sample(evsel, event, sample, perf_env__arch(NULL)); in machines__deliver_event()
1272 dump_sample(evsel, event, sample, perf_env__arch(machine->env)); in machines__deliver_event()
1273 return evlist__deliver_sample(evlist, tool, event, sample, evsel, machine); in machines__deliver_event()
1275 return tool->mmap(tool, event, sample, machine); in machines__deliver_event()
1277 if (event->header.misc & PERF_RECORD_MISC_PROC_MAP_PARSE_TIMEOUT) in machines__deliver_event()
1279 return tool->mmap2(tool, event, sample, machine); in machines__deliver_event()
1281 return tool->comm(tool, event, sample, machine); in machines__deliver_event()
1283 return tool->namespaces(tool, event, sample, machine); in machines__deliver_event()
1285 return tool->cgroup(tool, event, sample, machine); in machines__deliver_event()
1287 return tool->fork(tool, event, sample, machine); in machines__deliver_event()
1289 return tool->exit(tool, event, sample, machine); in machines__deliver_event()
1292 evlist->stats.total_lost += event->lost.lost; in machines__deliver_event()
1293 return tool->lost(tool, event, sample, machine); in machines__deliver_event()
1295 if (event->header.misc & PERF_RECORD_MISC_LOST_SAMPLES_BPF) in machines__deliver_event()
1296 evlist->stats.total_dropped_samples += event->lost_samples.lost; in machines__deliver_event()
1298 evlist->stats.total_lost_samples += event->lost_samples.lost; in machines__deliver_event()
1299 return tool->lost_samples(tool, event, sample, machine); in machines__deliver_event()
1301 dump_read(evsel, event); in machines__deliver_event()
1302 return tool->read(tool, event, sample, evsel, machine); in machines__deliver_event()
1304 return tool->throttle(tool, event, sample, machine); in machines__deliver_event()
1306 return tool->unthrottle(tool, event, sample, machine); in machines__deliver_event()
1309 if (event->aux.flags & PERF_AUX_FLAG_TRUNCATED) in machines__deliver_event()
1311 if (event->aux.flags & PERF_AUX_FLAG_PARTIAL) in machines__deliver_event()
1313 if (event->aux.flags & PERF_AUX_FLAG_COLLISION) in machines__deliver_event()
1316 return tool->aux(tool, event, sample, machine); in machines__deliver_event()
1318 return tool->itrace_start(tool, event, sample, machine); in machines__deliver_event()
1321 return tool->context_switch(tool, event, sample, machine); in machines__deliver_event()
1323 return tool->ksymbol(tool, event, sample, machine); in machines__deliver_event()
1325 return tool->bpf(tool, event, sample, machine); in machines__deliver_event()
1327 return tool->text_poke(tool, event, sample, machine); in machines__deliver_event()
1329 return tool->aux_output_hw_id(tool, event, sample, machine); in machines__deliver_event()
1337 union perf_event *event, in perf_session__deliver_event() argument
1343 int ret = evlist__parse_sample(session->evlist, event, &sample); in perf_session__deliver_event()
1350 ret = auxtrace__process_event(session, event, &sample, tool); in perf_session__deliver_event()
1357 event, &sample, tool, file_offset, file_path); in perf_session__deliver_event()
1366 union perf_event *event, in perf_session__process_user_event() argument
1376 if (event->header.type != PERF_RECORD_COMPRESSED || perf_tool__compressed_is_stub(tool)) in perf_session__process_user_event()
1377 dump_event(session->evlist, event, file_offset, &sample, file_path); in perf_session__process_user_event()
1380 switch (event->header.type) { in perf_session__process_user_event()
1382 err = tool->attr(tool, event, &session->evlist); in perf_session__process_user_event()
1389 return tool->event_update(tool, event, &session->evlist); in perf_session__process_user_event()
1404 return tool->tracing_data(session, event); in perf_session__process_user_event()
1406 return tool->build_id(session, event); in perf_session__process_user_event()
1408 return tool->finished_round(tool, event, oe); in perf_session__process_user_event()
1410 return tool->id_index(session, event); in perf_session__process_user_event()
1412 return tool->auxtrace_info(session, event); in perf_session__process_user_event()
1420 lseek(fd, file_offset + event->header.size, SEEK_SET); in perf_session__process_user_event()
1421 return tool->auxtrace(session, event); in perf_session__process_user_event()
1423 perf_session__auxtrace_error_inc(session, event); in perf_session__process_user_event()
1424 return tool->auxtrace_error(session, event); in perf_session__process_user_event()
1426 return tool->thread_map(session, event); in perf_session__process_user_event()
1428 return tool->cpu_map(session, event); in perf_session__process_user_event()
1430 return tool->stat_config(session, event); in perf_session__process_user_event()
1432 return tool->stat(session, event); in perf_session__process_user_event()
1434 return tool->stat_round(session, event); in perf_session__process_user_event()
1436 session->time_conv = event->time_conv; in perf_session__process_user_event()
1437 return tool->time_conv(session, event); in perf_session__process_user_event()
1439 return tool->feature(session, event); in perf_session__process_user_event()
1441 err = tool->compressed(session, event, file_offset, file_path); in perf_session__process_user_event()
1443 dump_event(session->evlist, event, file_offset, &sample, file_path); in perf_session__process_user_event()
1446 return tool->finished_init(session, event); in perf_session__process_user_event()
1453 union perf_event *event, in perf_session__deliver_synth_event() argument
1459 events_stats__inc(&evlist->stats, event->header.type); in perf_session__deliver_synth_event()
1461 if (event->header.type >= PERF_RECORD_USER_TYPE_START) in perf_session__deliver_synth_event()
1462 return perf_session__process_user_event(session, event, 0, NULL); in perf_session__deliver_synth_event()
1464 return machines__deliver_event(&session->machines, evlist, event, sample, tool, 0, NULL); in perf_session__deliver_synth_event()
1491 static void event_swap(union perf_event *event, bool sample_id_all) in event_swap() argument
1495 swap = perf_event__swap_ops[event->header.type]; in event_swap()
1497 swap(event, sample_id_all); in event_swap()
1505 union perf_event *event; in perf_session__peek_event() local
1510 event = file_offset - session->one_mmap_offset + in perf_session__peek_event()
1528 event = (union perf_event *)buf; in perf_session__peek_event()
1531 perf_event_header__bswap(&event->header); in perf_session__peek_event()
1533 if (event->header.size < hdr_sz || event->header.size > buf_sz) in perf_session__peek_event()
1537 rest = event->header.size - hdr_sz; in perf_session__peek_event()
1543 event_swap(event, evlist__sample_id_all(session->evlist)); in perf_session__peek_event()
1547 if (sample && event->header.type < PERF_RECORD_USER_TYPE_START && in perf_session__peek_event()
1548 evlist__parse_sample(session->evlist, event, sample)) in perf_session__peek_event()
1551 *event_ptr = event; in perf_session__peek_event()
1561 union perf_event *event; in perf_session__peek_events() local
1566 PERF_SAMPLE_MAX_SIZE, &event, in perf_session__peek_events()
1571 err = cb(session, event, offset, data); in perf_session__peek_events()
1575 offset += event->header.size; in perf_session__peek_events()
1576 if (event->header.type == PERF_RECORD_AUXTRACE) in perf_session__peek_events()
1577 offset += event->auxtrace.size; in perf_session__peek_events()
1585 union perf_event *event, u64 file_offset, in perf_session__process_event() argument
1593 event_swap(event, evlist__sample_id_all(evlist)); in perf_session__process_event()
1595 if (event->header.type >= PERF_RECORD_HEADER_MAX) in perf_session__process_event()
1598 events_stats__inc(&evlist->stats, event->header.type); in perf_session__process_event()
1600 if (event->header.type >= PERF_RECORD_USER_TYPE_START) in perf_session__process_event()
1601 return perf_session__process_user_event(session, event, file_offset, file_path); in perf_session__process_event()
1606 ret = evlist__parse_sample_timestamp(evlist, event, &timestamp); in perf_session__process_event()
1610 ret = perf_session__queue_event(session, event, timestamp, file_offset, file_path); in perf_session__process_event()
1615 return perf_session__deliver_event(session, event, tool, file_offset, file_path); in perf_session__process_event()
1778 union perf_event *event; in __perf_session__process_pipe_events() local
1806 event = buf; in __perf_session__process_pipe_events()
1807 err = perf_data__read(session->data, event, in __perf_session__process_pipe_events()
1813 pr_err("failed to read event header\n"); in __perf_session__process_pipe_events()
1818 perf_event_header__bswap(&event->header); in __perf_session__process_pipe_events()
1820 size = event->header.size; in __perf_session__process_pipe_events()
1822 pr_err("bad event header size\n"); in __perf_session__process_pipe_events()
1829 pr_err("failed to allocate memory to read event\n"); in __perf_session__process_pipe_events()
1834 event = buf; in __perf_session__process_pipe_events()
1836 p = event; in __perf_session__process_pipe_events()
1844 pr_err("unexpected end of event stream\n"); in __perf_session__process_pipe_events()
1848 pr_err("failed to read event data\n"); in __perf_session__process_pipe_events()
1853 if ((skip = perf_session__process_event(session, event, head, "pipe")) < 0) { in __perf_session__process_pipe_events()
1855 head, event->header.size, event->header.type); in __perf_session__process_pipe_events()
1898 union perf_event *event; in prefetch_event() local
1903 * the size of the event in the headers. in prefetch_event()
1905 if (head + sizeof(event->header) > mmap_size) in prefetch_event()
1908 event = (union perf_event *)(buf + head); in prefetch_event()
1910 perf_event_header__bswap(&event->header); in prefetch_event()
1912 event_size = event->header.size; in prefetch_event()
1914 return event; in prefetch_event()
1916 /* We're not fetching the event so swap back again */ in prefetch_event()
1918 perf_event_header__bswap(&event->header); in prefetch_event()
1920 /* Check if the event fits into the next mmapped buf. */ in prefetch_event()
1926 /* Invalid input. Event size should never exceed mmap_size. */ in prefetch_event()
1927 pr_debug("%s: head=%#" PRIx64 " event->header.size=%#x, mmap_size=%#zx:" in prefetch_event()
1955 union perf_event *event = fetch_decomp_event(decomp->head, decomp->size, decomp->data, in __perf_session__process_decomp_events() local
1958 if (!event) in __perf_session__process_decomp_events()
1961 size = event->header.size; in __perf_session__process_decomp_events()
1964 (skip = perf_session__process_event(session, event, decomp->file_pos, in __perf_session__process_decomp_events()
1967 decomp->file_pos + decomp->head, event->header.size, event->header.type); in __perf_session__process_decomp_events()
1995 union perf_event *event,
2105 union perf_event *event; in reader__read_event() local
2108 event = fetch_mmaped_event(rd->head, rd->mmap_size, rd->mmap_cur, in reader__read_event()
2110 if (IS_ERR(event)) in reader__read_event()
2111 return PTR_ERR(event); in reader__read_event()
2113 if (!event) in reader__read_event()
2116 size = event->header.size; in reader__read_event()
2121 (skip = rd->process(session, event, rd->file_pos, rd->path)) < 0) { in reader__read_event()
2123 rd->file_offset + rd->head, event->header.size, in reader__read_event()
2124 event->header.type, strerror(-skip)); in reader__read_event()
2188 union perf_event *event, in process_simple() argument
2192 return perf_session__process_event(session, event, file_offset, file_path); in process_simple()
2572 union perf_event *event) in perf_event__process_id_index() argument
2575 struct perf_record_id_index *ie = &event->id_index; in perf_event__process_id_index()