metrics: Move Wattson metric to stdlib for reusability
Move Wattson power estimate metric to Perfetto stdlib so that the code
can be re-used.
There are many use-cases for getting estimates from a trace, and the
only difference is the particular time window of interest. Leave the
time window calculation to be metric SQL file specific, but move the
generic estimation and hierarchy breakdown to stdlib.
Test: tools/diff_test_trace_processor.py out/linux/trace_processor_shell --name-filter '.*wattson.*'
Bug: 352627297
Change-Id: I2d974faa4b65d5b3c28fc6706805a3019ec76ff0
Signed-off-by: Samuel Wu <wusamuel@google.com>
diff --git a/Android.bp b/Android.bp
index 021e268..1144fdf 100644
--- a/Android.bp
+++ b/Android.bp
@@ -12959,6 +12959,7 @@
"src/trace_processor/metrics/sql/android/sysui_update_notif_on_ui_mode_changed_metric.sql",
"src/trace_processor/metrics/sql/android/unsymbolized_frames.sql",
"src/trace_processor/metrics/sql/android/wattson_app_startup.sql",
+ "src/trace_processor/metrics/sql/android/wattson_rail_relations.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_args_class_names.sql",