Lines Matching refs:sample
253 struct perf_sample* sample) { in ReadReadInfo() argument
255 sample->read.time_enabled = *array++; in ReadReadInfo()
257 sample->read.time_running = *array++; in ReadReadInfo()
259 sample->read.one.id = *array++; in ReadReadInfo()
262 ByteSwap(&sample->read.time_enabled); in ReadReadInfo()
263 ByteSwap(&sample->read.time_running); in ReadReadInfo()
264 ByteSwap(&sample->read.one.id); in ReadReadInfo()
274 struct perf_sample* sample) { in ReadCallchain() argument
276 CHECK_EQ(static_cast<void*>(NULL), sample->callchain); in ReadCallchain()
291 sample->callchain = callchain; in ReadCallchain()
300 struct perf_sample* sample) { in ReadRawData() argument
303 sample->raw_size = *ptr++; in ReadRawData()
305 ByteSwap(&sample->raw_size); in ReadRawData()
308 sample->raw_data = new uint8_t[sample->raw_size]; in ReadRawData()
309 memcpy(sample->raw_data, ptr, sample->raw_size); in ReadRawData()
312 int bytes_read = AlignSize(sizeof(sample->raw_size) + sample->raw_size, in ReadRawData()
323 struct perf_sample* sample) { in ReadBranchStack() argument
326 CHECK_EQ(static_cast<void*>(NULL), sample->branch_stack); in ReadBranchStack()
346 sample->branch_stack = branch_stack; in ReadBranchStack()
356 struct perf_sample* sample) { in ReadPerfSampleFromData() argument
377 sample->id = MaybeSwap(*array++, swap_bytes); in ReadPerfSampleFromData()
383 sample->ip = MaybeSwap(*array++, swap_bytes); in ReadPerfSampleFromData()
389 sample->pid = MaybeSwap(val32[0], swap_bytes); in ReadPerfSampleFromData()
390 sample->tid = MaybeSwap(val32[1], swap_bytes); in ReadPerfSampleFromData()
395 sample->time = MaybeSwap(*array++, swap_bytes); in ReadPerfSampleFromData()
400 sample->addr = MaybeSwap(*array++, swap_bytes); in ReadPerfSampleFromData()
405 sample->id = MaybeSwap(*array++, swap_bytes); in ReadPerfSampleFromData()
410 sample->stream_id = MaybeSwap(*array++, swap_bytes); in ReadPerfSampleFromData()
416 sample->cpu = MaybeSwap(val32[0], swap_bytes); in ReadPerfSampleFromData()
424 sample->id = MaybeSwap(*array++, swap_bytes); in ReadPerfSampleFromData()
434 sample->period = MaybeSwap(*array++, swap_bytes); in ReadPerfSampleFromData()
442 array = ReadReadInfo(array, swap_bytes, read_format, sample); in ReadPerfSampleFromData()
448 array = ReadCallchain(array, swap_bytes, sample); in ReadPerfSampleFromData()
454 array = ReadRawData(array, swap_bytes, sample); in ReadPerfSampleFromData()
460 array = ReadBranchStack(array, swap_bytes, sample); in ReadPerfSampleFromData()
484 const struct perf_sample& sample, in WritePerfSampleToData() argument
504 *array++ = sample.id; in WritePerfSampleToData()
510 *array++ = sample.ip; in WritePerfSampleToData()
515 val32[0] = sample.pid; in WritePerfSampleToData()
516 val32[1] = sample.tid; in WritePerfSampleToData()
522 *array++ = sample.time; in WritePerfSampleToData()
527 *array++ = sample.addr; in WritePerfSampleToData()
532 *array++ = sample.id; in WritePerfSampleToData()
537 *array++ = sample.stream_id; in WritePerfSampleToData()
542 val32[0] = sample.cpu; in WritePerfSampleToData()
552 *array++ = sample.id; in WritePerfSampleToData()
562 *array++ = sample.period; in WritePerfSampleToData()
571 *array++ = sample.read.time_enabled; in WritePerfSampleToData()
573 *array++ = sample.read.time_running; in WritePerfSampleToData()
575 *array++ = sample.read.one.id; in WritePerfSampleToData()
581 if (!sample.callchain) { in WritePerfSampleToData()
584 *array++ = sample.callchain->nr; in WritePerfSampleToData()
585 for (size_t i = 0; i < sample.callchain->nr; ++i) in WritePerfSampleToData()
586 *array++ = sample.callchain->ips[i]; in WritePerfSampleToData()
594 *ptr++ = sample.raw_size; in WritePerfSampleToData()
595 memcpy(ptr, sample.raw_data, sample.raw_size); in WritePerfSampleToData()
598 int num_bytes = AlignSize(sizeof(sample.raw_size) + sample.raw_size, in WritePerfSampleToData()
606 if (!sample.branch_stack) { in WritePerfSampleToData()
609 *array++ = sample.branch_stack->nr; in WritePerfSampleToData()
610 for (size_t i = 0; i < sample.branch_stack->nr; ++i) { in WritePerfSampleToData()
611 *array++ = sample.branch_stack->entries[i].from; in WritePerfSampleToData()
612 *array++ = sample.branch_stack->entries[i].to; in WritePerfSampleToData()
613 memcpy(array++, &sample.branch_stack->entries[i].flags, in WritePerfSampleToData()
783 struct perf_sample* sample) const { in ReadPerfSampleInfo()
784 CHECK(sample); in ReadPerfSampleInfo()
800 sample); in ReadPerfSampleInfo()
811 bool PerfReader::WritePerfSampleInfo(const perf_sample& sample, in WritePerfSampleInfo() argument
828 sample, in WritePerfSampleInfo()