Reapply "Add trace_file metadata table"
This reverts commit 2961ee996e95d62f7af72ab17a62e52c75cf1419.
In addition it fixes the issue that triggered the revert.
The problem was that for some error flows the TraceFileTracker was
destroyed while there were ScopedActiveTraceFile instances alive. In
error cases `TraceProcessorStorageImpl::NotifyEndOfFile` becomes a
noop and thus the `active_file_` was not being cleared.
The new `TraceProcessorIntegrationTest::InvalidTrace` integration test
reproduced the issue that caused the revert.
Patchset 1: Pure reapply
Patchest 2: Adds integration test to show the issue
Patchset 3: Fix
Patchset 4: Rebase
You can check https://ci.perfetto.dev/ to see how patchset 2 crashes and patchset 3 fixed the issue.
Change-Id: Ic1e165c0214fa281222e34f6778232de56a435b3
diff --git a/Android.bp b/Android.bp
index 4cc0adf..85393fb 100644
--- a/Android.bp
+++ b/Android.bp
@@ -12246,11 +12246,13 @@
"src/trace_processor/importers/common/process_track_translation_table.cc",
"src/trace_processor/importers/common/process_tracker.cc",
"src/trace_processor/importers/common/sched_event_tracker.cc",
+ "src/trace_processor/importers/common/scoped_active_trace_file.cc",
"src/trace_processor/importers/common/slice_tracker.cc",
"src/trace_processor/importers/common/slice_translation_table.cc",
"src/trace_processor/importers/common/stack_profile_tracker.cc",
"src/trace_processor/importers/common/system_info_tracker.cc",
"src/trace_processor/importers/common/thread_state_tracker.cc",
+ "src/trace_processor/importers/common/trace_file_tracker.cc",
"src/trace_processor/importers/common/trace_parser.cc",
"src/trace_processor/importers/common/track_tracker.cc",
"src/trace_processor/importers/common/virtual_memory_mapping.cc",