Lines Matching defs:sample
315 struct perf_sample sample;
337 /* parse the sample to get the CPU */
341 err = evsel__parse_sample(evsel, event, &sample);
344 cpu = sample.cpu;
346 /* no CPU in the sample - possibly recorded with an old version of perf */
347 pr_err("CS_ETM: no CPU AUX_OUTPUT_HW_ID sample. Use compatible perf to record.");
616 * thread at that time must also be assigned to that sample.
618 * tracking the thread for the previous packet the branch sample
1313 struct perf_sample *sample, u64 type)
1315 event->header.size = perf_event__sample_event_size(sample, type, 0);
1316 return perf_event__synthesize_sample(event, type, 0, sample);
1401 struct perf_sample *sample)
1408 sample->insn_len = 0;
1417 sample->insn_len = cs_etm__t32_instr_size(etmq, trace_chan_id,
1418 sample->ip);
1421 sample->insn_len = 4;
1423 cs_etm__mem_access(etmq, trace_chan_id, sample->ip, sample->insn_len,
1424 (void *)sample->insn, 0);
1456 struct perf_sample sample = {.ip = 0,};
1458 event->sample.header.type = PERF_RECORD_SAMPLE;
1459 event->sample.header.misc = cs_etm__cpu_mode(etmq, addr, tidq->el);
1460 event->sample.header.size = sizeof(struct perf_event_header);
1463 sample.time = cs_etm__resolve_sample_time(etmq, tidq);
1465 sample.ip = addr;
1466 sample.pid = thread__pid(tidq->thread);
1467 sample.tid = thread__tid(tidq->thread);
1468 sample.id = etmq->etm->instructions_id;
1469 sample.stream_id = etmq->etm->instructions_id;
1470 sample.period = period;
1471 sample.cpu = tidq->packet->cpu;
1472 sample.flags = tidq->prev_packet->flags;
1473 sample.cpumode = event->sample.header.misc;
1475 cs_etm__copy_insn(etmq, tidq->trace_chan_id, tidq->packet, &sample);
1478 sample.branch_stack = tidq->last_branch;
1481 ret = cs_etm__inject_event(event, &sample,
1487 ret = perf_session__deliver_synth_event(etm->session, event, &sample);
1499 * and the next taken branch. Generate sample accordingly.
1506 struct perf_sample sample = {.ip = 0,};
1517 event->sample.header.type = PERF_RECORD_SAMPLE;
1518 event->sample.header.misc = cs_etm__cpu_mode(etmq, ip,
1520 event->sample.header.size = sizeof(struct perf_event_header);
1523 sample.time = cs_etm__resolve_sample_time(etmq, tidq);
1525 sample.ip = ip;
1526 sample.pid = thread__pid(tidq->prev_packet_thread);
1527 sample.tid = thread__tid(tidq->prev_packet_thread);
1528 sample.addr = cs_etm__first_executed_instr(tidq->packet);
1529 sample.id = etmq->etm->branches_id;
1530 sample.stream_id = etmq->etm->branches_id;
1531 sample.period = 1;
1532 sample.cpu = tidq->packet->cpu;
1533 sample.flags = tidq->prev_packet->flags;
1534 sample.cpumode = event->sample.header.misc;
1537 &sample);
1547 .from = sample.ip,
1548 .to = sample.addr,
1551 sample.branch_stack = (struct branch_stack *)&dummy_bs;
1555 ret = cs_etm__inject_event(event, &sample,
1561 ret = perf_session__deliver_synth_event(etm->session, event, &sample);
1578 struct perf_sample *sample __maybe_unused,
1663 * We don't use the hardware index, but the sample generation
1710 * Emit instruction sample periodically
1736 * last sample before the current etm packet, n+1 to n+3
1743 * instructions executed after the sample point(n) from the
1750 * sample(n+1); sample(n+2) and sample(n+3) consume the
1751 * instructions with sample period. After sample(n+3), the rest
1764 /* Prepare last branches for instruction sample */
1772 * as sample is reported as though instruction has just
1793 /* Generate sample for tracing on packet */
1797 /* Generate sample for branch taken packet */
1820 * to generate branch sample for the instruction range before the
1848 /* Prepare last branches for instruction sample */
1895 * so skip to generate branch sample to avoid stale packet.
1906 /* Prepare last branches for instruction sample */
2205 * it needs to calibrate the previous packet sample flags
2288 * system call instruction and then calibrate the sample flag
2354 * thus setting sample flags must be called
2417 * Generate an instruction sample with the remaining
2715 struct perf_sample *sample,
2757 if (sample->time && (sample->time != (u64)-1))
2758 etm->latest_kernel_timestamp = sample->time;
2931 struct perf_record_aux *aux_event, struct perf_sample *sample)
2965 * auxtrace_mmap_params__set_idx(). However, the sample AUX event will contain a
2972 if (auxtrace_event->tid != sample->tid)
2974 } else if (auxtrace_event->cpu != sample->cpu) {
3016 " tid: %d cpu: %d\n", aux_size, aux_offset, sample->tid, sample->cpu);
3046 struct perf_sample sample;
3065 * Parse the sample, we need the sample_id_all data that comes after the event so that the
3071 ret = evsel__parse_sample(evsel, event, &sample);
3082 ent->sz, &event->aux, &sample);
3097 " tid: %d cpu: %d\n", event->aux.aux_offset, sample.tid, sample.cpu);