Lines Matching refs:sample
954 struct perf_sample *sample, u64 type, in intel_pt_inject_event() argument
957 event->header.size = perf_event__sample_event_size(sample, type, 0); in intel_pt_inject_event()
958 return perf_event__synthesize_sample(event, type, 0, sample, swapped); in intel_pt_inject_event()
966 struct perf_sample sample = { .ip = 0, }; in intel_pt_synth_branch_sample() local
975 event->sample.header.type = PERF_RECORD_SAMPLE; in intel_pt_synth_branch_sample()
976 event->sample.header.misc = PERF_RECORD_MISC_USER; in intel_pt_synth_branch_sample()
977 event->sample.header.size = sizeof(struct perf_event_header); in intel_pt_synth_branch_sample()
980 sample.time = tsc_to_perf_time(ptq->timestamp, &pt->tc); in intel_pt_synth_branch_sample()
982 sample.ip = ptq->state->from_ip; in intel_pt_synth_branch_sample()
983 sample.pid = ptq->pid; in intel_pt_synth_branch_sample()
984 sample.tid = ptq->tid; in intel_pt_synth_branch_sample()
985 sample.addr = ptq->state->to_ip; in intel_pt_synth_branch_sample()
986 sample.id = ptq->pt->branches_id; in intel_pt_synth_branch_sample()
987 sample.stream_id = ptq->pt->branches_id; in intel_pt_synth_branch_sample()
988 sample.period = 1; in intel_pt_synth_branch_sample()
989 sample.cpu = ptq->cpu; in intel_pt_synth_branch_sample()
990 sample.flags = ptq->flags; in intel_pt_synth_branch_sample()
991 sample.insn_len = ptq->insn_len; in intel_pt_synth_branch_sample()
1001 .from = sample.ip, in intel_pt_synth_branch_sample()
1002 .to = sample.addr, in intel_pt_synth_branch_sample()
1005 sample.branch_stack = (struct branch_stack *)&dummy_bs; in intel_pt_synth_branch_sample()
1009 ret = intel_pt_inject_event(event, &sample, in intel_pt_synth_branch_sample()
1016 ret = perf_session__deliver_synth_event(pt->session, event, &sample); in intel_pt_synth_branch_sample()
1029 struct perf_sample sample = { .ip = 0, }; in intel_pt_synth_instruction_sample() local
1031 event->sample.header.type = PERF_RECORD_SAMPLE; in intel_pt_synth_instruction_sample()
1032 event->sample.header.misc = PERF_RECORD_MISC_USER; in intel_pt_synth_instruction_sample()
1033 event->sample.header.size = sizeof(struct perf_event_header); in intel_pt_synth_instruction_sample()
1036 sample.time = tsc_to_perf_time(ptq->timestamp, &pt->tc); in intel_pt_synth_instruction_sample()
1038 sample.ip = ptq->state->from_ip; in intel_pt_synth_instruction_sample()
1039 sample.pid = ptq->pid; in intel_pt_synth_instruction_sample()
1040 sample.tid = ptq->tid; in intel_pt_synth_instruction_sample()
1041 sample.addr = ptq->state->to_ip; in intel_pt_synth_instruction_sample()
1042 sample.id = ptq->pt->instructions_id; in intel_pt_synth_instruction_sample()
1043 sample.stream_id = ptq->pt->instructions_id; in intel_pt_synth_instruction_sample()
1044 sample.period = ptq->state->tot_insn_cnt - ptq->last_insn_cnt; in intel_pt_synth_instruction_sample()
1045 sample.cpu = ptq->cpu; in intel_pt_synth_instruction_sample()
1046 sample.flags = ptq->flags; in intel_pt_synth_instruction_sample()
1047 sample.insn_len = ptq->insn_len; in intel_pt_synth_instruction_sample()
1053 pt->synth_opts.callchain_sz, sample.ip); in intel_pt_synth_instruction_sample()
1054 sample.callchain = ptq->chain; in intel_pt_synth_instruction_sample()
1059 sample.branch_stack = ptq->last_branch; in intel_pt_synth_instruction_sample()
1063 ret = intel_pt_inject_event(event, &sample, in intel_pt_synth_instruction_sample()
1070 ret = perf_session__deliver_synth_event(pt->session, event, &sample); in intel_pt_synth_instruction_sample()
1086 struct perf_sample sample = { .ip = 0, }; in intel_pt_synth_transaction_sample() local
1088 event->sample.header.type = PERF_RECORD_SAMPLE; in intel_pt_synth_transaction_sample()
1089 event->sample.header.misc = PERF_RECORD_MISC_USER; in intel_pt_synth_transaction_sample()
1090 event->sample.header.size = sizeof(struct perf_event_header); in intel_pt_synth_transaction_sample()
1093 sample.time = tsc_to_perf_time(ptq->timestamp, &pt->tc); in intel_pt_synth_transaction_sample()
1095 sample.ip = ptq->state->from_ip; in intel_pt_synth_transaction_sample()
1096 sample.pid = ptq->pid; in intel_pt_synth_transaction_sample()
1097 sample.tid = ptq->tid; in intel_pt_synth_transaction_sample()
1098 sample.addr = ptq->state->to_ip; in intel_pt_synth_transaction_sample()
1099 sample.id = ptq->pt->transactions_id; in intel_pt_synth_transaction_sample()
1100 sample.stream_id = ptq->pt->transactions_id; in intel_pt_synth_transaction_sample()
1101 sample.period = 1; in intel_pt_synth_transaction_sample()
1102 sample.cpu = ptq->cpu; in intel_pt_synth_transaction_sample()
1103 sample.flags = ptq->flags; in intel_pt_synth_transaction_sample()
1104 sample.insn_len = ptq->insn_len; in intel_pt_synth_transaction_sample()
1108 pt->synth_opts.callchain_sz, sample.ip); in intel_pt_synth_transaction_sample()
1109 sample.callchain = ptq->chain; in intel_pt_synth_transaction_sample()
1114 sample.branch_stack = ptq->last_branch; in intel_pt_synth_transaction_sample()
1118 ret = intel_pt_inject_event(event, &sample, in intel_pt_synth_transaction_sample()
1125 ret = perf_session__deliver_synth_event(pt->session, event, &sample); in intel_pt_synth_transaction_sample()
1475 static int intel_pt_lost(struct intel_pt *pt, struct perf_sample *sample) in intel_pt_lost() argument
1477 return intel_pt_synth_error(pt, INTEL_PT_ERR_LOST, sample->cpu, in intel_pt_lost()
1478 sample->pid, sample->tid, 0); in intel_pt_lost()
1555 struct perf_sample *sample) in intel_pt_process_switch() argument
1561 evsel = perf_evlist__id2evsel(pt->session->evlist, sample->id); in intel_pt_process_switch()
1565 tid = perf_evsel__intval(evsel, sample, "next_pid"); in intel_pt_process_switch()
1566 cpu = sample->cpu; in intel_pt_process_switch()
1569 cpu, tid, sample->time, perf_time_to_tsc(sample->time, in intel_pt_process_switch()
1572 ret = intel_pt_sync_switch(pt, cpu, tid, sample->time); in intel_pt_process_switch()
1580 struct perf_sample *sample) in intel_pt_context_switch() argument
1586 cpu = sample->cpu; in intel_pt_context_switch()
1600 pid = sample->pid; in intel_pt_context_switch()
1601 tid = sample->tid; in intel_pt_context_switch()
1610 cpu, pid, tid, sample->time, perf_time_to_tsc(sample->time, in intel_pt_context_switch()
1613 ret = intel_pt_sync_switch(pt, cpu, tid, sample->time); in intel_pt_context_switch()
1622 struct perf_sample *sample) in intel_pt_process_itrace_start() argument
1628 sample->cpu, event->itrace_start.pid, in intel_pt_process_itrace_start()
1629 event->itrace_start.tid, sample->time, in intel_pt_process_itrace_start()
1630 perf_time_to_tsc(sample->time, &pt->tc)); in intel_pt_process_itrace_start()
1632 return machine__set_current_tid(pt->machine, sample->cpu, in intel_pt_process_itrace_start()
1639 struct perf_sample *sample, in intel_pt_process_event() argument
1655 if (sample->time && sample->time != (u64)-1) in intel_pt_process_event()
1656 timestamp = perf_time_to_tsc(sample->time, &pt->tc); in intel_pt_process_event()
1670 sample->time); in intel_pt_process_event()
1681 err = intel_pt_lost(pt, sample); in intel_pt_process_event()
1687 err = intel_pt_process_switch(pt, sample); in intel_pt_process_event()
1689 err = intel_pt_process_itrace_start(pt, event, sample); in intel_pt_process_event()
1692 err = intel_pt_context_switch(pt, event, sample); in intel_pt_process_event()
1696 sample->cpu, sample->time, timestamp); in intel_pt_process_event()
1800 struct perf_sample *sample __maybe_unused, in intel_pt_event_synth()