trace_processor: refactor tracks to reflect final design
This CL changes all the track tables and track tracker to reflect the
final agreed shape of these tables.
The main change carried out here is to decouple the idea of the source
of a track from the table it ends up in. Instead, we simply store the
source and the id of the source in the args table - this is useful for
debugging.
Now, all tracks are grouped into track types based not on source but on
what the context of a track is (i.e. thread, process, cpu etc).
However, if a consumer needs to filter tracks based on source, they
should still add a new table and place all their tracks (plus the source)
inside the new subclass - this is done for GPU events.
Context: go/perfetto-tp-refactor
Bug: 135177627
Change-Id: Ie8aa86d84fe9c7266433766d23e8fa247b0966be
diff --git a/src/trace_processor/trace_storage.h b/src/trace_processor/trace_storage.h
index e357180..df9092b 100644
--- a/src/trace_processor/trace_storage.h
+++ b/src/trace_processor/trace_storage.h
@@ -66,6 +66,7 @@
kSched = 4,
kNestableSlices = 5,
kMetadataTable = 6,
+ kTrack = 7,
};
// The top 8 bits are set to the TableId and the bottom 32 to the row of the
@@ -1166,18 +1167,11 @@
const tables::TrackTable& track_table() const { return track_table_; }
tables::TrackTable* mutable_track_table() { return &track_table_; }
- const tables::ChromeAsyncTrackTable& chrome_async_track_table() const {
- return chrome_async_track_table_;
+ const tables::ProcessTrackTable& process_track_table() const {
+ return process_track_table_;
}
- tables::ChromeAsyncTrackTable* mutable_chrome_async_track_table() {
- return &chrome_async_track_table_;
- }
-
- const tables::FuchsiaAsyncTrackTable& fuchsia_async_track_table() const {
- return fuchsia_async_track_table_;
- }
- tables::FuchsiaAsyncTrackTable* mutable_fuchsia_async_track_table() {
- return &fuchsia_async_track_table_;
+ tables::ProcessTrackTable* mutable_process_track_table() {
+ return &process_track_table_;
}
const Slices& slices() const { return slices_; }
@@ -1316,12 +1310,7 @@
// Metadata for tracks.
tables::TrackTable track_table_{&string_pool_, nullptr};
tables::GpuTrackTable gpu_track_table_{&string_pool_, &track_table_};
- tables::FuchsiaAsyncTrackTable fuchsia_async_track_table_{&string_pool_,
- &track_table_};
- tables::ChromeScopedTrackTable chrome_scoped_track_table_{&string_pool_,
- &track_table_};
- tables::ChromeAsyncTrackTable chrome_async_track_table_{
- &string_pool_, &chrome_scoped_track_table_};
+ tables::ProcessTrackTable process_track_table_{&string_pool_, &track_table_};
// Metadata for gpu tracks.
GpuContexts gpu_contexts_;