tp: migrate chrome metrics descriptor generation to build time
This is required because Chrome protos extend the TraceMetrics proto so
the descriptor pulls in all the Perfetto ones.
Change-Id: I7b724f2ff77b001663be45858b4dcfd91944f436
diff --git a/Android.bp b/Android.bp
index 18258df..ac4d38a 100644
--- a/Android.bp
+++ b/Android.bp
@@ -14,83 +14,6 @@
//
// This file is automatically generated by tools/gen_android_bp. Do not edit.
-// GN: //src/trace_processor/metrics:gen_cc_metrics_descriptor
-genrule {
- name: "gen_cc_metrics_descriptor",
- srcs: [
- ":perfetto_protos_perfetto_metrics_descriptor",
- ],
- cmd: "$(location tools/gen_cc_proto_descriptor.py) --gen_dir=$(genDir) --cpp_out=$(out) $(in)",
- out: [
- "src/trace_processor/metrics/metrics.descriptor.h",
- ],
- tool_files: [
- "tools/gen_cc_proto_descriptor.py",
- ],
-}
-
-// GN: //src/trace_processor/metrics:gen_merged_sql_metrics
-genrule {
- name: "gen_merged_sql_metrics",
- srcs: [
- "src/trace_processor/metrics/android/android_batt.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_gpu.sql",
- "src/trace_processor/metrics/android/android_hwui_metric.sql",
- "src/trace_processor/metrics/android/android_ion.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_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_startup.sql",
- "src/trace_processor/metrics/android/android_startup_launches.sql",
- "src/trace_processor/metrics/android/android_surfaceflinger.sql",
- "src/trace_processor/metrics/android/android_task_names.sql",
- "src/trace_processor/metrics/android/android_task_state.sql",
- "src/trace_processor/metrics/android/android_thread_time_in_state.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/global_counter_span_view.sql",
- "src/trace_processor/metrics/android/heap_profile_callsites.sql",
- "src/trace_processor/metrics/android/hsc_startups.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_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/span_view_stats.sql",
- "src/trace_processor/metrics/android/unsymbolized_frames.sql",
- "src/trace_processor/metrics/chrome/chrome_processes.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_queuing_delay.sql",
- "src/trace_processor/metrics/chrome/test_chrome_metric.sql",
- "src/trace_processor/metrics/trace_metadata.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",
- ],
-}
-
// GN: //src/profiling/memory:heapprofd
cc_binary {
name: "heapprofd",
@@ -3332,6 +3255,21 @@
],
}
+// GN: //protos/perfetto/metrics/chrome:descriptor
+genrule {
+ name: "perfetto_protos_perfetto_metrics_chrome_descriptor",
+ srcs: [
+ "protos/perfetto/metrics/chrome/all_chrome_metrics.proto",
+ ],
+ tools: [
+ "aprotoc",
+ ],
+ cmd: "mkdir -p $(genDir)/external/perfetto/ && $(location aprotoc) --proto_path=external/perfetto --proto_path=external/protobuf/src --descriptor_set_out=$(out) --include_imports $(in)",
+ out: [
+ "perfetto_protos_perfetto_metrics_chrome_descriptor.bin",
+ ],
+}
+
// GN: //protos/perfetto/metrics:descriptor
genrule {
name: "perfetto_protos_perfetto_metrics_descriptor",
@@ -6884,6 +6822,98 @@
],
}
+// GN: //src/trace_processor/metrics:gen_cc_all_chrome_metrics_descriptor
+genrule {
+ name: "perfetto_src_trace_processor_metrics_gen_cc_all_chrome_metrics_descriptor",
+ srcs: [
+ ":perfetto_protos_perfetto_metrics_chrome_descriptor",
+ ],
+ 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",
+ ],
+ tool_files: [
+ "tools/gen_cc_proto_descriptor.py",
+ ],
+}
+
+// GN: //src/trace_processor/metrics:gen_cc_metrics_descriptor
+genrule {
+ name: "perfetto_src_trace_processor_metrics_gen_cc_metrics_descriptor",
+ srcs: [
+ ":perfetto_protos_perfetto_metrics_descriptor",
+ ],
+ cmd: "$(location tools/gen_cc_proto_descriptor.py) --gen_dir=$(genDir) --cpp_out=$(out) $(in)",
+ out: [
+ "src/trace_processor/metrics/metrics.descriptor.h",
+ ],
+ tool_files: [
+ "tools/gen_cc_proto_descriptor.py",
+ ],
+}
+
+// GN: //src/trace_processor/metrics:gen_merged_sql_metrics
+genrule {
+ name: "perfetto_src_trace_processor_metrics_gen_merged_sql_metrics",
+ srcs: [
+ "src/trace_processor/metrics/android/android_batt.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_gpu.sql",
+ "src/trace_processor/metrics/android/android_hwui_metric.sql",
+ "src/trace_processor/metrics/android/android_ion.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_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_startup.sql",
+ "src/trace_processor/metrics/android/android_startup_launches.sql",
+ "src/trace_processor/metrics/android/android_surfaceflinger.sql",
+ "src/trace_processor/metrics/android/android_task_names.sql",
+ "src/trace_processor/metrics/android/android_task_state.sql",
+ "src/trace_processor/metrics/android/android_thread_time_in_state.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/global_counter_span_view.sql",
+ "src/trace_processor/metrics/android/heap_profile_callsites.sql",
+ "src/trace_processor/metrics/android/hsc_startups.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_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/span_view_stats.sql",
+ "src/trace_processor/metrics/android/unsymbolized_frames.sql",
+ "src/trace_processor/metrics/chrome/chrome_processes.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_queuing_delay.sql",
+ "src/trace_processor/metrics/chrome/test_chrome_metric.sql",
+ "src/trace_processor/metrics/trace_metadata.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",
+ ],
+}
+
// GN: //src/trace_processor/metrics:lib
filegroup {
name: "perfetto_src_trace_processor_metrics_lib",
@@ -8089,8 +8119,6 @@
"perfetto_gtest_logcat_printer",
],
generated_headers: [
- "gen_cc_metrics_descriptor",
- "gen_merged_sql_metrics",
"perfetto_protos_perfetto_common_cpp_gen_headers",
"perfetto_protos_perfetto_common_zero_gen_headers",
"perfetto_protos_perfetto_config_android_cpp_gen_headers",
@@ -8154,6 +8182,9 @@
"perfetto_src_protozero_testing_messages_cpp_gen_headers",
"perfetto_src_protozero_testing_messages_lite_gen_headers",
"perfetto_src_protozero_testing_messages_zero_gen_headers",
+ "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_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",
@@ -8285,8 +8316,6 @@
"libz",
],
generated_headers: [
- "gen_cc_metrics_descriptor",
- "gen_merged_sql_metrics",
"perfetto_protos_perfetto_common_zero_gen_headers",
"perfetto_protos_perfetto_config_android_zero_gen_headers",
"perfetto_protos_perfetto_config_ftrace_zero_gen_headers",
@@ -8315,6 +8344,9 @@
"perfetto_protos_perfetto_trace_sys_stats_zero_gen_headers",
"perfetto_protos_perfetto_trace_system_info_zero_gen_headers",
"perfetto_protos_perfetto_trace_track_event_zero_gen_headers",
+ "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",
],
defaults: [
"perfetto_defaults",
@@ -8406,8 +8438,6 @@
"libz",
],
generated_headers: [
- "gen_cc_metrics_descriptor",
- "gen_merged_sql_metrics",
"perfetto_protos_perfetto_common_zero_gen_headers",
"perfetto_protos_perfetto_config_android_zero_gen_headers",
"perfetto_protos_perfetto_config_ftrace_zero_gen_headers",
@@ -8437,6 +8467,9 @@
"perfetto_protos_perfetto_trace_system_info_zero_gen_headers",
"perfetto_protos_perfetto_trace_track_event_zero_gen_headers",
"perfetto_protos_third_party_pprof_zero_gen_headers",
+ "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",
],
defaults: [
"perfetto_defaults",