trace_processor: add idle slices to the sched table
This makes reasoning about logic in SPAN JOIN a lot simpler and also
allows for analysis about CPU states during idle scheduling.
Change-Id: I3f8e994ad2a06206bda4ccbefd2c9b7cbf8b9371
diff --git a/src/trace_processor/trace_storage.h b/src/trace_processor/trace_storage.h
index 3515f76..f267f65 100644
--- a/src/trace_processor/trace_storage.h
+++ b/src/trace_processor/trace_storage.h
@@ -189,7 +189,7 @@
}
Thread* GetMutableThread(UniqueTid utid) {
- PERFETTO_DCHECK(utid > 0 && utid < unique_threads_.size());
+ PERFETTO_DCHECK(utid >= 0 && utid < unique_threads_.size());
return &unique_threads_[utid];
}
@@ -205,7 +205,8 @@
}
const Thread& GetThread(UniqueTid utid) const {
- PERFETTO_DCHECK(utid > 0 && utid < unique_threads_.size());
+ // Allow utid == 0 for idle thread retrieval.
+ PERFETTO_DCHECK(utid >= 0 && utid < unique_threads_.size());
return unique_threads_[utid];
}