tp: make dynamic tables their own standalone target

This CL decouples dynamic tables from the top level storage_minimal
and storage_full targets to make it easier to reason about what they
depend on. This has cascading effects which mean some classes have to
be moved around.

This is a purely mechanical refactoring with no functional change.

Bug: 220373202
Change-Id: Ia574b6a27303dff77c46eddd7f415700a9e6ff73
diff --git a/Android.bp b/Android.bp
index 3e771c0..a273366 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1786,14 +1786,18 @@
         ":perfetto_src_trace_processor_analysis_analysis",
         ":perfetto_src_trace_processor_containers_containers",
         ":perfetto_src_trace_processor_db_db",
+        ":perfetto_src_trace_processor_dynamic_dynamic",
         ":perfetto_src_trace_processor_export_json",
         ":perfetto_src_trace_processor_ftrace_descriptors",
         ":perfetto_src_trace_processor_importers_common_common",
         ":perfetto_src_trace_processor_importers_memory_tracker_graph_processor",
+        ":perfetto_src_trace_processor_importers_proto_storage_full",
+        ":perfetto_src_trace_processor_importers_proto_storage_minimal",
         ":perfetto_src_trace_processor_lib",
         ":perfetto_src_trace_processor_metatrace",
         ":perfetto_src_trace_processor_metrics_metrics",
         ":perfetto_src_trace_processor_sqlite_sqlite",
+        ":perfetto_src_trace_processor_sqlite_sqlite_minimal",
         ":perfetto_src_trace_processor_storage_full",
         ":perfetto_src_trace_processor_storage_minimal",
         ":perfetto_src_trace_processor_storage_storage",
@@ -8195,6 +8199,37 @@
     ],
 }
 
+// GN: //src/trace_processor/dynamic:dynamic
+filegroup {
+    name: "perfetto_src_trace_processor_dynamic_dynamic",
+    srcs: [
+        "src/trace_processor/dynamic/ancestor_generator.cc",
+        "src/trace_processor/dynamic/connected_flow_generator.cc",
+        "src/trace_processor/dynamic/descendant_generator.cc",
+        "src/trace_processor/dynamic/describe_slice_generator.cc",
+        "src/trace_processor/dynamic/dynamic_table_generator.cc",
+        "src/trace_processor/dynamic/experimental_annotated_stack_generator.cc",
+        "src/trace_processor/dynamic/experimental_counter_dur_generator.cc",
+        "src/trace_processor/dynamic/experimental_flamegraph_generator.cc",
+        "src/trace_processor/dynamic/experimental_flat_slice_generator.cc",
+        "src/trace_processor/dynamic/experimental_sched_upid_generator.cc",
+        "src/trace_processor/dynamic/experimental_slice_layout_generator.cc",
+        "src/trace_processor/dynamic/flamegraph_construction_algorithms.cc",
+        "src/trace_processor/dynamic/thread_state_generator.cc",
+    ],
+}
+
+// GN: //src/trace_processor/dynamic:unittests
+filegroup {
+    name: "perfetto_src_trace_processor_dynamic_unittests",
+    srcs: [
+        "src/trace_processor/dynamic/experimental_counter_dur_generator_unittest.cc",
+        "src/trace_processor/dynamic/experimental_flat_slice_generator_unittest.cc",
+        "src/trace_processor/dynamic/experimental_slice_layout_generator_unittest.cc",
+        "src/trace_processor/dynamic/thread_state_generator_unittest.cc",
+    ],
+}
+
 // GN: //src/trace_processor:export_json
 filegroup {
     name: "perfetto_src_trace_processor_export_json",
@@ -8315,21 +8350,37 @@
     ],
 }
 
