trace_processor: implement first android mem metric!
We fill the LMK field for now: more metrics will be filled in following
CLs.
Context: go/perfetto-metrics
Bug: 129747127
Change-Id: If3d7de375e16bbfd15a8b19bda05d3162ae30308
diff --git a/BUILD b/BUILD
index 502d219..bf70a25 100644
--- a/BUILD
+++ b/BUILD
@@ -20,6 +20,21 @@
exports_files(["LICENSE"])
+# GN target: //src/trace_processor/metrics:gen_merged_sql_metrics
+genrule(
+ name = "gen_merged_sql_metrics",
+ srcs = [
+ "src/trace_processor/metrics/android/android_mem.sql",
+ ],
+ cmd = "$(location gen_merged_sql_metrics_py) --cpp_out=$@ $SRCS",
+ outs = [
+ "src/trace_processor/metrics/sql_metrics.h",
+ ],
+ tools = [
+ "gen_merged_sql_metrics_py",
+ ],
+)
+
# GN target: //src/protozero:libprotozero
cc_library(
name = "libprotozero",
@@ -286,10 +301,13 @@
"include/perfetto/traced/sys_stats_counters.h",
],
deps = [
+ "//third_party/perfetto:gen_merged_sql_metrics",
"//third_party/perfetto/google:gtest_prod",
"//third_party/perfetto/google:jsoncpp",
"//third_party/perfetto/protos:common_zero_cc_proto",
"//third_party/perfetto/protos:config_zero_cc_proto",
+ "//third_party/perfetto/protos:metrics_android_zero_cc_proto",
+ "//third_party/perfetto/protos:metrics_zero_cc_proto",
"//third_party/perfetto/protos:trace_android_zero_cc_proto",
"//third_party/perfetto/protos:trace_chrome_zero_cc_proto",
"//third_party/perfetto/protos:trace_filesystem_zero_cc_proto",
@@ -482,12 +500,15 @@
"src/trace_processor/window_operator_table.h",
],
deps = [
+ "//third_party/perfetto:gen_merged_sql_metrics",
"//third_party/perfetto/google:gtest_prod",
"//third_party/perfetto/google:jsoncpp",
"//third_party/perfetto/google:linenoise",
"//third_party/perfetto/google:perfetto_version",
"//third_party/perfetto/protos:common_zero_cc_proto",
"//third_party/perfetto/protos:config_zero_cc_proto",
+ "//third_party/perfetto/protos:metrics_android_zero_cc_proto",
+ "//third_party/perfetto/protos:metrics_zero_cc_proto",
"//third_party/perfetto/protos:trace_android_zero_cc_proto",
"//third_party/perfetto/protos:trace_chrome_zero_cc_proto",
"//third_party/perfetto/protos:trace_filesystem_zero_cc_proto",
@@ -690,6 +711,7 @@
"tools/trace_to_text/utils.h",
],
deps = [
+ "//third_party/perfetto:gen_merged_sql_metrics",
"//third_party/perfetto/google:gtest_prod",
"//third_party/perfetto/google:jsoncpp",
"//third_party/perfetto/google:perfetto_version",
@@ -697,6 +719,8 @@
"//third_party/perfetto/protos:common_zero_cc_proto",
"//third_party/perfetto/protos:config_cc_proto",
"//third_party/perfetto/protos:config_zero_cc_proto",
+ "//third_party/perfetto/protos:metrics_android_zero_cc_proto",
+ "//third_party/perfetto/protos:metrics_zero_cc_proto",
"//third_party/perfetto/protos:protos_third_party_pprof_cc_proto",
"//third_party/perfetto/protos:trace_android_cc_proto",
"//third_party/perfetto/protos:trace_android_zero_cc_proto",
@@ -741,3 +765,10 @@
":trace_to_text",
],
)
+
+py_binary(
+ name = "gen_merged_sql_metrics_py"
+ srcs = [
+ "tools/gen_merged_sql_metrics"
+ ]
+)