Lines Matching refs:sample
59 ExecutionMode PerfExecMode(const PerfDataHandler::SampleContext& sample) { in PerfExecMode() argument
60 if (sample.header.has_misc()) { in PerfExecMode()
61 switch (sample.header.misc() & PERF_RECORD_MISC_CPUMODE_MASK) { in PerfExecMode()
210 void Sample(const PerfDataHandler::SampleContext& sample) override;
255 SampleKey MakeSampleKey(const PerfDataHandler::SampleContext& sample,
259 const PerfDataHandler::SampleContext& sample);
289 const PerfDataHandler::SampleContext& sample, ProfileBuilder* builder) { in MakeSampleKey() argument
291 sample_key.pid = sample.sample.has_pid() ? sample.sample.pid() : 0; in MakeSampleKey()
293 (IncludeTidLabels() && sample.sample.has_tid()) ? sample.sample.tid() : 0; in MakeSampleKey()
295 (IncludeTimestampNsLabels() && sample.sample.has_sample_time_ns()) in MakeSampleKey()
296 ? sample.sample.sample_time_ns() in MakeSampleKey()
299 sample_key.exec_mode = PerfExecMode(sample); in MakeSampleKey()
301 if (IncludeCommLabels() && sample.sample.has_pid() && in MakeSampleKey()
302 sample.sample.has_tid()) { in MakeSampleKey()
303 Pid pid = sample.sample.pid(); in MakeSampleKey()
304 Pid tid = sample.sample.tid(); in MakeSampleKey()
314 const PerfDataHandler::SampleContext& sample) { in GetOrCreateBuilder() argument
315 Pid builder_pid = (options_ & kGroupByPids) ? sample.sample.pid() : 0; in GetOrCreateBuilder()
349 if (sample.main_mapping == nullptr) { in GetOrCreateBuilder()
355 AddOrGetMapping(sample.sample.pid(), sample.main_mapping, builder); in GetOrCreateBuilder()
370 if ((options_ & kGroupByPids) && sample.main_mapping != nullptr && in GetOrCreateBuilder()
371 sample.main_mapping->filename != nullptr) { in GetOrCreateBuilder()
374 const string& sample_filename = MappingFilename(sample.main_mapping); in GetOrCreateBuilder()
378 LOG(FATAL) << "main mapping mismatch: " << sample.sample.pid() << " " in GetOrCreateBuilder()
381 LOG(WARNING) << "main mapping mismatch: " << sample.sample.pid() in GetOrCreateBuilder()
387 if (sample.sample.sample_time_ns()) { in GetOrCreateBuilder()
388 per_pid.process_meta->UpdateTimestamps(sample.sample.sample_time_ns()); in GetOrCreateBuilder()
438 perftools::profiles::Sample* sample = per_pid_[pid].sample_map[sample_key]; in AddOrUpdateSample() local
440 if (sample == nullptr) { in AddOrUpdateSample()
442 sample = profile->add_sample(); in AddOrUpdateSample()
443 per_pid_[pid].sample_map[sample_key] = sample; in AddOrUpdateSample()
445 sample->add_location_id(location_id); in AddOrUpdateSample()
448 if (IncludePidLabels() && context.sample.has_pid()) { in AddOrUpdateSample()
449 auto* label = sample->add_label(); in AddOrUpdateSample()
451 label->set_num(static_cast<int64>(context.sample.pid())); in AddOrUpdateSample()
453 if (IncludeTidLabels() && context.sample.has_tid()) { in AddOrUpdateSample()
454 auto* label = sample->add_label(); in AddOrUpdateSample()
456 label->set_num(static_cast<int64>(context.sample.tid())); in AddOrUpdateSample()
459 auto* label = sample->add_label(); in AddOrUpdateSample()
463 if (IncludeTimestampNsLabels() && context.sample.has_sample_time_ns()) { in AddOrUpdateSample()
464 auto* label = sample->add_label(); in AddOrUpdateSample()
467 static_cast<int64>(context.sample.sample_time_ns()); in AddOrUpdateSample()
471 auto* label = sample->add_label(); in AddOrUpdateSample()
479 sample->add_value(0); in AddOrUpdateSample()
480 sample->add_value(0); in AddOrUpdateSample()
486 if (context.sample.period() > 0) { in AddOrUpdateSample()
487 weight = context.sample.period(); in AddOrUpdateSample()
497 sample->set_value(2 * event_index, sample->value(2 * event_index) + 1); in AddOrUpdateSample()
498 sample->set_value(2 * event_index + 1, in AddOrUpdateSample()
499 sample->value(2 * event_index + 1) + weight); in AddOrUpdateSample()
549 void PerfDataConverter::Sample(const PerfDataHandler::SampleContext& sample) { in Sample() argument
550 if (sample.file_attrs_index < 0 || in Sample()
551 sample.file_attrs_index >= perf_data_.file_attrs_size()) { in Sample()
553 << sample.file_attrs_index; in Sample()
557 Pid event_pid = sample.sample.pid(); in Sample()
558 ProfileBuilder *builder = GetOrCreateBuilder(sample); in Sample()
559 SampleKey sample_key = MakeSampleKey(sample, builder); in Sample()
561 uint64 ip = sample.sample_mapping != nullptr ? sample.sample.ip() : 0; in Sample()
563 const auto start = sample.sample_mapping->start; in Sample()
564 const auto limit = sample.sample_mapping->limit; in Sample()
575 AddOrGetLocation(event_pid, ip, sample.sample_mapping, builder)); in Sample()
580 const bool lbr_sample = !sample.branch_stack.empty(); in Sample()
582 for (const auto& frame : sample.callchain) { in Sample()
613 for (const auto& frame : sample.branch_stack) { in Sample()
629 AddOrUpdateSample(sample, event_pid, sample_key, builder); in Sample()