+// GN: //src/trace_processor/importers/proto:storage_full
+filegroup {
+    name: "perfetto_src_trace_processor_importers_proto_storage_full",
+    srcs: [
+        "src/trace_processor/importers/proto/heap_graph_tracker.cc",
+    ],
+}
+
+// GN: //src/trace_processor/importers/proto:storage_minimal
+filegroup {
+    name: "perfetto_src_trace_processor_importers_proto_storage_minimal",
+    srcs: [
+        "src/trace_processor/importers/proto/heap_profile_tracker.cc",
+        "src/trace_processor/importers/proto/profiler_util.cc",
+        "src/trace_processor/importers/proto/stack_profile_tracker.cc",
+    ],
+}
+
+// GN: //src/trace_processor/importers/proto:unittests
+filegroup {
+    name: "perfetto_src_trace_processor_importers_proto_unittests",
+    srcs: [
+        "src/trace_processor/importers/proto/heap_graph_tracker_unittest.cc",
+        "src/trace_processor/importers/proto/heap_profile_tracker_unittest.cc",
+    ],
+}
+
 // GN: //src/trace_processor:lib
 filegroup {
     name: "perfetto_src_trace_processor_lib",
     srcs: [
-        "src/trace_processor/dynamic/ancestor_generator.cc",
-        "src/trace_processor/dynamic/connected_flow_generator.cc",
-        "src/trace_processor/dynamic/descendant_generator.cc",
-        "src/trace_processor/dynamic/describe_slice_generator.cc",
-        "src/trace_processor/dynamic/experimental_annotated_stack_generator.cc",
-        "src/trace_processor/dynamic/experimental_counter_dur_generator.cc",
-        "src/trace_processor/dynamic/experimental_flamegraph_generator.cc",
-        "src/trace_processor/dynamic/experimental_flat_slice_generator.cc",
-        "src/trace_processor/dynamic/experimental_sched_upid_generator.cc",
-        "src/trace_processor/dynamic/experimental_slice_layout_generator.cc",
-        "src/trace_processor/dynamic/thread_state_generator.cc",
         "src/trace_processor/iterator_impl.cc",
         "src/trace_processor/read_trace.cc",
         "src/trace_processor/trace_processor.cc",
@@ -8544,18 +8595,25 @@
         "src/trace_processor/sqlite/create_function_internal.cc",
         "src/trace_processor/sqlite/create_view_function.cc",
         "src/trace_processor/sqlite/db_sqlite_table.cc",
-        "src/trace_processor/sqlite/query_constraints.cc",
         "src/trace_processor/sqlite/register_function.cc",
         "src/trace_processor/sqlite/span_join_operator_table.cc",
         "src/trace_processor/sqlite/sql_stats_table.cc",
         "src/trace_processor/sqlite/sqlite3_str_split.cc",
         "src/trace_processor/sqlite/sqlite_raw_table.cc",
-        "src/trace_processor/sqlite/sqlite_table.cc",
         "src/trace_processor/sqlite/stats_table.cc",
         "src/trace_processor/sqlite/window_operator_table.cc",
     ],
 }
 
