diff --git a/src/trace_processor/importers/perf/record_parser.cc b/src/trace_processor/importers/perf/record_parser.cc index 3d3bdcd879..a63a5bd110 100644 --- a/src/trace_processor/importers/perf/record_parser.cc +++ b/src/trace_processor/importers/perf/record_parser.cc @@ -73,14 +73,13 @@ CreateMappingParams BuildCreateMappingParams( bool IsInKernel(protos::pbzero::Profiling::CpuMode cpu_mode) { switch (cpu_mode) { - case protos::pbzero::Profiling::MODE_UNKNOWN: - PERFETTO_FATAL("Unknown CPU mode"); case protos::pbzero::Profiling::MODE_GUEST_KERNEL: case protos::pbzero::Profiling::MODE_KERNEL: return true; case protos::pbzero::Profiling::MODE_USER: case protos::pbzero::Profiling::MODE_HYPERVISOR: case protos::pbzero::Profiling::MODE_GUEST_USER: + case protos::pbzero::Profiling::MODE_UNKNOWN: return false; } PERFETTO_FATAL("For GCC."); @@ -161,6 +160,11 @@ base::Status RecordParser::InternSample(Sample sample) { "Can not parse samples with no PERF_SAMPLE_TID field"); } + if (sample.cpu_mode == + protos::pbzero::perfetto_pbzero_enum_Profiling::MODE_UNKNOWN) { + context_->storage->IncrementStats(stats::perf_samples_cpu_mode_unknown); + } + UniqueTid utid = context_->process_tracker->UpdateThread(sample.pid_tid->tid, sample.pid_tid->pid); const auto upid = *context_->storage->thread_table() diff --git a/src/trace_processor/storage/stats.h b/src/trace_processor/storage/stats.h index e4b06c81d3..a19e5be2d7 100644 --- a/src/trace_processor/storage/stats.h +++ b/src/trace_processor/storage/stats.h @@ -273,6 +273,7 @@ namespace stats { F(perf_samples_skipped, kSingle, kError, kAnalysis, ""), \ F(perf_counter_skipped_because_no_cpu, kSingle, kError, kAnalysis, ""), \ F(perf_features_skipped, kIndexed, kInfo, kAnalysis, ""), \ + F(perf_samples_cpu_mode_unknown, kSingle, kError, kAnalysis, ""), \ F(perf_samples_skipped_dataloss, kSingle, kDataLoss, kTrace, ""), \ F(perf_dummy_mapping_used, kSingle, kInfo, kAnalysis, ""), \ F(perf_invalid_event_id, kSingle, kError, kTrace, ""), \