commit | acda68b0292e8c8283b45f999eb8e7d95281cac5 | [log] [tgz] |
---|---|---|
author | Lalit Maganti <lalitm@google.com> | Mon Oct 29 15:23:25 2018 +0000 |
committer | Lalit Maganti <lalitm@google.com> | Mon Oct 29 15:23:25 2018 +0000 |
tree | 63a4f98ab166324481b50897d29ba872499ceab0 | |
parent | 747e3a042554dd0f79b4b169fdb962adf6d0c73c [diff] |
trace_processor: overhaul filter and sort system for storage backed tables This CL introduces a flexible system for filtering and sorting for any table backed by TraceStorage. This allows for Table sub-classes to be written with as little as ~80 lines of code. This works through a healthy sprinkling of abstractions and template magic while hopefully remaining readable. Several new classes/files are introduced: * StorageCursor: a class which takes a row iteration strategy (StorageCursor::RowIterator) (an object which tells it which row index to return next) and a column reporter (StorageCursor::ColumnReporter) (one for each column in the table which can inform sqlite through sqlite3_result_* functions what the data at a row is). * RangeRowIterator and VectorRowIterator: implement the row iteration strategies given by iterating through a range of indices (possibly filtering rows based on a bitvector) and given by returning indices directly from a vector. * StorageSchema: a class which defines the schema of a storage backed table but also how data can be sorted/filtered/reported to SQLite (StorageSchema::Column). * StorageSchema::NumericColumn and StorageSchema::StringColumn: These are implementations of StorageSchema::Column for all numeric data types and string types. Note that string columns add a layer of indirection which allows string ids to be passed with a seperate deque defining how this id should be converted to a string. * table_utils: extracts the logic in SchedSliceTable about how to choose a row iteration strategy for a given schema given a set of query constraints. Overall this allows massive consolidation of code across Sched and Counters tables and will allow for Slice, thread, process and all future tables to have efficient filter support without needing to add hundreds of lines of code. Moreover, performance improvements can now be shared among all the tables. Change-Id: Ifeac418d7446daaffeb3c3ce0676c15cb030151c
Perfetto is an open-source project for performance instrumentation and tracing of Linux/Android/Chrome platforms and user-space apps.
See www.perfetto.dev for docs.