+// GN: //src/trace_processor/sqlite:sqlite_minimal
+filegroup {
+    name: "perfetto_src_trace_processor_sqlite_sqlite_minimal",
+    srcs: [
+        "src/trace_processor/sqlite/query_constraints.cc",
+        "src/trace_processor/sqlite/sqlite_table.cc",
+    ],
+}
+
 // GN: //src/trace_processor/sqlite:unittests
 filegroup {
     name: "perfetto_src_trace_processor_sqlite_unittests",
@@ -8595,7 +8653,6 @@
         "src/trace_processor/importers/proto/graphics_event_module.cc",
         "src/trace_processor/importers/proto/graphics_frame_event_parser.cc",
         "src/trace_processor/importers/proto/heap_graph_module.cc",
-        "src/trace_processor/importers/proto/heap_graph_tracker.cc",
         "src/trace_processor/importers/proto/system_probes_module.cc",
         "src/trace_processor/importers/proto/system_probes_parser.cc",
         "src/trace_processor/importers/proto/vulkan_memory_tracker.cc",
@@ -8621,8 +8678,6 @@
         "src/trace_processor/importers/proto/chrome_string_lookup.cc",
         "src/trace_processor/importers/proto/chrome_system_probes_module.cc",
         "src/trace_processor/importers/proto/chrome_system_probes_parser.cc",
-        "src/trace_processor/importers/proto/flamegraph_construction_algorithms.cc",
-        "src/trace_processor/importers/proto/heap_profile_tracker.cc",
         "src/trace_processor/importers/proto/memory_tracker_snapshot_module.cc",
         "src/trace_processor/importers/proto/memory_tracker_snapshot_parser.cc",
         "src/trace_processor/importers/proto/metadata_module.cc",
@@ -8631,12 +8686,10 @@
         "src/trace_processor/importers/proto/perf_sample_tracker.cc",
         "src/trace_processor/importers/proto/profile_module.cc",
         "src/trace_processor/importers/proto/profile_packet_utils.cc",
-        "src/trace_processor/importers/proto/profiler_util.cc",
         "src/trace_processor/importers/proto/proto_importer_module.cc",
         "src/trace_processor/importers/proto/proto_trace_parser.cc",
         "src/trace_processor/importers/proto/proto_trace_reader.cc",
         "src/trace_processor/importers/proto/proto_trace_tokenizer.cc",
-        "src/trace_processor/importers/proto/stack_profile_tracker.cc",
         "src/trace_processor/importers/proto/track_event_module.cc",
         "src/trace_processor/importers/proto/track_event_parser.cc",
         "src/trace_processor/importers/proto/track_event_tokenizer.cc",
@@ -8698,10 +8751,6 @@
 filegroup {
     name: "perfetto_src_trace_processor_unittests",
     srcs: [
-        "src/trace_processor/dynamic/experimental_counter_dur_generator_unittest.cc",
-        "src/trace_processor/dynamic/experimental_flat_slice_generator_unittest.cc",
-        "src/trace_processor/dynamic/experimental_slice_layout_generator_unittest.cc",
-        "src/trace_processor/dynamic/thread_state_generator_unittest.cc",
         "src/trace_processor/forwarding_trace_parser_unittest.cc",
         "src/trace_processor/importers/ftrace/binder_tracker_unittest.cc",
         "src/trace_processor/importers/ftrace/sched_event_tracker_unittest.cc",
@@ -8710,8 +8759,6 @@
         "src/trace_processor/importers/memory_tracker/graph_unittest.cc",
         "src/trace_processor/importers/memory_tracker/raw_process_memory_node_unittest.cc",
         "src/trace_processor/importers/proto/async_track_set_tracker_unittest.cc",
-        "src/trace_processor/importers/proto/heap_graph_tracker_unittest.cc",
-        "src/trace_processor/importers/proto/heap_profile_tracker_unittest.cc",
         "src/trace_processor/importers/proto/perf_sample_tracker_unittest.cc",
         "src/trace_processor/importers/proto/proto_trace_parser_unittest.cc",
         "src/trace_processor/importers/syscalls/syscall_tracker_unittest.cc",
@@ -9948,11 +9995,16 @@
         ":perfetto_src_trace_processor_containers_unittests",
         ":perfetto_src_trace_processor_db_db",
         ":perfetto_src_trace_processor_db_unittests",
+        ":perfetto_src_trace_processor_dynamic_dynamic",
+        ":perfetto_src_trace_processor_dynamic_unittests",
         ":perfetto_src_trace_processor_export_json",
         ":perfetto_src_trace_processor_ftrace_descriptors",
         ":perfetto_src_trace_processor_importers_common_common",
         ":perfetto_src_trace_processor_importers_common_unittests",
         ":perfetto_src_trace_processor_importers_memory_tracker_graph_processor",
+        ":perfetto_src_trace_processor_importers_proto_storage_full",
+        ":perfetto_src_trace_processor_importers_proto_storage_minimal",
+        ":perfetto_src_trace_processor_importers_proto_unittests",
         ":perfetto_src_trace_processor_lib",
         ":perfetto_src_trace_processor_metatrace",
         ":perfetto_src_trace_processor_metrics_metrics",
@@ -9960,6 +10012,7 @@
         ":perfetto_src_trace_processor_rpc_rpc",
         ":perfetto_src_trace_processor_rpc_unittests",
         ":perfetto_src_trace_processor_sqlite_sqlite",
+        ":perfetto_src_trace_processor_sqlite_sqlite_minimal",
         ":perfetto_src_trace_processor_sqlite_unittests",
         ":perfetto_src_trace_processor_storage_full",
         ":perfetto_src_trace_processor_storage_minimal",
@@ -10258,16 +10311,20 @@
         ":perfetto_src_trace_processor_analysis_analysis",
         ":perfetto_src_trace_processor_containers_containers",
         ":perfetto_src_trace_processor_db_db",
+        ":perfetto_src_trace_processor_dynamic_dynamic",
         ":perfetto_src_trace_processor_export_json",
         ":perfetto_src_trace_processor_ftrace_descriptors",
         ":perfetto_src_trace_processor_importers_common_common",
         ":perfetto_src_trace_processor_importers_memory_tracker_graph_processor",
+        ":perfetto_src_trace_processor_importers_proto_storage_full",
+        ":perfetto_src_trace_processor_importers_proto_storage_minimal",
         ":perfetto_src_trace_processor_lib",
         ":perfetto_src_trace_processor_metatrace",
         ":perfetto_src_trace_processor_metrics_metrics",
         ":perfetto_src_trace_processor_rpc_httpd",
         ":perfetto_src_trace_processor_rpc_rpc",
         ":perfetto_src_trace_processor_sqlite_sqlite",
+        ":perfetto_src_trace_processor_sqlite_sqlite_minimal",
         ":perfetto_src_trace_processor_storage_full",
         ":perfetto_src_trace_processor_storage_minimal",
         ":perfetto_src_trace_processor_storage_storage",
@@ -10417,14 +10474,18 @@
         ":perfetto_src_trace_processor_analysis_analysis",
         ":perfetto_src_trace_processor_containers_containers",
         ":perfetto_src_trace_processor_db_db",
+        ":perfetto_src_trace_processor_dynamic_dynamic",
         ":perfetto_src_trace_processor_export_json",
         ":perfetto_src_trace_processor_ftrace_descriptors",
         ":perfetto_src_trace_processor_importers_common_common",
         ":perfetto_src_trace_processor_importers_memory_tracker_graph_processor",
+        ":perfetto_src_trace_processor_importers_proto_storage_full",
+        ":perfetto_src_trace_processor_importers_proto_storage_minimal",
         ":perfetto_src_trace_processor_lib",
         ":perfetto_src_trace_processor_metatrace",
         ":perfetto_src_trace_processor_metrics_metrics",
         ":perfetto_src_trace_processor_sqlite_sqlite",
+        ":perfetto_src_trace_processor_sqlite_sqlite_minimal",
         ":perfetto_src_trace_processor_storage_full",
         ":perfetto_src_trace_processor_storage_minimal",
         ":perfetto_src_trace_processor_storage_storage",