Add a Launcher Cold Start metric to AndroidBootMetric
Bug: 305271555
Bug: 299342732
Test: <trace_processor_shell> --run-metrics android_boot <trace>
Test: tools/diff_test_trace_processor.py <trace_processor_shell> --name-filter='.*android_boot*'
Change-Id: I83243046dd2e2ef6513293fc8ab181d5c86b1432
diff --git a/protos/perfetto/metrics/android/android_boot.proto b/protos/perfetto/metrics/android/android_boot.proto
index 820b4e0..53de221 100644
--- a/protos/perfetto/metrics/android/android_boot.proto
+++ b/protos/perfetto/metrics/android/android_boot.proto
@@ -29,4 +29,10 @@
optional ProcessStateDurations systemui_durations = 2;
optional ProcessStateDurations launcher_durations = 3;
optional ProcessStateDurations gms_durations = 4;
+ // Launcher related boot metrics
+ message LauncherBreakdown {
+ // reports cold start time of NexusLauncher
+ optional int64 cold_start_dur = 1;
+ }
+ optional LauncherBreakdown launcher_breakdown = 5;
}
diff --git a/protos/perfetto/metrics/perfetto_merged_metrics.proto b/protos/perfetto/metrics/perfetto_merged_metrics.proto
index 3f270f6..d072a39 100644
--- a/protos/perfetto/metrics/perfetto_merged_metrics.proto
+++ b/protos/perfetto/metrics/perfetto_merged_metrics.proto
@@ -143,6 +143,12 @@
optional ProcessStateDurations systemui_durations = 2;
optional ProcessStateDurations launcher_durations = 3;
optional ProcessStateDurations gms_durations = 4;
+ // Launcher related boot metrics
+ message LauncherBreakdown {
+ // reports cold start time of NexusLauncher
+ optional int64 cold_start_dur = 1;
+ }
+ optional LauncherBreakdown launcher_breakdown = 5;
}
// End of protos/perfetto/metrics/android/android_boot.proto
diff --git a/python/perfetto/trace_processor/metrics.descriptor b/python/perfetto/trace_processor/metrics.descriptor
index 7af1fde..d62f1fd 100644
--- a/python/perfetto/trace_processor/metrics.descriptor
+++ b/python/perfetto/trace_processor/metrics.descriptor
Binary files differ
diff --git a/src/trace_processor/metrics/sql/android/android_boot.sql b/src/trace_processor/metrics/sql/android/android_boot.sql
index 46caea8..4dc8936 100644
--- a/src/trace_processor/metrics/sql/android/android_boot.sql
+++ b/src/trace_processor/metrics/sql/android/android_boot.sql
@@ -47,5 +47,9 @@
SELECT NULL_IF_EMPTY(ProcessStateDurations(
'total_dur', total_dur,
'uninterruptible_sleep_dur', uint_sleep_dur))
- FROM get_durations('com.google.android.gms.persistent'))
+ FROM get_durations('com.google.android.gms.persistent')),
+ 'launcher_breakdown', (
+ SELECT NULL_IF_EMPTY(AndroidBootMetric_LauncherBreakdown(
+ 'cold_start_dur', dur))
+ FROM slice where name="LauncherColdStartup")
);