tp: move SQL metric files into 'sql' folder
And also add an empty 'protos' folder to src/trace_processor/metrics
The union of these two changes means that src/trace_processor/metrics
can be passed as a 'metric extension path' to trace processor: follow up
changes will make it so that we can hot-reload the metrics folder
making local development of metrics very fast.
Change-Id: I568db8aa2ac9d2fc512ed80f8ef812b8f9d919ae
Bug: 190219056
diff --git a/Android.bp b/Android.bp
index 780930a..d00d85c 100644
--- a/Android.bp
+++ b/Android.bp
@@ -1753,7 +1753,7 @@
":perfetto_src_trace_processor_importers_memory_tracker_graph_processor",
":perfetto_src_trace_processor_lib",
":perfetto_src_trace_processor_metatrace",
- ":perfetto_src_trace_processor_metrics_lib",
+ ":perfetto_src_trace_processor_metrics_metrics",
":perfetto_src_trace_processor_sqlite_sqlite",
":perfetto_src_trace_processor_storage_full",
":perfetto_src_trace_processor_storage_minimal",
@@ -1885,7 +1885,7 @@
"perfetto_src_trace_processor_importers_gen_cc_track_event_descriptor",
"perfetto_src_trace_processor_metrics_gen_cc_all_chrome_metrics_descriptor",
"perfetto_src_trace_processor_metrics_gen_cc_metrics_descriptor",
- "perfetto_src_trace_processor_metrics_gen_merged_sql_metrics",
+ "perfetto_src_trace_processor_metrics_sql_gen_amalgamated_sql_metrics",
],
defaults: [
"perfetto_defaults",
@@ -7965,7 +7965,7 @@
],
cmd: "$(location tools/gen_cc_proto_descriptor.py) --gen_dir=$(genDir) --cpp_out=$(out) $(in)",
out: [
- "src/trace_processor/metrics/chrome/all_chrome_metrics.descriptor.h",
+ "src/trace_processor/metrics/all_chrome_metrics.descriptor.h",
],
tool_files: [
"tools/gen_cc_proto_descriptor.py",
@@ -7987,113 +7987,113 @@
],
}
-// GN: //src/trace_processor/metrics:gen_merged_sql_metrics
-genrule {
- name: "perfetto_src_trace_processor_metrics_gen_merged_sql_metrics",
+// GN: //src/trace_processor/metrics:metrics
+filegroup {
+ name: "perfetto_src_trace_processor_metrics_metrics",
srcs: [
- "src/trace_processor/metrics/android/android_batt.sql",
- "src/trace_processor/metrics/android/android_camera.sql",
- "src/trace_processor/metrics/android/android_cpu.sql",
- "src/trace_processor/metrics/android/android_cpu_agg.sql",
- "src/trace_processor/metrics/android/android_cpu_raw_metrics_per_core.sql",
- "src/trace_processor/metrics/android/android_dma_heap.sql",
- "src/trace_processor/metrics/android/android_fastrpc.sql",
- "src/trace_processor/metrics/android/android_gpu.sql",
- "src/trace_processor/metrics/android/android_hwcomposer.sql",
- "src/trace_processor/metrics/android/android_hwui_metric.sql",
- "src/trace_processor/metrics/android/android_hwui_threads.sql",
- "src/trace_processor/metrics/android/android_ion.sql",
- "src/trace_processor/metrics/android/android_jank.sql",
- "src/trace_processor/metrics/android/android_lmk.sql",
- "src/trace_processor/metrics/android/android_lmk_reason.sql",
- "src/trace_processor/metrics/android/android_mem.sql",
- "src/trace_processor/metrics/android/android_mem_unagg.sql",
- "src/trace_processor/metrics/android/android_multiuser.sql",
- "src/trace_processor/metrics/android/android_multiuser_populator.sql",
- "src/trace_processor/metrics/android/android_package_list.sql",
- "src/trace_processor/metrics/android/android_powrails.sql",
- "src/trace_processor/metrics/android/android_proxy_power.sql",
- "src/trace_processor/metrics/android/android_simpleperf.sql",
- "src/trace_processor/metrics/android/android_startup.sql",
- "src/trace_processor/metrics/android/android_surfaceflinger.sql",
- "src/trace_processor/metrics/android/android_sysui_cuj.sql",
- "src/trace_processor/metrics/android/android_sysui_cuj_jank_query.sql",
- "src/trace_processor/metrics/android/android_task_names.sql",
- "src/trace_processor/metrics/android/android_thread_time_in_state.sql",
- "src/trace_processor/metrics/android/android_trace_quality.sql",
- "src/trace_processor/metrics/android/composer_execution.sql",
- "src/trace_processor/metrics/android/composition_layers.sql",
- "src/trace_processor/metrics/android/cpu_info.sql",
- "src/trace_processor/metrics/android/display_metrics.sql",
- "src/trace_processor/metrics/android/frame_missed.sql",
- "src/trace_processor/metrics/android/g2d.sql",
- "src/trace_processor/metrics/android/g2d_duration.sql",
- "src/trace_processor/metrics/android/global_counter_span_view.sql",
- "src/trace_processor/metrics/android/gpu_counter_span_view.sql",
- "src/trace_processor/metrics/android/java_heap_histogram.sql",
- "src/trace_processor/metrics/android/java_heap_stats.sql",
- "src/trace_processor/metrics/android/mem_stats_priority_breakdown.sql",
- "src/trace_processor/metrics/android/power_drain_in_watts.sql",
- "src/trace_processor/metrics/android/power_profile_data.sql",
- "src/trace_processor/metrics/android/process_counter_span_view.sql",
- "src/trace_processor/metrics/android/process_mem.sql",
- "src/trace_processor/metrics/android/process_metadata.sql",
- "src/trace_processor/metrics/android/process_oom_score.sql",
- "src/trace_processor/metrics/android/process_unagg_mem_view.sql",
- "src/trace_processor/metrics/android/profiler_smaps.sql",
- "src/trace_processor/metrics/android/span_view_stats.sql",
- "src/trace_processor/metrics/android/startup/hsc.sql",
- "src/trace_processor/metrics/android/startup/launches.sql",
- "src/trace_processor/metrics/android/thread_counter_span_view.sql",
- "src/trace_processor/metrics/android/unsymbolized_frames.sql",
- "src/trace_processor/metrics/chrome/actual_power_by_category.sql",
- "src/trace_processor/metrics/chrome/actual_power_by_rail_mode.sql",
- "src/trace_processor/metrics/chrome/chrome_event_metadata.sql",
- "src/trace_processor/metrics/chrome/chrome_processes.sql",
- "src/trace_processor/metrics/chrome/chrome_thread_slice_with_cpu_time.sql",
- "src/trace_processor/metrics/chrome/cpu_time_by_category.sql",
- "src/trace_processor/metrics/chrome/cpu_time_by_rail_mode.sql",
- "src/trace_processor/metrics/chrome/estimated_power_by_category.sql",
- "src/trace_processor/metrics/chrome/estimated_power_by_rail_mode.sql",
- "src/trace_processor/metrics/chrome/gesture_flow_event.sql",
- "src/trace_processor/metrics/chrome/gesture_flow_event_queuing_delay.sql",
- "src/trace_processor/metrics/chrome/gesture_jank.sql",
- "src/trace_processor/metrics/chrome/rail_modes.sql",
- "src/trace_processor/metrics/chrome/scroll_flow_event.sql",
- "src/trace_processor/metrics/chrome/scroll_flow_event_queuing_delay.sql",
- "src/trace_processor/metrics/chrome/scroll_jank.sql",
- "src/trace_processor/metrics/chrome/scroll_jank_cause.sql",
- "src/trace_processor/metrics/chrome/scroll_jank_cause_blocking_task.sql",
- "src/trace_processor/metrics/chrome/scroll_jank_cause_blocking_touch_move.sql",
- "src/trace_processor/metrics/chrome/scroll_jank_cause_get_bitmap.sql",
- "src/trace_processor/metrics/chrome/scroll_jank_cause_queuing_delay.sql",
- "src/trace_processor/metrics/chrome/test_chrome_metric.sql",
- "src/trace_processor/metrics/chrome/touch_flow_event.sql",
- "src/trace_processor/metrics/chrome/touch_flow_event_queuing_delay.sql",
- "src/trace_processor/metrics/chrome/touch_jank.sql",
- "src/trace_processor/metrics/experimental/blink_gc_metric.sql",
- "src/trace_processor/metrics/experimental/chrome_dropped_frames.sql",
- "src/trace_processor/metrics/experimental/frame_times.sql",
- "src/trace_processor/metrics/experimental/media_metric.sql",
- "src/trace_processor/metrics/experimental/reported_by_page.sql",
- "src/trace_processor/metrics/trace_metadata.sql",
- "src/trace_processor/metrics/trace_stats.sql",
- "src/trace_processor/metrics/webview/webview_power_usage.sql",
- ],
- cmd: "$(location tools/gen_merged_sql_metrics.py) --cpp_out=$(out) $(in)",
- out: [
- "src/trace_processor/metrics/sql_metrics.h",
- ],
- tool_files: [
- "tools/gen_merged_sql_metrics.py",
+ "src/trace_processor/metrics/metrics.cc",
],
}
-// GN: //src/trace_processor/metrics:lib
-filegroup {
- name: "perfetto_src_trace_processor_metrics_lib",
+// GN: //src/trace_processor/metrics/sql:gen_amalgamated_sql_metrics
+genrule {
+ name: "perfetto_src_trace_processor_metrics_sql_gen_amalgamated_sql_metrics",
srcs: [
- "src/trace_processor/metrics/metrics.cc",
+ "src/trace_processor/metrics/sql/android/android_batt.sql",
+ "src/trace_processor/metrics/sql/android/android_camera.sql",
+ "src/trace_processor/metrics/sql/android/android_cpu.sql",
+ "src/trace_processor/metrics/sql/android/android_cpu_agg.sql",
+ "src/trace_processor/metrics/sql/android/android_cpu_raw_metrics_per_core.sql",
+ "src/trace_processor/metrics/sql/android/android_dma_heap.sql",
+ "src/trace_processor/metrics/sql/android/android_fastrpc.sql",
+ "src/trace_processor/metrics/sql/android/android_gpu.sql",
+ "src/trace_processor/metrics/sql/android/android_hwcomposer.sql",
+ "src/trace_processor/metrics/sql/android/android_hwui_metric.sql",
+ "src/trace_processor/metrics/sql/android/android_hwui_threads.sql",
+ "src/trace_processor/metrics/sql/android/android_ion.sql",
+ "src/trace_processor/metrics/sql/android/android_jank.sql",
+ "src/trace_processor/metrics/sql/android/android_lmk.sql",
+ "src/trace_processor/metrics/sql/android/android_lmk_reason.sql",
+ "src/trace_processor/metrics/sql/android/android_mem.sql",
+ "src/trace_processor/metrics/sql/android/android_mem_unagg.sql",
+ "src/trace_processor/metrics/sql/android/android_multiuser.sql",
+ "src/trace_processor/metrics/sql/android/android_multiuser_populator.sql",
+ "src/trace_processor/metrics/sql/android/android_package_list.sql",
+ "src/trace_processor/metrics/sql/android/android_powrails.sql",
+ "src/trace_processor/metrics/sql/android/android_proxy_power.sql",
+ "src/trace_processor/metrics/sql/android/android_simpleperf.sql",
+ "src/trace_processor/metrics/sql/android/android_startup.sql",
+ "src/trace_processor/metrics/sql/android/android_surfaceflinger.sql",
+ "src/trace_processor/metrics/sql/android/android_sysui_cuj.sql",
+ "src/trace_processor/metrics/sql/android/android_sysui_cuj_jank_query.sql",
+ "src/trace_processor/metrics/sql/android/android_task_names.sql",
+ "src/trace_processor/metrics/sql/android/android_thread_time_in_state.sql",
+ "src/trace_processor/metrics/sql/android/android_trace_quality.sql",
+ "src/trace_processor/metrics/sql/android/composer_execution.sql",
+ "src/trace_processor/metrics/sql/android/composition_layers.sql",
+ "src/trace_processor/metrics/sql/android/cpu_info.sql",
+ "src/trace_processor/metrics/sql/android/display_metrics.sql",
+ "src/trace_processor/metrics/sql/android/frame_missed.sql",
+ "src/trace_processor/metrics/sql/android/g2d.sql",
+ "src/trace_processor/metrics/sql/android/g2d_duration.sql",
+ "src/trace_processor/metrics/sql/android/global_counter_span_view.sql",
+ "src/trace_processor/metrics/sql/android/gpu_counter_span_view.sql",
+ "src/trace_processor/metrics/sql/android/java_heap_histogram.sql",
+ "src/trace_processor/metrics/sql/android/java_heap_stats.sql",
+ "src/trace_processor/metrics/sql/android/mem_stats_priority_breakdown.sql",
+ "src/trace_processor/metrics/sql/android/power_drain_in_watts.sql",
+ "src/trace_processor/metrics/sql/android/power_profile_data.sql",
+ "src/trace_processor/metrics/sql/android/process_counter_span_view.sql",
+ "src/trace_processor/metrics/sql/android/process_mem.sql",
+ "src/trace_processor/metrics/sql/android/process_metadata.sql",
+ "src/trace_processor/metrics/sql/android/process_oom_score.sql",
+ "src/trace_processor/metrics/sql/android/process_unagg_mem_view.sql",
+ "src/trace_processor/metrics/sql/android/profiler_smaps.sql",
+ "src/trace_processor/metrics/sql/android/span_view_stats.sql",
+ "src/trace_processor/metrics/sql/android/startup/hsc.sql",
+ "src/trace_processor/metrics/sql/android/startup/launches.sql",
+ "src/trace_processor/metrics/sql/android/thread_counter_span_view.sql",
+ "src/trace_processor/metrics/sql/android/unsymbolized_frames.sql",
+ "src/trace_processor/metrics/sql/chrome/actual_power_by_category.sql",
+ "src/trace_processor/metrics/sql/chrome/actual_power_by_rail_mode.sql",
+ "src/trace_processor/metrics/sql/chrome/chrome_event_metadata.sql",
+ "src/trace_processor/metrics/sql/chrome/chrome_processes.sql",
+ "src/trace_processor/metrics/sql/chrome/chrome_thread_slice_with_cpu_time.sql",
+ "src/trace_processor/metrics/sql/chrome/cpu_time_by_category.sql",
+ "src/trace_processor/metrics/sql/chrome/cpu_time_by_rail_mode.sql",
+ "src/trace_processor/metrics/sql/chrome/estimated_power_by_category.sql",
+ "src/trace_processor/metrics/sql/chrome/estimated_power_by_rail_mode.sql",
+ "src/trace_processor/metrics/sql/chrome/gesture_flow_event.sql",
+ "src/trace_processor/metrics/sql/chrome/gesture_flow_event_queuing_delay.sql",
+ "src/trace_processor/metrics/sql/chrome/gesture_jank.sql",
+ "src/trace_processor/metrics/sql/chrome/rail_modes.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_flow_event.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_flow_event_queuing_delay.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank_cause.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank_cause_blocking_task.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank_cause_blocking_touch_move.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank_cause_get_bitmap.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank_cause_queuing_delay.sql",
+ "src/trace_processor/metrics/sql/chrome/test_chrome_metric.sql",
+ "src/trace_processor/metrics/sql/chrome/touch_flow_event.sql",
+ "src/trace_processor/metrics/sql/chrome/touch_flow_event_queuing_delay.sql",
+ "src/trace_processor/metrics/sql/chrome/touch_jank.sql",
+ "src/trace_processor/metrics/sql/experimental/blink_gc_metric.sql",
+ "src/trace_processor/metrics/sql/experimental/chrome_dropped_frames.sql",
+ "src/trace_processor/metrics/sql/experimental/frame_times.sql",
+ "src/trace_processor/metrics/sql/experimental/media_metric.sql",
+ "src/trace_processor/metrics/sql/experimental/reported_by_page.sql",
+ "src/trace_processor/metrics/sql/trace_metadata.sql",
+ "src/trace_processor/metrics/sql/trace_stats.sql",
+ "src/trace_processor/metrics/sql/webview/webview_power_usage.sql",
+ ],
+ cmd: "$(location tools/gen_amalgamated_sql_metrics.py) --cpp_out=$(out) $(in)",
+ out: [
+ "src/trace_processor/metrics/sql/amalgamated_sql_metrics.h",
+ ],
+ tool_files: [
+ "tools/gen_amalgamated_sql_metrics.py",
],
}
@@ -9342,7 +9342,7 @@
":perfetto_src_trace_processor_importers_memory_tracker_graph_processor",
":perfetto_src_trace_processor_lib",
":perfetto_src_trace_processor_metatrace",
- ":perfetto_src_trace_processor_metrics_lib",
+ ":perfetto_src_trace_processor_metrics_metrics",
":perfetto_src_trace_processor_metrics_unittests",
":perfetto_src_trace_processor_rpc_rpc",
":perfetto_src_trace_processor_rpc_unittests",
@@ -9534,7 +9534,7 @@
"perfetto_src_trace_processor_importers_gen_cc_track_event_descriptor",
"perfetto_src_trace_processor_metrics_gen_cc_all_chrome_metrics_descriptor",
"perfetto_src_trace_processor_metrics_gen_cc_metrics_descriptor",
- "perfetto_src_trace_processor_metrics_gen_merged_sql_metrics",
+ "perfetto_src_trace_processor_metrics_sql_gen_amalgamated_sql_metrics",
"perfetto_src_traced_probes_ftrace_test_messages_cpp_gen_headers",
"perfetto_src_traced_probes_ftrace_test_messages_lite_gen_headers",
"perfetto_src_traced_probes_ftrace_test_messages_zero_gen_headers",
@@ -9642,7 +9642,7 @@
":perfetto_src_trace_processor_importers_memory_tracker_graph_processor",
":perfetto_src_trace_processor_lib",
":perfetto_src_trace_processor_metatrace",
- ":perfetto_src_trace_processor_metrics_lib",
+ ":perfetto_src_trace_processor_metrics_metrics",
":perfetto_src_trace_processor_rpc_httpd",
":perfetto_src_trace_processor_rpc_rpc",
":perfetto_src_trace_processor_sqlite_sqlite",
@@ -9697,7 +9697,7 @@
"perfetto_src_trace_processor_importers_gen_cc_track_event_descriptor",
"perfetto_src_trace_processor_metrics_gen_cc_all_chrome_metrics_descriptor",
"perfetto_src_trace_processor_metrics_gen_cc_metrics_descriptor",
- "perfetto_src_trace_processor_metrics_gen_merged_sql_metrics",
+ "perfetto_src_trace_processor_metrics_sql_gen_amalgamated_sql_metrics",
],
defaults: [
"perfetto_defaults",
@@ -9796,7 +9796,7 @@
":perfetto_src_trace_processor_importers_memory_tracker_graph_processor",
":perfetto_src_trace_processor_lib",
":perfetto_src_trace_processor_metatrace",
- ":perfetto_src_trace_processor_metrics_lib",
+ ":perfetto_src_trace_processor_metrics_metrics",
":perfetto_src_trace_processor_sqlite_sqlite",
":perfetto_src_trace_processor_storage_full",
":perfetto_src_trace_processor_storage_minimal",
@@ -9856,7 +9856,7 @@
"perfetto_src_trace_processor_importers_gen_cc_track_event_descriptor",
"perfetto_src_trace_processor_metrics_gen_cc_all_chrome_metrics_descriptor",
"perfetto_src_trace_processor_metrics_gen_cc_metrics_descriptor",
- "perfetto_src_trace_processor_metrics_gen_merged_sql_metrics",
+ "perfetto_src_trace_processor_metrics_sql_gen_amalgamated_sql_metrics",
"perfetto_tools_trace_to_text_gen_cc_trace_descriptor",
],
defaults: [
diff --git a/BUILD b/BUILD
index 6d764f6..a93d8bc 100644
--- a/BUILD
+++ b/BUILD
@@ -997,13 +997,114 @@
],
)
+perfetto_genrule(
+ name = "src_trace_processor_metrics_sql_gen_amalgamated_sql_metrics",
+ srcs = [
+ "src/trace_processor/metrics/sql/android/android_batt.sql",
+ "src/trace_processor/metrics/sql/android/android_camera.sql",
+ "src/trace_processor/metrics/sql/android/android_cpu.sql",
+ "src/trace_processor/metrics/sql/android/android_cpu_agg.sql",
+ "src/trace_processor/metrics/sql/android/android_cpu_raw_metrics_per_core.sql",
+ "src/trace_processor/metrics/sql/android/android_dma_heap.sql",
+ "src/trace_processor/metrics/sql/android/android_fastrpc.sql",
+ "src/trace_processor/metrics/sql/android/android_gpu.sql",
+ "src/trace_processor/metrics/sql/android/android_hwcomposer.sql",
+ "src/trace_processor/metrics/sql/android/android_hwui_metric.sql",
+ "src/trace_processor/metrics/sql/android/android_hwui_threads.sql",
+ "src/trace_processor/metrics/sql/android/android_ion.sql",
+ "src/trace_processor/metrics/sql/android/android_jank.sql",
+ "src/trace_processor/metrics/sql/android/android_lmk.sql",
+ "src/trace_processor/metrics/sql/android/android_lmk_reason.sql",
+ "src/trace_processor/metrics/sql/android/android_mem.sql",
+ "src/trace_processor/metrics/sql/android/android_mem_unagg.sql",
+ "src/trace_processor/metrics/sql/android/android_multiuser.sql",
+ "src/trace_processor/metrics/sql/android/android_multiuser_populator.sql",
+ "src/trace_processor/metrics/sql/android/android_package_list.sql",
+ "src/trace_processor/metrics/sql/android/android_powrails.sql",
+ "src/trace_processor/metrics/sql/android/android_proxy_power.sql",
+ "src/trace_processor/metrics/sql/android/android_simpleperf.sql",
+ "src/trace_processor/metrics/sql/android/android_startup.sql",
+ "src/trace_processor/metrics/sql/android/android_surfaceflinger.sql",
+ "src/trace_processor/metrics/sql/android/android_sysui_cuj.sql",
+ "src/trace_processor/metrics/sql/android/android_sysui_cuj_jank_query.sql",
+ "src/trace_processor/metrics/sql/android/android_task_names.sql",
+ "src/trace_processor/metrics/sql/android/android_thread_time_in_state.sql",
+ "src/trace_processor/metrics/sql/android/android_trace_quality.sql",
+ "src/trace_processor/metrics/sql/android/composer_execution.sql",
+ "src/trace_processor/metrics/sql/android/composition_layers.sql",
+ "src/trace_processor/metrics/sql/android/cpu_info.sql",
+ "src/trace_processor/metrics/sql/android/display_metrics.sql",
+ "src/trace_processor/metrics/sql/android/frame_missed.sql",
+ "src/trace_processor/metrics/sql/android/g2d.sql",
+ "src/trace_processor/metrics/sql/android/g2d_duration.sql",
+ "src/trace_processor/metrics/sql/android/global_counter_span_view.sql",
+ "src/trace_processor/metrics/sql/android/gpu_counter_span_view.sql",
+ "src/trace_processor/metrics/sql/android/java_heap_histogram.sql",
+ "src/trace_processor/metrics/sql/android/java_heap_stats.sql",
+ "src/trace_processor/metrics/sql/android/mem_stats_priority_breakdown.sql",
+ "src/trace_processor/metrics/sql/android/power_drain_in_watts.sql",
+ "src/trace_processor/metrics/sql/android/power_profile_data.sql",
+ "src/trace_processor/metrics/sql/android/process_counter_span_view.sql",
+ "src/trace_processor/metrics/sql/android/process_mem.sql",
+ "src/trace_processor/metrics/sql/android/process_metadata.sql",
+ "src/trace_processor/metrics/sql/android/process_oom_score.sql",
+ "src/trace_processor/metrics/sql/android/process_unagg_mem_view.sql",
+ "src/trace_processor/metrics/sql/android/profiler_smaps.sql",
+ "src/trace_processor/metrics/sql/android/span_view_stats.sql",
+ "src/trace_processor/metrics/sql/android/startup/hsc.sql",
+ "src/trace_processor/metrics/sql/android/startup/launches.sql",
+ "src/trace_processor/metrics/sql/android/thread_counter_span_view.sql",
+ "src/trace_processor/metrics/sql/android/unsymbolized_frames.sql",
+ "src/trace_processor/metrics/sql/chrome/actual_power_by_category.sql",
+ "src/trace_processor/metrics/sql/chrome/actual_power_by_rail_mode.sql",
+ "src/trace_processor/metrics/sql/chrome/chrome_event_metadata.sql",
+ "src/trace_processor/metrics/sql/chrome/chrome_processes.sql",
+ "src/trace_processor/metrics/sql/chrome/chrome_thread_slice_with_cpu_time.sql",
+ "src/trace_processor/metrics/sql/chrome/cpu_time_by_category.sql",
+ "src/trace_processor/metrics/sql/chrome/cpu_time_by_rail_mode.sql",
+ "src/trace_processor/metrics/sql/chrome/estimated_power_by_category.sql",
+ "src/trace_processor/metrics/sql/chrome/estimated_power_by_rail_mode.sql",
+ "src/trace_processor/metrics/sql/chrome/gesture_flow_event.sql",
+ "src/trace_processor/metrics/sql/chrome/gesture_flow_event_queuing_delay.sql",
+ "src/trace_processor/metrics/sql/chrome/gesture_jank.sql",
+ "src/trace_processor/metrics/sql/chrome/rail_modes.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_flow_event.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_flow_event_queuing_delay.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank_cause.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank_cause_blocking_task.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank_cause_blocking_touch_move.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank_cause_get_bitmap.sql",
+ "src/trace_processor/metrics/sql/chrome/scroll_jank_cause_queuing_delay.sql",
+ "src/trace_processor/metrics/sql/chrome/test_chrome_metric.sql",
+ "src/trace_processor/metrics/sql/chrome/touch_flow_event.sql",
+ "src/trace_processor/metrics/sql/chrome/touch_flow_event_queuing_delay.sql",
+ "src/trace_processor/metrics/sql/chrome/touch_jank.sql",
+ "src/trace_processor/metrics/sql/experimental/blink_gc_metric.sql",
+ "src/trace_processor/metrics/sql/experimental/chrome_dropped_frames.sql",
+ "src/trace_processor/metrics/sql/experimental/frame_times.sql",
+ "src/trace_processor/metrics/sql/experimental/media_metric.sql",
+ "src/trace_processor/metrics/sql/experimental/reported_by_page.sql",
+ "src/trace_processor/metrics/sql/trace_metadata.sql",
+ "src/trace_processor/metrics/sql/trace_stats.sql",
+ "src/trace_processor/metrics/sql/webview/webview_power_usage.sql",
+ ],
+ outs = [
+ "src/trace_processor/metrics/sql/amalgamated_sql_metrics.h",
+ ],
+ cmd = "$(location gen_amalgamated_sql_metrics_py) --cpp_out=$@ $(SRCS)",
+ exec_tools = [
+ ":gen_amalgamated_sql_metrics_py",
+ ],
+)
+
perfetto_cc_proto_descriptor(
name = "src_trace_processor_metrics_gen_cc_all_chrome_metrics_descriptor",
deps = [
":protos_perfetto_metrics_chrome_descriptor",
],
outs = [
- "src/trace_processor/metrics/chrome/all_chrome_metrics.descriptor.h",
+ "src/trace_processor/metrics/all_chrome_metrics.descriptor.h",
],
)
@@ -1017,110 +1118,9 @@
],
)
-perfetto_genrule(
- name = "src_trace_processor_metrics_gen_merged_sql_metrics",
- srcs = [
- "src/trace_processor/metrics/android/android_batt.sql",
- "src/trace_processor/metrics/android/android_camera.sql",
- "src/trace_processor/metrics/android/android_cpu.sql",
- "src/trace_processor/metrics/android/android_cpu_agg.sql",
- "src/trace_processor/metrics/android/android_cpu_raw_metrics_per_core.sql",
- "src/trace_processor/metrics/android/android_dma_heap.sql",
- "src/trace_processor/metrics/android/android_fastrpc.sql",
- "src/trace_processor/metrics/android/android_gpu.sql",
- "src/trace_processor/metrics/android/android_hwcomposer.sql",
- "src/trace_processor/metrics/android/android_hwui_metric.sql",
- "src/trace_processor/metrics/android/android_hwui_threads.sql",
- "src/trace_processor/metrics/android/android_ion.sql",
- "src/trace_processor/metrics/android/android_jank.sql",
- "src/trace_processor/metrics/android/android_lmk.sql",
- "src/trace_processor/metrics/android/android_lmk_reason.sql",
- "src/trace_processor/metrics/android/android_mem.sql",
- "src/trace_processor/metrics/android/android_mem_unagg.sql",
- "src/trace_processor/metrics/android/android_multiuser.sql",
- "src/trace_processor/metrics/android/android_multiuser_populator.sql",
- "src/trace_processor/metrics/android/android_package_list.sql",
- "src/trace_processor/metrics/android/android_powrails.sql",
- "src/trace_processor/metrics/android/android_proxy_power.sql",
- "src/trace_processor/metrics/android/android_simpleperf.sql",
- "src/trace_processor/metrics/android/android_startup.sql",
- "src/trace_processor/metrics/android/android_surfaceflinger.sql",
- "src/trace_processor/metrics/android/android_sysui_cuj.sql",
- "src/trace_processor/metrics/android/android_sysui_cuj_jank_query.sql",
- "src/trace_processor/metrics/android/android_task_names.sql",
- "src/trace_processor/metrics/android/android_thread_time_in_state.sql",
- "src/trace_processor/metrics/android/android_trace_quality.sql",
- "src/trace_processor/metrics/android/composer_execution.sql",
- "src/trace_processor/metrics/android/composition_layers.sql",
- "src/trace_processor/metrics/android/cpu_info.sql",
- "src/trace_processor/metrics/android/display_metrics.sql",
- "src/trace_processor/metrics/android/frame_missed.sql",
- "src/trace_processor/metrics/android/g2d.sql",
- "src/trace_processor/metrics/android/g2d_duration.sql",
- "src/trace_processor/metrics/android/global_counter_span_view.sql",
- "src/trace_processor/metrics/android/gpu_counter_span_view.sql",
- "src/trace_processor/metrics/android/java_heap_histogram.sql",
- "src/trace_processor/metrics/android/java_heap_stats.sql",
- "src/trace_processor/metrics/android/mem_stats_priority_breakdown.sql",
- "src/trace_processor/metrics/android/power_drain_in_watts.sql",
- "src/trace_processor/metrics/android/power_profile_data.sql",
- "src/trace_processor/metrics/android/process_counter_span_view.sql",
- "src/trace_processor/metrics/android/process_mem.sql",
- "src/trace_processor/metrics/android/process_metadata.sql",
- "src/trace_processor/metrics/android/process_oom_score.sql",
- "src/trace_processor/metrics/android/process_unagg_mem_view.sql",
- "src/trace_processor/metrics/android/profiler_smaps.sql",
- "src/trace_processor/metrics/android/span_view_stats.sql",
- "src/trace_processor/metrics/android/startup/hsc.sql",
- "src/trace_processor/metrics/android/startup/launches.sql",
- "src/trace_processor/metrics/android/thread_counter_span_view.sql",
- "src/trace_processor/metrics/android/unsymbolized_frames.sql",
- "src/trace_processor/metrics/chrome/actual_power_by_category.sql",
- "src/trace_processor/metrics/chrome/actual_power_by_rail_mode.sql",
- "src/trace_processor/metrics/chrome/chrome_event_metadata.sql",
- "src/trace_processor/metrics/chrome/chrome_processes.sql",
- "src/trace_processor/metrics/chrome/chrome_thread_slice_with_cpu_time.sql",
- "src/trace_processor/metrics/chrome/cpu_time_by_category.sql",
- "src/trace_processor/metrics/chrome/cpu_time_by_rail_mode.sql",
- "src/trace_processor/metrics/chrome/estimated_power_by_category.sql",
- "src/trace_processor/metrics/chrome/estimated_power_by_rail_mode.sql",
- "src/trace_processor/metrics/chrome/gesture_flow_event.sql",
- "src/trace_processor/metrics/chrome/gesture_flow_event_queuing_delay.sql",
- "src/trace_processor/metrics/chrome/gesture_jank.sql",
- "src/trace_processor/metrics/chrome/rail_modes.sql",
- "src/trace_processor/metrics/chrome/scroll_flow_event.sql",
- "src/trace_processor/metrics/chrome/scroll_flow_event_queuing_delay.sql",
- "src/trace_processor/metrics/chrome/scroll_jank.sql",
- "src/trace_processor/metrics/chrome/scroll_jank_cause.sql",
- "src/trace_processor/metrics/chrome/scroll_jank_cause_blocking_task.sql",
- "src/trace_processor/metrics/chrome/scroll_jank_cause_blocking_touch_move.sql",
- "src/trace_processor/metrics/chrome/scroll_jank_cause_get_bitmap.sql",
- "src/trace_processor/metrics/chrome/scroll_jank_cause_queuing_delay.sql",
- "src/trace_processor/metrics/chrome/test_chrome_metric.sql",
- "src/trace_processor/metrics/chrome/touch_flow_event.sql",
- "src/trace_processor/metrics/chrome/touch_flow_event_queuing_delay.sql",
- "src/trace_processor/metrics/chrome/touch_jank.sql",
- "src/trace_processor/metrics/experimental/blink_gc_metric.sql",
- "src/trace_processor/metrics/experimental/chrome_dropped_frames.sql",
- "src/trace_processor/metrics/experimental/frame_times.sql",
- "src/trace_processor/metrics/experimental/media_metric.sql",
- "src/trace_processor/metrics/experimental/reported_by_page.sql",
- "src/trace_processor/metrics/trace_metadata.sql",
- "src/trace_processor/metrics/trace_stats.sql",
- "src/trace_processor/metrics/webview/webview_power_usage.sql",
- ],
- outs = [
- "src/trace_processor/metrics/sql_metrics.h",
- ],
- cmd = "$(location gen_merged_sql_metrics_py) --cpp_out=$@ $(SRCS)",
- exec_tools = [
- ":gen_merged_sql_metrics_py",
- ],
-)
-
-# GN target: //src/trace_processor/metrics:lib
+# GN target: //src/trace_processor/metrics:metrics
perfetto_filegroup(
- name = "src_trace_processor_metrics_lib",
+ name = "src_trace_processor_metrics_metrics",
srcs = [
"src/trace_processor/metrics/metrics.cc",
"src/trace_processor/metrics/metrics.h",
@@ -3680,7 +3680,7 @@
":src_trace_processor_importers_memory_tracker_graph_processor",
":src_trace_processor_lib",
":src_trace_processor_metatrace",
- ":src_trace_processor_metrics_lib",
+ ":src_trace_processor_metrics_metrics",
":src_trace_processor_sqlite_sqlite",
":src_trace_processor_storage_full",
":src_trace_processor_storage_minimal",
@@ -3749,7 +3749,7 @@
PERFETTO_CONFIG.deps.sqlite +
PERFETTO_CONFIG.deps.sqlite_ext_percentile +
PERFETTO_CONFIG.deps.zlib + [
- ":cc_merged_sql_metrics",
+ ":cc_amalgamated_sql_metrics",
],
linkstatic = True,
)
@@ -3779,7 +3779,7 @@
":src_trace_processor_importers_memory_tracker_graph_processor",
":src_trace_processor_lib",
":src_trace_processor_metatrace",
- ":src_trace_processor_metrics_lib",
+ ":src_trace_processor_metrics_metrics",
":src_trace_processor_rpc_httpd",
":src_trace_processor_rpc_rpc",
":src_trace_processor_sqlite_sqlite",
@@ -3846,7 +3846,7 @@
PERFETTO_CONFIG.deps.sqlite +
PERFETTO_CONFIG.deps.sqlite_ext_percentile +
PERFETTO_CONFIG.deps.zlib + [
- ":cc_merged_sql_metrics",
+ ":cc_amalgamated_sql_metrics",
],
)
@@ -3963,7 +3963,7 @@
":src_trace_processor_importers_memory_tracker_graph_processor",
":src_trace_processor_lib",
":src_trace_processor_metatrace",
- ":src_trace_processor_metrics_lib",
+ ":src_trace_processor_metrics_metrics",
":src_trace_processor_sqlite_sqlite",
":src_trace_processor_storage_full",
":src_trace_processor_storage_minimal",
@@ -4029,7 +4029,7 @@
PERFETTO_CONFIG.deps.sqlite +
PERFETTO_CONFIG.deps.sqlite_ext_percentile +
PERFETTO_CONFIG.deps.zlib + [
- ":cc_merged_sql_metrics",
+ ":cc_amalgamated_sql_metrics",
],
)
@@ -4046,16 +4046,16 @@
)
perfetto_cc_library(
- name = "cc_merged_sql_metrics",
- hdrs = ["src/trace_processor/metrics/sql_metrics.h"],
+ name = "cc_amalgamated_sql_metrics",
+ hdrs = ["src/trace_processor/metrics/sql/amalgamated_sql_metrics.h"],
)
perfetto_py_binary(
- name = "gen_merged_sql_metrics_py",
+ name = "gen_amalgamated_sql_metrics_py",
srcs = [
- "tools/gen_merged_sql_metrics.py",
+ "tools/gen_amalgamated_sql_metrics.py",
],
- main = "tools/gen_merged_sql_metrics.py",
+ main = "tools/gen_amalgamated_sql_metrics.py",
python_version = "PY3",
)
diff --git a/BUILD.extras b/BUILD.extras
index e546216..28bec08 100644
--- a/BUILD.extras
+++ b/BUILD.extras
@@ -9,16 +9,16 @@
)
perfetto_cc_library(
- name = "cc_merged_sql_metrics",
- hdrs = ["src/trace_processor/metrics/sql_metrics.h"],
+ name = "cc_amalgamated_sql_metrics",
+ hdrs = ["src/trace_processor/metrics/sql/amalgamated_sql_metrics.h"],
)
perfetto_py_binary(
- name = "gen_merged_sql_metrics_py",
+ name = "gen_amalgamated_sql_metrics_py",
srcs = [
- "tools/gen_merged_sql_metrics.py",
+ "tools/gen_amalgamated_sql_metrics.py",
],
- main = "tools/gen_merged_sql_metrics.py",
+ main = "tools/gen_amalgamated_sql_metrics.py",
python_version = "PY3",
)
diff --git a/src/trace_processor/BUILD.gn b/src/trace_processor/BUILD.gn
index d47e65a..db95047 100644
--- a/src/trace_processor/BUILD.gn
+++ b/src/trace_processor/BUILD.gn
@@ -337,7 +337,7 @@
"analysis",
"db",
"importers/common",
- "metrics:lib",
+ "metrics",
"sqlite",
"storage",
"tables",
@@ -365,7 +365,7 @@
"../../src/profiling/symbolizer",
"../../src/profiling/symbolizer:symbolize_database",
"../base",
- "metrics:lib",
+ "metrics",
"util",
]
if (enable_perfetto_trace_processor_linenoise) {
diff --git a/src/trace_processor/metrics/BUILD.gn b/src/trace_processor/metrics/BUILD.gn
index d9106a1..8731f78 100644
--- a/src/trace_processor/metrics/BUILD.gn
+++ b/src/trace_processor/metrics/BUILD.gn
@@ -13,159 +13,21 @@
# limitations under the License.
import("../../../gn/perfetto.gni")
+import("../../../gn/perfetto_cc_proto_descriptor.gni")
import("../../../gn/test.gni")
-sql_files = [
- "trace_metadata.sql",
- "trace_stats.sql",
- "android/android_batt.sql",
- "android/android_camera.sql",
- "android/android_cpu.sql",
- "android/android_surfaceflinger.sql",
- "android/android_cpu_agg.sql",
- "android/android_cpu_raw_metrics_per_core.sql",
- "android/android_dma_heap.sql",
- "android/android_fastrpc.sql",
- "android/android_gpu.sql",
- "android/android_hwui_threads.sql",
- "android/android_mem.sql",
- "android/android_mem_unagg.sql",
- "android/android_ion.sql",
- "android/composer_execution.sql",
- "android/composition_layers.sql",
- "android/frame_missed.sql",
- "android/android_jank.sql",
- "android/android_lmk_reason.sql",
- "android/android_lmk.sql",
- "android/android_powrails.sql",
- "android/android_proxy_power.sql",
- "android/android_simpleperf.sql",
- "android/android_startup.sql",
- "android/android_package_list.sql",
- "android/android_task_names.sql",
- "android/android_thread_time_in_state.sql",
- "android/android_trace_quality.sql",
- "android/cpu_info.sql",
- "android/display_metrics.sql",
- "android/g2d.sql",
- "android/g2d_duration.sql",
- "android/android_hwcomposer.sql",
- "android/android_hwui_metric.sql",
- "android/java_heap_histogram.sql",
- "android/java_heap_stats.sql",
- "android/power_drain_in_watts.sql",
- "android/power_profile_data.sql",
- "android/process_unagg_mem_view.sql",
- "android/process_mem.sql",
- "android/process_metadata.sql",
- "android/process_oom_score.sql",
- "android/profiler_smaps.sql",
- "android/mem_stats_priority_breakdown.sql",
- "android/android_multiuser.sql",
- "android/android_multiuser_populator.sql",
- "android/span_view_stats.sql",
- "android/android_sysui_cuj.sql",
- "android/android_sysui_cuj_jank_query.sql",
- "android/process_counter_span_view.sql",
- "android/global_counter_span_view.sql",
- "android/gpu_counter_span_view.sql",
- "android/thread_counter_span_view.sql",
- "android/unsymbolized_frames.sql",
- "android/startup/launches.sql",
- "android/startup/hsc.sql",
- "chrome/actual_power_by_category.sql",
- "chrome/actual_power_by_rail_mode.sql",
- "chrome/chrome_event_metadata.sql",
- "chrome/chrome_processes.sql",
- "chrome/chrome_thread_slice_with_cpu_time.sql",
- "chrome/cpu_time_by_category.sql",
- "chrome/cpu_time_by_rail_mode.sql",
- "chrome/estimated_power_by_category.sql",
- "chrome/estimated_power_by_rail_mode.sql",
- "chrome/gesture_jank.sql",
- "chrome/gesture_flow_event.sql",
- "chrome/gesture_flow_event_queuing_delay.sql",
- "chrome/rail_modes.sql",
- "chrome/scroll_jank.sql",
- "chrome/scroll_jank_cause.sql",
- "chrome/scroll_jank_cause_blocking_task.sql",
- "chrome/scroll_jank_cause_blocking_touch_move.sql",
- "chrome/scroll_jank_cause_get_bitmap.sql",
- "chrome/scroll_jank_cause_queuing_delay.sql",
- "chrome/scroll_flow_event.sql",
- "chrome/scroll_flow_event_queuing_delay.sql",
- "chrome/test_chrome_metric.sql",
- "chrome/touch_flow_event.sql",
- "chrome/touch_flow_event_queuing_delay.sql",
- "chrome/touch_jank.sql",
- "experimental/blink_gc_metric.sql",
- "experimental/chrome_dropped_frames.sql",
- "experimental/frame_times.sql",
- "experimental/media_metric.sql",
- "experimental/reported_by_page.sql",
- "webview/webview_power_usage.sql",
-]
-
-config("gen_config") {
- include_dirs = [ "${root_gen_dir}/${perfetto_root_path}" ]
-}
-
-action("gen_merged_sql_metrics") {
- script = "../../../tools/gen_merged_sql_metrics.py"
- generated_header = "${target_gen_dir}/sql_metrics.h"
- args = rebase_path(sql_files, root_build_dir) + [
- "--cpp_out",
- rebase_path(generated_header, root_build_dir),
- ]
- inputs = sql_files
- outputs = [ generated_header ]
- public_configs = [ ":gen_config" ]
-}
-
-action("gen_cc_metrics_descriptor") {
+perfetto_cc_proto_descriptor("gen_cc_metrics_descriptor") {
+ descriptor_name = "metrics.descriptor"
descriptor_target = "../../../protos/perfetto/metrics:descriptor"
- generated_header = "${target_gen_dir}/metrics.descriptor.h"
-
- descriptor_file_path = get_label_info(descriptor_target, "target_gen_dir") +
- "/metrics.descriptor"
-
- script = "../../../tools/gen_cc_proto_descriptor.py"
- deps = [ descriptor_target ]
- args = [
- "--gen_dir",
- rebase_path(root_gen_dir, root_build_dir),
- "--cpp_out",
- rebase_path(generated_header, root_build_dir),
- rebase_path(descriptor_file_path, root_build_dir),
- ]
- inputs = [ descriptor_file_path ]
- outputs = [ generated_header ]
- public_configs = [ ":gen_config" ]
}
-action("gen_cc_all_chrome_metrics_descriptor") {
+perfetto_cc_proto_descriptor("gen_cc_all_chrome_metrics_descriptor") {
+ descriptor_name = "all_chrome_metrics.descriptor"
descriptor_target = "../../../protos/perfetto/metrics/chrome:descriptor"
- generated_header = "${target_gen_dir}/chrome/all_chrome_metrics.descriptor.h"
-
- descriptor_file_path = get_label_info(descriptor_target, "target_gen_dir") +
- "/all_chrome_metrics.descriptor"
-
- script = "../../../tools/gen_cc_proto_descriptor.py"
- deps = [ descriptor_target ]
- args = [
- "--gen_dir",
- rebase_path(root_gen_dir, root_build_dir),
- "--cpp_out",
- rebase_path(generated_header, root_build_dir),
- rebase_path(descriptor_file_path, root_build_dir),
- ]
- inputs = [ descriptor_file_path ]
- outputs = [ generated_header ]
- public_configs = [ ":gen_config" ]
}
if (enable_perfetto_trace_processor_sqlite) {
- source_set("lib") {
+ source_set("metrics") {
sources = [
"metrics.cc",
"metrics.h",
@@ -184,9 +46,9 @@
public_deps = [
":gen_cc_all_chrome_metrics_descriptor",
":gen_cc_metrics_descriptor",
- ":gen_merged_sql_metrics",
"../util",
"../util:descriptors",
+ "sql:gen_amalgamated_sql_metrics",
]
}
@@ -194,7 +56,7 @@
testonly = true
sources = [ "metrics_unittest.cc" ]
deps = [
- ":lib",
+ ":metrics",
"..:lib",
"../../../gn:default_deps",
"../../../gn:gtest_and_gmock",
diff --git a/src/trace_processor/metrics/metrics.cc b/src/trace_processor/metrics/metrics.cc
index 3bfff9b..6926cff 100644
--- a/src/trace_processor/metrics/metrics.cc
+++ b/src/trace_processor/metrics/metrics.cc
@@ -24,7 +24,6 @@
#include "perfetto/ext/base/string_utils.h"
#include "perfetto/ext/base/utils.h"
#include "perfetto/protozero/scattered_heap_buffer.h"
-#include "src/trace_processor/metrics/sql_metrics.h"
#include "src/trace_processor/sqlite/sqlite_utils.h"
#include "src/trace_processor/tp_metatrace.h"
#include "src/trace_processor/util/status_macros.h"
diff --git a/src/trace_processor/metrics/protos/README.md b/src/trace_processor/metrics/protos/README.md
new file mode 100644
index 0000000..8b6ab1a
--- /dev/null
+++ b/src/trace_processor/metrics/protos/README.md
@@ -0,0 +1,11 @@
+This empty folder exists to harmonize "built-in" metrics
+work with the "metric extension" functionality of trace processor.
+
+Essentially by adding a protos folder, we can pass
+src/trace_processor/metrics as an extension path to shell to
+override all built-in metrics. This means we can change the SQL
+files *without* needing to recompile trace processor.
+
+In the future, we might also move the protos here but that would
+be a bigger change which would need coordination across repos (
+e.g. Chrome because of the metrics autoroller for Chrome metrics).
diff --git a/src/trace_processor/metrics/sql/BUILD.gn b/src/trace_processor/metrics/sql/BUILD.gn
new file mode 100644
index 0000000..2759d24
--- /dev/null
+++ b/src/trace_processor/metrics/sql/BUILD.gn
@@ -0,0 +1,122 @@
+# Copyright (C) 2021 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+import("../../../../gn/perfetto.gni")
+
+sql_files = [
+ "trace_metadata.sql",
+ "trace_stats.sql",
+ "android/android_batt.sql",
+ "android/android_camera.sql",
+ "android/android_cpu.sql",
+ "android/android_surfaceflinger.sql",
+ "android/android_cpu_agg.sql",
+ "android/android_cpu_raw_metrics_per_core.sql",
+ "android/android_dma_heap.sql",
+ "android/android_fastrpc.sql",
+ "android/android_gpu.sql",
+ "android/android_hwui_threads.sql",
+ "android/android_mem.sql",
+ "android/android_mem_unagg.sql",
+ "android/android_ion.sql",
+ "android/composer_execution.sql",
+ "android/composition_layers.sql",
+ "android/frame_missed.sql",
+ "android/android_jank.sql",
+ "android/android_lmk_reason.sql",
+ "android/android_lmk.sql",
+ "android/android_powrails.sql",
+ "android/android_proxy_power.sql",
+ "android/android_simpleperf.sql",
+ "android/android_startup.sql",
+ "android/android_package_list.sql",
+ "android/android_task_names.sql",
+ "android/android_thread_time_in_state.sql",
+ "android/android_trace_quality.sql",
+ "android/cpu_info.sql",
+ "android/display_metrics.sql",
+ "android/g2d.sql",
+ "android/g2d_duration.sql",
+ "android/android_hwcomposer.sql",
+ "android/android_hwui_metric.sql",
+ "android/java_heap_histogram.sql",
+ "android/java_heap_stats.sql",
+ "android/power_drain_in_watts.sql",
+ "android/power_profile_data.sql",
+ "android/process_unagg_mem_view.sql",
+ "android/process_mem.sql",
+ "android/process_metadata.sql",
+ "android/process_oom_score.sql",
+ "android/profiler_smaps.sql",
+ "android/mem_stats_priority_breakdown.sql",
+ "android/android_multiuser.sql",
+ "android/android_multiuser_populator.sql",
+ "android/span_view_stats.sql",
+ "android/android_sysui_cuj.sql",
+ "android/android_sysui_cuj_jank_query.sql",
+ "android/process_counter_span_view.sql",
+ "android/global_counter_span_view.sql",
+ "android/gpu_counter_span_view.sql",
+ "android/thread_counter_span_view.sql",
+ "android/unsymbolized_frames.sql",
+ "android/startup/launches.sql",
+ "android/startup/hsc.sql",
+ "chrome/actual_power_by_category.sql",
+ "chrome/actual_power_by_rail_mode.sql",
+ "chrome/chrome_event_metadata.sql",
+ "chrome/chrome_processes.sql",
+ "chrome/chrome_thread_slice_with_cpu_time.sql",
+ "chrome/cpu_time_by_category.sql",
+ "chrome/cpu_time_by_rail_mode.sql",
+ "chrome/estimated_power_by_category.sql",
+ "chrome/estimated_power_by_rail_mode.sql",
+ "chrome/gesture_jank.sql",
+ "chrome/gesture_flow_event.sql",
+ "chrome/gesture_flow_event_queuing_delay.sql",
+ "chrome/rail_modes.sql",
+ "chrome/scroll_jank.sql",
+ "chrome/scroll_jank_cause.sql",
+ "chrome/scroll_jank_cause_blocking_task.sql",
+ "chrome/scroll_jank_cause_blocking_touch_move.sql",
+ "chrome/scroll_jank_cause_get_bitmap.sql",
+ "chrome/scroll_jank_cause_queuing_delay.sql",
+ "chrome/scroll_flow_event.sql",
+ "chrome/scroll_flow_event_queuing_delay.sql",
+ "chrome/test_chrome_metric.sql",
+ "chrome/touch_flow_event.sql",
+ "chrome/touch_flow_event_queuing_delay.sql",
+ "chrome/touch_jank.sql",
+ "experimental/blink_gc_metric.sql",
+ "experimental/chrome_dropped_frames.sql",
+ "experimental/frame_times.sql",
+ "experimental/media_metric.sql",
+ "experimental/reported_by_page.sql",
+ "webview/webview_power_usage.sql",
+]
+
+config("gen_config") {
+ include_dirs = [ "${root_gen_dir}/${perfetto_root_path}" ]
+}
+
+action("gen_amalgamated_sql_metrics") {
+ script = "../../../../tools/gen_amalgamated_sql_metrics.py"
+ generated_header = "${target_gen_dir}/amalgamated_sql_metrics.h"
+ args = rebase_path(sql_files, root_build_dir) + [
+ "--cpp_out",
+ rebase_path(generated_header, root_build_dir),
+ ]
+ inputs = sql_files
+ outputs = [ generated_header ]
+ public_configs = [ ":gen_config" ]
+}
diff --git a/src/trace_processor/metrics/android/OWNERS b/src/trace_processor/metrics/sql/android/OWNERS
similarity index 100%
rename from src/trace_processor/metrics/android/OWNERS
rename to src/trace_processor/metrics/sql/android/OWNERS
diff --git a/src/trace_processor/metrics/android/android_batt.sql b/src/trace_processor/metrics/sql/android/android_batt.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_batt.sql
rename to src/trace_processor/metrics/sql/android/android_batt.sql
diff --git a/src/trace_processor/metrics/android/android_camera.sql b/src/trace_processor/metrics/sql/android/android_camera.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_camera.sql
rename to src/trace_processor/metrics/sql/android/android_camera.sql
diff --git a/src/trace_processor/metrics/android/android_cpu.sql b/src/trace_processor/metrics/sql/android/android_cpu.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_cpu.sql
rename to src/trace_processor/metrics/sql/android/android_cpu.sql
diff --git a/src/trace_processor/metrics/android/android_cpu_agg.sql b/src/trace_processor/metrics/sql/android/android_cpu_agg.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_cpu_agg.sql
rename to src/trace_processor/metrics/sql/android/android_cpu_agg.sql
diff --git a/src/trace_processor/metrics/android/android_cpu_raw_metrics_per_core.sql b/src/trace_processor/metrics/sql/android/android_cpu_raw_metrics_per_core.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_cpu_raw_metrics_per_core.sql
rename to src/trace_processor/metrics/sql/android/android_cpu_raw_metrics_per_core.sql
diff --git a/src/trace_processor/metrics/android/android_dma_heap.sql b/src/trace_processor/metrics/sql/android/android_dma_heap.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_dma_heap.sql
rename to src/trace_processor/metrics/sql/android/android_dma_heap.sql
diff --git a/src/trace_processor/metrics/android/android_fastrpc.sql b/src/trace_processor/metrics/sql/android/android_fastrpc.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_fastrpc.sql
rename to src/trace_processor/metrics/sql/android/android_fastrpc.sql
diff --git a/src/trace_processor/metrics/android/android_gpu.sql b/src/trace_processor/metrics/sql/android/android_gpu.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_gpu.sql
rename to src/trace_processor/metrics/sql/android/android_gpu.sql
diff --git a/src/trace_processor/metrics/android/android_hwcomposer.sql b/src/trace_processor/metrics/sql/android/android_hwcomposer.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_hwcomposer.sql
rename to src/trace_processor/metrics/sql/android/android_hwcomposer.sql
diff --git a/src/trace_processor/metrics/android/android_hwui_metric.sql b/src/trace_processor/metrics/sql/android/android_hwui_metric.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_hwui_metric.sql
rename to src/trace_processor/metrics/sql/android/android_hwui_metric.sql
diff --git a/src/trace_processor/metrics/android/android_hwui_threads.sql b/src/trace_processor/metrics/sql/android/android_hwui_threads.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_hwui_threads.sql
rename to src/trace_processor/metrics/sql/android/android_hwui_threads.sql
diff --git a/src/trace_processor/metrics/android/android_ion.sql b/src/trace_processor/metrics/sql/android/android_ion.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_ion.sql
rename to src/trace_processor/metrics/sql/android/android_ion.sql
diff --git a/src/trace_processor/metrics/android/android_jank.sql b/src/trace_processor/metrics/sql/android/android_jank.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_jank.sql
rename to src/trace_processor/metrics/sql/android/android_jank.sql
diff --git a/src/trace_processor/metrics/android/android_lmk.sql b/src/trace_processor/metrics/sql/android/android_lmk.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_lmk.sql
rename to src/trace_processor/metrics/sql/android/android_lmk.sql
diff --git a/src/trace_processor/metrics/android/android_lmk_reason.sql b/src/trace_processor/metrics/sql/android/android_lmk_reason.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_lmk_reason.sql
rename to src/trace_processor/metrics/sql/android/android_lmk_reason.sql
diff --git a/src/trace_processor/metrics/android/android_mem.sql b/src/trace_processor/metrics/sql/android/android_mem.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_mem.sql
rename to src/trace_processor/metrics/sql/android/android_mem.sql
diff --git a/src/trace_processor/metrics/android/android_mem_unagg.sql b/src/trace_processor/metrics/sql/android/android_mem_unagg.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_mem_unagg.sql
rename to src/trace_processor/metrics/sql/android/android_mem_unagg.sql
diff --git a/src/trace_processor/metrics/android/android_multiuser.sql b/src/trace_processor/metrics/sql/android/android_multiuser.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_multiuser.sql
rename to src/trace_processor/metrics/sql/android/android_multiuser.sql
diff --git a/src/trace_processor/metrics/android/android_multiuser_populator.sql b/src/trace_processor/metrics/sql/android/android_multiuser_populator.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_multiuser_populator.sql
rename to src/trace_processor/metrics/sql/android/android_multiuser_populator.sql
diff --git a/src/trace_processor/metrics/android/android_package_list.sql b/src/trace_processor/metrics/sql/android/android_package_list.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_package_list.sql
rename to src/trace_processor/metrics/sql/android/android_package_list.sql
diff --git a/src/trace_processor/metrics/android/android_powrails.sql b/src/trace_processor/metrics/sql/android/android_powrails.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_powrails.sql
rename to src/trace_processor/metrics/sql/android/android_powrails.sql
diff --git a/src/trace_processor/metrics/android/android_proxy_power.sql b/src/trace_processor/metrics/sql/android/android_proxy_power.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_proxy_power.sql
rename to src/trace_processor/metrics/sql/android/android_proxy_power.sql
diff --git a/src/trace_processor/metrics/android/android_simpleperf.sql b/src/trace_processor/metrics/sql/android/android_simpleperf.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_simpleperf.sql
rename to src/trace_processor/metrics/sql/android/android_simpleperf.sql
diff --git a/src/trace_processor/metrics/android/android_startup.sql b/src/trace_processor/metrics/sql/android/android_startup.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_startup.sql
rename to src/trace_processor/metrics/sql/android/android_startup.sql
diff --git a/src/trace_processor/metrics/android/android_surfaceflinger.sql b/src/trace_processor/metrics/sql/android/android_surfaceflinger.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_surfaceflinger.sql
rename to src/trace_processor/metrics/sql/android/android_surfaceflinger.sql
diff --git a/src/trace_processor/metrics/android/android_sysui_cuj.sql b/src/trace_processor/metrics/sql/android/android_sysui_cuj.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_sysui_cuj.sql
rename to src/trace_processor/metrics/sql/android/android_sysui_cuj.sql
diff --git a/src/trace_processor/metrics/android/android_sysui_cuj_jank_query.sql b/src/trace_processor/metrics/sql/android/android_sysui_cuj_jank_query.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_sysui_cuj_jank_query.sql
rename to src/trace_processor/metrics/sql/android/android_sysui_cuj_jank_query.sql
diff --git a/src/trace_processor/metrics/android/android_task_names.sql b/src/trace_processor/metrics/sql/android/android_task_names.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_task_names.sql
rename to src/trace_processor/metrics/sql/android/android_task_names.sql
diff --git a/src/trace_processor/metrics/android/android_thread_time_in_state.sql b/src/trace_processor/metrics/sql/android/android_thread_time_in_state.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_thread_time_in_state.sql
rename to src/trace_processor/metrics/sql/android/android_thread_time_in_state.sql
diff --git a/src/trace_processor/metrics/android/android_trace_quality.sql b/src/trace_processor/metrics/sql/android/android_trace_quality.sql
similarity index 100%
rename from src/trace_processor/metrics/android/android_trace_quality.sql
rename to src/trace_processor/metrics/sql/android/android_trace_quality.sql
diff --git a/src/trace_processor/metrics/android/composer_execution.sql b/src/trace_processor/metrics/sql/android/composer_execution.sql
similarity index 100%
rename from src/trace_processor/metrics/android/composer_execution.sql
rename to src/trace_processor/metrics/sql/android/composer_execution.sql
diff --git a/src/trace_processor/metrics/android/composition_layers.sql b/src/trace_processor/metrics/sql/android/composition_layers.sql
similarity index 100%
rename from src/trace_processor/metrics/android/composition_layers.sql
rename to src/trace_processor/metrics/sql/android/composition_layers.sql
diff --git a/src/trace_processor/metrics/android/cpu_info.sql b/src/trace_processor/metrics/sql/android/cpu_info.sql
similarity index 100%
rename from src/trace_processor/metrics/android/cpu_info.sql
rename to src/trace_processor/metrics/sql/android/cpu_info.sql
diff --git a/src/trace_processor/metrics/android/display_metrics.sql b/src/trace_processor/metrics/sql/android/display_metrics.sql
similarity index 100%
rename from src/trace_processor/metrics/android/display_metrics.sql
rename to src/trace_processor/metrics/sql/android/display_metrics.sql
diff --git a/src/trace_processor/metrics/android/frame_missed.sql b/src/trace_processor/metrics/sql/android/frame_missed.sql
similarity index 100%
rename from src/trace_processor/metrics/android/frame_missed.sql
rename to src/trace_processor/metrics/sql/android/frame_missed.sql
diff --git a/src/trace_processor/metrics/android/g2d.sql b/src/trace_processor/metrics/sql/android/g2d.sql
similarity index 100%
rename from src/trace_processor/metrics/android/g2d.sql
rename to src/trace_processor/metrics/sql/android/g2d.sql
diff --git a/src/trace_processor/metrics/android/g2d_duration.sql b/src/trace_processor/metrics/sql/android/g2d_duration.sql
similarity index 100%
rename from src/trace_processor/metrics/android/g2d_duration.sql
rename to src/trace_processor/metrics/sql/android/g2d_duration.sql
diff --git a/src/trace_processor/metrics/android/global_counter_span_view.sql b/src/trace_processor/metrics/sql/android/global_counter_span_view.sql
similarity index 100%
rename from src/trace_processor/metrics/android/global_counter_span_view.sql
rename to src/trace_processor/metrics/sql/android/global_counter_span_view.sql
diff --git a/src/trace_processor/metrics/android/gpu_counter_span_view.sql b/src/trace_processor/metrics/sql/android/gpu_counter_span_view.sql
similarity index 100%
rename from src/trace_processor/metrics/android/gpu_counter_span_view.sql
rename to src/trace_processor/metrics/sql/android/gpu_counter_span_view.sql
diff --git a/src/trace_processor/metrics/android/java_heap_histogram.sql b/src/trace_processor/metrics/sql/android/java_heap_histogram.sql
similarity index 100%
rename from src/trace_processor/metrics/android/java_heap_histogram.sql
rename to src/trace_processor/metrics/sql/android/java_heap_histogram.sql
diff --git a/src/trace_processor/metrics/android/java_heap_stats.sql b/src/trace_processor/metrics/sql/android/java_heap_stats.sql
similarity index 100%
rename from src/trace_processor/metrics/android/java_heap_stats.sql
rename to src/trace_processor/metrics/sql/android/java_heap_stats.sql
diff --git a/src/trace_processor/metrics/android/mem_stats_priority_breakdown.sql b/src/trace_processor/metrics/sql/android/mem_stats_priority_breakdown.sql
similarity index 100%
rename from src/trace_processor/metrics/android/mem_stats_priority_breakdown.sql
rename to src/trace_processor/metrics/sql/android/mem_stats_priority_breakdown.sql
diff --git a/src/trace_processor/metrics/android/power_drain_in_watts.sql b/src/trace_processor/metrics/sql/android/power_drain_in_watts.sql
similarity index 100%
rename from src/trace_processor/metrics/android/power_drain_in_watts.sql
rename to src/trace_processor/metrics/sql/android/power_drain_in_watts.sql
diff --git a/src/trace_processor/metrics/android/power_profile_data.sql b/src/trace_processor/metrics/sql/android/power_profile_data.sql
similarity index 100%
rename from src/trace_processor/metrics/android/power_profile_data.sql
rename to src/trace_processor/metrics/sql/android/power_profile_data.sql
diff --git a/src/trace_processor/metrics/android/process_counter_span_view.sql b/src/trace_processor/metrics/sql/android/process_counter_span_view.sql
similarity index 100%
rename from src/trace_processor/metrics/android/process_counter_span_view.sql
rename to src/trace_processor/metrics/sql/android/process_counter_span_view.sql
diff --git a/src/trace_processor/metrics/android/process_mem.sql b/src/trace_processor/metrics/sql/android/process_mem.sql
similarity index 100%
rename from src/trace_processor/metrics/android/process_mem.sql
rename to src/trace_processor/metrics/sql/android/process_mem.sql
diff --git a/src/trace_processor/metrics/android/process_metadata.sql b/src/trace_processor/metrics/sql/android/process_metadata.sql
similarity index 100%
rename from src/trace_processor/metrics/android/process_metadata.sql
rename to src/trace_processor/metrics/sql/android/process_metadata.sql
diff --git a/src/trace_processor/metrics/android/process_oom_score.sql b/src/trace_processor/metrics/sql/android/process_oom_score.sql
similarity index 100%
rename from src/trace_processor/metrics/android/process_oom_score.sql
rename to src/trace_processor/metrics/sql/android/process_oom_score.sql
diff --git a/src/trace_processor/metrics/android/process_unagg_mem_view.sql b/src/trace_processor/metrics/sql/android/process_unagg_mem_view.sql
similarity index 100%
rename from src/trace_processor/metrics/android/process_unagg_mem_view.sql
rename to src/trace_processor/metrics/sql/android/process_unagg_mem_view.sql
diff --git a/src/trace_processor/metrics/android/profiler_smaps.sql b/src/trace_processor/metrics/sql/android/profiler_smaps.sql
similarity index 100%
rename from src/trace_processor/metrics/android/profiler_smaps.sql
rename to src/trace_processor/metrics/sql/android/profiler_smaps.sql
diff --git a/src/trace_processor/metrics/android/span_view_stats.sql b/src/trace_processor/metrics/sql/android/span_view_stats.sql
similarity index 100%
rename from src/trace_processor/metrics/android/span_view_stats.sql
rename to src/trace_processor/metrics/sql/android/span_view_stats.sql
diff --git a/src/trace_processor/metrics/android/startup/hsc.sql b/src/trace_processor/metrics/sql/android/startup/hsc.sql
similarity index 100%
rename from src/trace_processor/metrics/android/startup/hsc.sql
rename to src/trace_processor/metrics/sql/android/startup/hsc.sql
diff --git a/src/trace_processor/metrics/android/startup/launches.sql b/src/trace_processor/metrics/sql/android/startup/launches.sql
similarity index 100%
rename from src/trace_processor/metrics/android/startup/launches.sql
rename to src/trace_processor/metrics/sql/android/startup/launches.sql
diff --git a/src/trace_processor/metrics/android/thread_counter_span_view.sql b/src/trace_processor/metrics/sql/android/thread_counter_span_view.sql
similarity index 100%
rename from src/trace_processor/metrics/android/thread_counter_span_view.sql
rename to src/trace_processor/metrics/sql/android/thread_counter_span_view.sql
diff --git a/src/trace_processor/metrics/android/unsymbolized_frames.sql b/src/trace_processor/metrics/sql/android/unsymbolized_frames.sql
similarity index 100%
rename from src/trace_processor/metrics/android/unsymbolized_frames.sql
rename to src/trace_processor/metrics/sql/android/unsymbolized_frames.sql
diff --git a/src/trace_processor/metrics/chrome/OWNERS b/src/trace_processor/metrics/sql/chrome/OWNERS
similarity index 100%
rename from src/trace_processor/metrics/chrome/OWNERS
rename to src/trace_processor/metrics/sql/chrome/OWNERS
diff --git a/src/trace_processor/metrics/chrome/actual_power_by_category.sql b/src/trace_processor/metrics/sql/chrome/actual_power_by_category.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/actual_power_by_category.sql
rename to src/trace_processor/metrics/sql/chrome/actual_power_by_category.sql
diff --git a/src/trace_processor/metrics/chrome/actual_power_by_rail_mode.sql b/src/trace_processor/metrics/sql/chrome/actual_power_by_rail_mode.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/actual_power_by_rail_mode.sql
rename to src/trace_processor/metrics/sql/chrome/actual_power_by_rail_mode.sql
diff --git a/src/trace_processor/metrics/chrome/chrome_event_metadata.sql b/src/trace_processor/metrics/sql/chrome/chrome_event_metadata.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/chrome_event_metadata.sql
rename to src/trace_processor/metrics/sql/chrome/chrome_event_metadata.sql
diff --git a/src/trace_processor/metrics/chrome/chrome_processes.sql b/src/trace_processor/metrics/sql/chrome/chrome_processes.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/chrome_processes.sql
rename to src/trace_processor/metrics/sql/chrome/chrome_processes.sql
diff --git a/src/trace_processor/metrics/chrome/chrome_thread_slice_with_cpu_time.sql b/src/trace_processor/metrics/sql/chrome/chrome_thread_slice_with_cpu_time.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/chrome_thread_slice_with_cpu_time.sql
rename to src/trace_processor/metrics/sql/chrome/chrome_thread_slice_with_cpu_time.sql
diff --git a/src/trace_processor/metrics/chrome/cpu_time_by_category.sql b/src/trace_processor/metrics/sql/chrome/cpu_time_by_category.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/cpu_time_by_category.sql
rename to src/trace_processor/metrics/sql/chrome/cpu_time_by_category.sql
diff --git a/src/trace_processor/metrics/chrome/cpu_time_by_rail_mode.sql b/src/trace_processor/metrics/sql/chrome/cpu_time_by_rail_mode.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/cpu_time_by_rail_mode.sql
rename to src/trace_processor/metrics/sql/chrome/cpu_time_by_rail_mode.sql
diff --git a/src/trace_processor/metrics/chrome/estimated_power_by_category.sql b/src/trace_processor/metrics/sql/chrome/estimated_power_by_category.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/estimated_power_by_category.sql
rename to src/trace_processor/metrics/sql/chrome/estimated_power_by_category.sql
diff --git a/src/trace_processor/metrics/chrome/estimated_power_by_rail_mode.sql b/src/trace_processor/metrics/sql/chrome/estimated_power_by_rail_mode.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/estimated_power_by_rail_mode.sql
rename to src/trace_processor/metrics/sql/chrome/estimated_power_by_rail_mode.sql
diff --git a/src/trace_processor/metrics/chrome/gesture_flow_event.sql b/src/trace_processor/metrics/sql/chrome/gesture_flow_event.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/gesture_flow_event.sql
rename to src/trace_processor/metrics/sql/chrome/gesture_flow_event.sql
diff --git a/src/trace_processor/metrics/chrome/gesture_flow_event_queuing_delay.sql b/src/trace_processor/metrics/sql/chrome/gesture_flow_event_queuing_delay.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/gesture_flow_event_queuing_delay.sql
rename to src/trace_processor/metrics/sql/chrome/gesture_flow_event_queuing_delay.sql
diff --git a/src/trace_processor/metrics/chrome/gesture_jank.sql b/src/trace_processor/metrics/sql/chrome/gesture_jank.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/gesture_jank.sql
rename to src/trace_processor/metrics/sql/chrome/gesture_jank.sql
diff --git a/src/trace_processor/metrics/chrome/rail_modes.sql b/src/trace_processor/metrics/sql/chrome/rail_modes.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/rail_modes.sql
rename to src/trace_processor/metrics/sql/chrome/rail_modes.sql
diff --git a/src/trace_processor/metrics/chrome/scroll_flow_event.sql b/src/trace_processor/metrics/sql/chrome/scroll_flow_event.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/scroll_flow_event.sql
rename to src/trace_processor/metrics/sql/chrome/scroll_flow_event.sql
diff --git a/src/trace_processor/metrics/chrome/scroll_flow_event_queuing_delay.sql b/src/trace_processor/metrics/sql/chrome/scroll_flow_event_queuing_delay.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/scroll_flow_event_queuing_delay.sql
rename to src/trace_processor/metrics/sql/chrome/scroll_flow_event_queuing_delay.sql
diff --git a/src/trace_processor/metrics/chrome/scroll_jank.sql b/src/trace_processor/metrics/sql/chrome/scroll_jank.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/scroll_jank.sql
rename to src/trace_processor/metrics/sql/chrome/scroll_jank.sql
diff --git a/src/trace_processor/metrics/chrome/scroll_jank_cause.sql b/src/trace_processor/metrics/sql/chrome/scroll_jank_cause.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/scroll_jank_cause.sql
rename to src/trace_processor/metrics/sql/chrome/scroll_jank_cause.sql
diff --git a/src/trace_processor/metrics/chrome/scroll_jank_cause_blocking_task.sql b/src/trace_processor/metrics/sql/chrome/scroll_jank_cause_blocking_task.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/scroll_jank_cause_blocking_task.sql
rename to src/trace_processor/metrics/sql/chrome/scroll_jank_cause_blocking_task.sql
diff --git a/src/trace_processor/metrics/chrome/scroll_jank_cause_blocking_touch_move.sql b/src/trace_processor/metrics/sql/chrome/scroll_jank_cause_blocking_touch_move.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/scroll_jank_cause_blocking_touch_move.sql
rename to src/trace_processor/metrics/sql/chrome/scroll_jank_cause_blocking_touch_move.sql
diff --git a/src/trace_processor/metrics/chrome/scroll_jank_cause_get_bitmap.sql b/src/trace_processor/metrics/sql/chrome/scroll_jank_cause_get_bitmap.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/scroll_jank_cause_get_bitmap.sql
rename to src/trace_processor/metrics/sql/chrome/scroll_jank_cause_get_bitmap.sql
diff --git a/src/trace_processor/metrics/chrome/scroll_jank_cause_queuing_delay.sql b/src/trace_processor/metrics/sql/chrome/scroll_jank_cause_queuing_delay.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/scroll_jank_cause_queuing_delay.sql
rename to src/trace_processor/metrics/sql/chrome/scroll_jank_cause_queuing_delay.sql
diff --git a/src/trace_processor/metrics/chrome/test_chrome_metric.sql b/src/trace_processor/metrics/sql/chrome/test_chrome_metric.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/test_chrome_metric.sql
rename to src/trace_processor/metrics/sql/chrome/test_chrome_metric.sql
diff --git a/src/trace_processor/metrics/chrome/touch_flow_event.sql b/src/trace_processor/metrics/sql/chrome/touch_flow_event.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/touch_flow_event.sql
rename to src/trace_processor/metrics/sql/chrome/touch_flow_event.sql
diff --git a/src/trace_processor/metrics/chrome/touch_flow_event_queuing_delay.sql b/src/trace_processor/metrics/sql/chrome/touch_flow_event_queuing_delay.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/touch_flow_event_queuing_delay.sql
rename to src/trace_processor/metrics/sql/chrome/touch_flow_event_queuing_delay.sql
diff --git a/src/trace_processor/metrics/chrome/touch_jank.sql b/src/trace_processor/metrics/sql/chrome/touch_jank.sql
similarity index 100%
rename from src/trace_processor/metrics/chrome/touch_jank.sql
rename to src/trace_processor/metrics/sql/chrome/touch_jank.sql
diff --git a/src/trace_processor/metrics/experimental/OWNERS b/src/trace_processor/metrics/sql/experimental/OWNERS
similarity index 100%
rename from src/trace_processor/metrics/experimental/OWNERS
rename to src/trace_processor/metrics/sql/experimental/OWNERS
diff --git a/src/trace_processor/metrics/experimental/blink_gc_metric.sql b/src/trace_processor/metrics/sql/experimental/blink_gc_metric.sql
similarity index 100%
rename from src/trace_processor/metrics/experimental/blink_gc_metric.sql
rename to src/trace_processor/metrics/sql/experimental/blink_gc_metric.sql
diff --git a/src/trace_processor/metrics/experimental/chrome_dropped_frames.sql b/src/trace_processor/metrics/sql/experimental/chrome_dropped_frames.sql
similarity index 100%
rename from src/trace_processor/metrics/experimental/chrome_dropped_frames.sql
rename to src/trace_processor/metrics/sql/experimental/chrome_dropped_frames.sql
diff --git a/src/trace_processor/metrics/experimental/frame_times.sql b/src/trace_processor/metrics/sql/experimental/frame_times.sql
similarity index 100%
rename from src/trace_processor/metrics/experimental/frame_times.sql
rename to src/trace_processor/metrics/sql/experimental/frame_times.sql
diff --git a/src/trace_processor/metrics/experimental/media_metric.sql b/src/trace_processor/metrics/sql/experimental/media_metric.sql
similarity index 100%
rename from src/trace_processor/metrics/experimental/media_metric.sql
rename to src/trace_processor/metrics/sql/experimental/media_metric.sql
diff --git a/src/trace_processor/metrics/experimental/reported_by_page.sql b/src/trace_processor/metrics/sql/experimental/reported_by_page.sql
similarity index 100%
rename from src/trace_processor/metrics/experimental/reported_by_page.sql
rename to src/trace_processor/metrics/sql/experimental/reported_by_page.sql
diff --git a/src/trace_processor/metrics/trace_metadata.sql b/src/trace_processor/metrics/sql/trace_metadata.sql
similarity index 100%
rename from src/trace_processor/metrics/trace_metadata.sql
rename to src/trace_processor/metrics/sql/trace_metadata.sql
diff --git a/src/trace_processor/metrics/trace_stats.sql b/src/trace_processor/metrics/sql/trace_stats.sql
similarity index 100%
rename from src/trace_processor/metrics/trace_stats.sql
rename to src/trace_processor/metrics/sql/trace_stats.sql
diff --git a/src/trace_processor/metrics/webview/webview_power_usage.sql b/src/trace_processor/metrics/sql/webview/webview_power_usage.sql
similarity index 100%
rename from src/trace_processor/metrics/webview/webview_power_usage.sql
rename to src/trace_processor/metrics/sql/webview/webview_power_usage.sql
diff --git a/src/trace_processor/trace_processor_impl.cc b/src/trace_processor/trace_processor_impl.cc
index f942406..9f265ec 100644
--- a/src/trace_processor/trace_processor_impl.cc
+++ b/src/trace_processor/trace_processor_impl.cc
@@ -65,10 +65,10 @@
#include "protos/perfetto/trace/trace.pbzero.h"
#include "protos/perfetto/trace/trace_packet.pbzero.h"
-#include "src/trace_processor/metrics/chrome/all_chrome_metrics.descriptor.h"
+#include "src/trace_processor/metrics/all_chrome_metrics.descriptor.h"
#include "src/trace_processor/metrics/metrics.descriptor.h"
#include "src/trace_processor/metrics/metrics.h"
-#include "src/trace_processor/metrics/sql_metrics.h"
+#include "src/trace_processor/metrics/sql/amalgamated_sql_metrics.h"
#if !PERFETTO_BUILDFLAG(PERFETTO_OS_WIN)
#include <cxxabi.h>
diff --git a/src/trace_processor/trace_processor_shell.cc b/src/trace_processor/trace_processor_shell.cc
index 5454b7e..3fe3486 100644
--- a/src/trace_processor/trace_processor_shell.cc
+++ b/src/trace_processor/trace_processor_shell.cc
@@ -42,7 +42,7 @@
#include "perfetto/trace_processor/read_trace.h"
#include "perfetto/trace_processor/trace_processor.h"
-#include "src/trace_processor/metrics/chrome/all_chrome_metrics.descriptor.h"
+#include "src/trace_processor/metrics/all_chrome_metrics.descriptor.h"
#include "src/trace_processor/metrics/metrics.descriptor.h"
#include "src/trace_processor/metrics/metrics.h"
#include "src/trace_processor/util/proto_to_json.h"
diff --git a/tools/gen_merged_sql_metrics.py b/tools/gen_amalgamated_sql_metrics.py
similarity index 100%
rename from tools/gen_merged_sql_metrics.py
rename to tools/gen_amalgamated_sql_metrics.py
diff --git a/tools/gen_android_bp b/tools/gen_android_bp
index 53dfbc0..af7d95d 100755
--- a/tools/gen_android_bp
+++ b/tools/gen_android_bp
@@ -744,14 +744,14 @@
return source_module
-def create_merged_sql_metrics_module(blueprint, target):
+def create_amalgamated_sql_metrics_module(blueprint, target):
bp_module_name = label_to_module_name(target.name)
module = Module('genrule', bp_module_name, target.name)
module.tool_files = [
- 'tools/gen_merged_sql_metrics.py',
+ 'tools/gen_amalgamated_sql_metrics.py',
]
module.cmd = ' '.join([
- '$(location tools/gen_merged_sql_metrics.py)',
+ '$(location tools/gen_amalgamated_sql_metrics.py)',
'--cpp_out=$(out)',
'$(in)',
])
@@ -843,8 +843,8 @@
if module is None:
return None
elif target.type == 'action':
- if 'gen_merged_sql_metrics' in target.name:
- module = create_merged_sql_metrics_module(blueprint, target)
+ if 'gen_amalgamated_sql_metrics' in target.name:
+ module = create_amalgamated_sql_metrics_module(blueprint, target)
elif re.match('.*gen_cc_.*_descriptor$', name_without_toolchain):
module = create_cc_proto_descriptor_module(blueprint, target)
elif target.type == 'action' and \
diff --git a/tools/gen_bazel b/tools/gen_bazel
index 3a1b8ae..73b4e45 100755
--- a/tools/gen_bazel
+++ b/tools/gen_bazel
@@ -108,19 +108,19 @@
'PERFETTO_CONFIG.deps.sqlite_ext_percentile'
],
'//gn:zlib': ['PERFETTO_CONFIG.deps.zlib'],
- '//src/trace_processor/metrics:gen_merged_sql_metrics': [[
- ':cc_merged_sql_metrics'
+ '//src/trace_processor/metrics/sql:gen_amalgamated_sql_metrics': [[
+ ':cc_amalgamated_sql_metrics'
]],
gn_utils.GEN_VERSION_TARGET: ['PERFETTO_CONFIG.deps.version_header'],
}
-def gen_sql_metrics(target):
+def gen_amalgamated_sql_metrics(target):
label = BazelLabel(get_bazel_label_name(target.name), 'perfetto_genrule')
label.srcs += [re.sub('^//', '', x) for x in sorted(target.inputs)]
label.outs += target.outputs
- label.cmd = r'$(location gen_merged_sql_metrics_py) --cpp_out=$@ $(SRCS)'
- label.exec_tools += [':gen_merged_sql_metrics_py']
+ label.cmd = r'$(location gen_amalgamated_sql_metrics_py) --cpp_out=$@ $(SRCS)'
+ label.exec_tools += [':gen_amalgamated_sql_metrics_py']
return [label]
@@ -144,7 +144,8 @@
custom_actions = {
gn_utils.GEN_VERSION_TARGET: gen_version_header,
- '//src/trace_processor/metrics:gen_merged_sql_metrics': gen_sql_metrics,
+ '//src/trace_processor/metrics/sql:gen_amalgamated_sql_metrics':
+ gen_amalgamated_sql_metrics,
}
# ------------------------------------------------------------------------------