metrics: Refactor RAIL Mode power queries
Adds a templated _by_category metric for each of the existing ones and
convert the corresponding rail mode query to use it.
Also fixes modified_rail_slices query to add an id column so that it's
consumable by the by_category metrics.
Bug: 173002394
Change-Id: Iec70f40bf05b64a82d9d388e15e087e878fafff0
diff --git a/BUILD b/BUILD
index cd7447d..3c723f5 100644
--- a/BUILD
+++ b/BUILD
@@ -822,10 +822,13 @@
"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/actual_power_by_category.sql",
"src/trace_processor/metrics/chrome/actual_power_by_rail_mode.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/rail_modes.sql",
"src/trace_processor/metrics/chrome/scroll_flow_event.sql",