tp: flag when dex2oat/installd are running during app start
Bug: 234546650
Change-Id: I8c2bcefd175cc8214b63bea7fcc78cdabeba88b2
diff --git a/Android.bp b/Android.bp
index 448e0d3..1062505 100644
--- a/Android.bp
+++ b/Android.bp
@@ -8606,6 +8606,7 @@
"src/trace_processor/metrics/sql/android/startup/launches_minsdk33.sql",
"src/trace_processor/metrics/sql/android/startup/mcycles_per_launch.sql",
"src/trace_processor/metrics/sql/android/startup/slice_functions.sql",
+ "src/trace_processor/metrics/sql/android/startup/system_state.sql",
"src/trace_processor/metrics/sql/android/startup/thread_state_breakdown.sql",
"src/trace_processor/metrics/sql/android/unsymbolized_frames.sql",
"src/trace_processor/metrics/sql/chrome/actual_power_by_category.sql",
diff --git a/BUILD b/BUILD
index d293f71..59abc9b 100644
--- a/BUILD
+++ b/BUILD
@@ -1199,6 +1199,7 @@
"src/trace_processor/metrics/sql/android/startup/launches_minsdk33.sql",
"src/trace_processor/metrics/sql/android/startup/mcycles_per_launch.sql",
"src/trace_processor/metrics/sql/android/startup/slice_functions.sql",
+ "src/trace_processor/metrics/sql/android/startup/system_state.sql",
"src/trace_processor/metrics/sql/android/startup/thread_state_breakdown.sql",
"src/trace_processor/metrics/sql/android/unsymbolized_frames.sql",
"src/trace_processor/metrics/sql/chrome/actual_power_by_category.sql",
diff --git a/protos/perfetto/metrics/android/startup_metric.proto b/protos/perfetto/metrics/android/startup_metric.proto
index a52e36c..8ab0a49 100644
--- a/protos/perfetto/metrics/android/startup_metric.proto
+++ b/protos/perfetto/metrics/android/startup_metric.proto
@@ -174,7 +174,17 @@
optional int64 first_frame = 2;
}
- // Next id: 15
+ // Contains information about the state of a system during the app startup.
+ // Useful to put the startup in context.
+ message SystemState {
+ // Whether the dex2oat64 process was running concurrent to the startup.
+ optional bool dex2oat_running = 1;
+
+ // Whether the installd process was running concurrent to the startup.
+ optional bool installd_running = 2;
+ }
+
+ // Next id: 16
message Startup {
// Random id uniquely identifying an app startup in this trace.
optional uint32 startup_id = 1;
@@ -221,9 +231,14 @@
// first frame as the application decides this after it starts rendering.
optional Slice report_fully_drawn = 9;
- // Conntains information about the status of odex files.
+ // Contains information about the status of odex files.
repeated OptimizationStatus optimization_status = 12;
+ // Contains information about the state of the rest of the system during the
+ // startup. This is useful for getting context about why a startup might
+ // be slow beyond just what the app is doing.
+ optional SystemState system_state = 15;
+
reserved 10;
}
diff --git a/protos/perfetto/metrics/perfetto_merged_metrics.proto b/protos/perfetto/metrics/perfetto_merged_metrics.proto
index 58571a9..9049459 100644
--- a/protos/perfetto/metrics/perfetto_merged_metrics.proto
+++ b/protos/perfetto/metrics/perfetto_merged_metrics.proto
@@ -1374,7 +1374,17 @@
optional int64 first_frame = 2;
}
- // Next id: 15
+ // Contains information about the state of a system during the app startup.
+ // Useful to put the startup in context.
+ message SystemState {
+ // Whether the dex2oat64 process was running concurrent to the startup.
+ optional bool dex2oat_running = 1;
+
+ // Whether the installd process was running concurrent to the startup.
+ optional bool installd_running = 2;
+ }
+
+ // Next id: 16
message Startup {
// Random id uniquely identifying an app startup in this trace.
optional uint32 startup_id = 1;
@@ -1421,9 +1431,14 @@
// first frame as the application decides this after it starts rendering.
optional Slice report_fully_drawn = 9;
- // Conntains information about the status of odex files.
+ // Contains information about the status of odex files.
repeated OptimizationStatus optimization_status = 12;
+ // Contains information about the state of the rest of the system during the
+ // startup. This is useful for getting context about why a startup might
+ // be slow beyond just what the app is doing.
+ optional SystemState system_state = 15;
+
reserved 10;
}
diff --git a/python/perfetto/trace_processor/metrics.descriptor b/python/perfetto/trace_processor/metrics.descriptor
index 85358ba..7ee0f2f 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/BUILD.gn b/src/trace_processor/metrics/sql/BUILD.gn
index faadbdd..7390425 100644
--- a/src/trace_processor/metrics/sql/BUILD.gn
+++ b/src/trace_processor/metrics/sql/BUILD.gn
@@ -14,80 +14,80 @@
import("../../../../gn/perfetto.gni")
+# Keep this list sorted.
sql_files = [
- "trace_metadata.sql",
- "trace_stats.sql",
"android/android_batt.sql",
"android/android_binder.sql",
- "android/android_camera.sql",
"android/android_camera_unagg.sql",
- "android/android_cpu.sql",
- "android/android_surfaceflinger.sql",
+ "android/android_camera.sql",
"android/android_cpu_agg.sql",
"android/android_cpu_raw_metrics_per_core.sql",
+ "android/android_cpu.sql",
"android/android_dma_heap.sql",
"android/android_dvfs.sql",
"android/android_fastrpc.sql",
+ "android/android_frame_timeline_metric.sql",
"android/android_gpu.sql",
+ "android/android_hwcomposer.sql",
+ "android/android_hwui_metric.sql",
"android/android_hwui_threads.sql",
- "android/android_mem.sql",
- "android/android_mem_unagg.sql",
- "android/android_netperf.sql",
"android/android_ion.sql",
- "android/composer_execution.sql",
- "android/composition_layers.sql",
- "android/frame_missed.sql",
+ "android/android_irq_runtime.sql",
"android/android_jank.sql",
"android/android_lmk_reason.sql",
"android/android_lmk.sql",
+ "android/android_mem_unagg.sql",
+ "android/android_mem.sql",
+ "android/android_multiuser_populator.sql",
+ "android/android_multiuser.sql",
+ "android/android_netperf.sql",
"android/android_other_traces.sql",
+ "android/android_package_list.sql",
"android/android_powrails.sql",
"android/android_proxy_power.sql",
+ "android/android_rt_runtime.sql",
"android/android_simpleperf.sql",
"android/android_startup.sql",
- "android/android_package_list.sql",
+ "android/android_surfaceflinger.sql",
+ "android/android_sysui_cuj_jank_query.sql",
+ "android/android_sysui_cuj_surfaceflinger.sql",
+ "android/android_sysui_cuj.sql",
"android/android_task_names.sql",
"android/android_trace_quality.sql",
+ "android/android_trusty_workqueues.sql",
+ "android/composer_execution.sql",
+ "android/composition_layers.sql",
"android/cpu_info.sql",
"android/display_metrics.sql",
- "android/g2d.sql",
+ "android/frame_missed.sql",
"android/g2d_duration.sql",
- "android/android_hwcomposer.sql",
- "android/android_hwui_metric.sql",
+ "android/g2d.sql",
+ "android/global_counter_span_view.sql",
+ "android/gpu_counter_span_view.sql",
"android/java_heap_histogram.sql",
"android/java_heap_stats.sql",
+ "android/mem_stats_priority_breakdown.sql",
"android/power_drain_in_watts.sql",
"android/power_profile_data.sql",
- "android/process_unagg_mem_view.sql",
+ "android/process_counter_span_view.sql",
+ "android/process_counter_span_view.sql",
"android/process_mem.sql",
"android/process_metadata.sql",
"android/process_oom_score.sql",
+ "android/process_unagg_mem_view.sql",
"android/profiler_smaps.sql",
- "android/android_frame_timeline_metric.sql",
- "android/android_rt_runtime.sql",
- "android/android_irq_runtime.sql",
- "android/mem_stats_priority_breakdown.sql",
- "android/android_multiuser.sql",
- "android/android_multiuser_populator.sql",
"android/span_view_stats.sql",
- "android/android_sysui_cuj.sql",
- "android/android_sysui_cuj_surfaceflinger.sql",
- "android/android_sysui_cuj_jank_query.sql",
- "android/process_counter_span_view.sql",
- "android/global_counter_span_view.sql",
- "android/gpu_counter_span_view.sql",
- "android/process_counter_span_view.sql",
- "android/android_trusty_workqueues.sql",
- "android/unsymbolized_frames.sql",
+ "android/startup/gc_slices.sql",
+ "android/startup/hsc.sql",
"android/startup/launches_maxsdk28.sql",
"android/startup/launches_minsdk29.sql",
"android/startup/launches_minsdk33.sql",
"android/startup/launches.sql",
- "android/startup/hsc.sql",
- "android/startup/gc_slices.sql",
"android/startup/mcycles_per_launch.sql",
"android/startup/slice_functions.sql",
+ "android/startup/system_state.sql",
"android/startup/thread_state_breakdown.sql",
+ "android/unsymbolized_frames.sql",
"chrome/actual_power_by_category.sql",
"chrome/actual_power_by_rail_mode.sql",
"chrome/chrome_event_metadata.sql",
@@ -102,23 +102,23 @@
"chrome/cpu_time_by_rail_mode.sql",
"chrome/estimated_power_by_category.sql",
"chrome/estimated_power_by_rail_mode.sql",
- "chrome/sufficient_chrome_processes.sql",
+ "chrome/gesture_flow_event_queuing_delay.sql",
+ "chrome/gesture_flow_event.sql",
"chrome/gesture_jank.sql",
"chrome/jank_utilities.sql",
- "chrome/gesture_flow_event.sql",
- "chrome/gesture_flow_event_queuing_delay.sql",
"chrome/rail_modes.sql",
- "chrome/scroll_jank.sql",
- "chrome/scroll_jank_cause.sql",
+ "chrome/scroll_flow_event_queuing_delay.sql",
+ "chrome/scroll_flow_event.sql",
"chrome/scroll_jank_cause_blocking_task.sql",
"chrome/scroll_jank_cause_blocking_touch_move.sql",
"chrome/scroll_jank_cause_get_bitmap.sql",
"chrome/scroll_jank_cause_queuing_delay.sql",
- "chrome/scroll_flow_event.sql",
- "chrome/scroll_flow_event_queuing_delay.sql",
+ "chrome/scroll_jank_cause.sql",
+ "chrome/scroll_jank.sql",
+ "chrome/sufficient_chrome_processes.sql",
"chrome/test_chrome_metric.sql",
- "chrome/touch_flow_event.sql",
"chrome/touch_flow_event_queuing_delay.sql",
+ "chrome/touch_flow_event.sql",
"chrome/touch_jank.sql",
"experimental/blink_gc_metric.sql",
"experimental/chrome_dropped_frames.sql",
@@ -126,6 +126,8 @@
"experimental/frame_times.sql",
"experimental/media_metric.sql",
"experimental/reported_by_page.sql",
+ "trace_metadata.sql",
+ "trace_stats.sql",
"webview/webview_power_usage.sql",
]
diff --git a/src/trace_processor/metrics/sql/android/android_startup.sql b/src/trace_processor/metrics/sql/android/android_startup.sql
index eb2dd7a..bb2a345 100644
--- a/src/trace_processor/metrics/sql/android/android_startup.sql
+++ b/src/trace_processor/metrics/sql/android/android_startup.sql
@@ -35,6 +35,9 @@
-- Define helper functions for GC slices.
SELECT RUN_METRIC('android/startup/gc_slices.sql');
+-- Define helper functions for system state.
+SELECT RUN_METRIC('android/startup/system_state.sql');
+
-- Define process metadata functions.
SELECT RUN_METRIC('android/process_metadata.sql');
@@ -279,7 +282,13 @@
)
ORDER BY slice_name
)
- )
+ ),
+ 'system_state', NULL_IF_EMPTY(AndroidStartupMetric_SystemState(
+ 'dex2oat_running',
+ IS_PROCESS_RUNNING_CONCURRENT_TO_LAUNCH(launches.id, '*dex2oat64'),
+ 'installd_running',
+ IS_PROCESS_RUNNING_CONCURRENT_TO_LAUNCH(launches.id, '*installd')
+ ))
) as startup
FROM launches;
diff --git a/src/trace_processor/metrics/sql/android/startup/system_state.sql b/src/trace_processor/metrics/sql/android/startup/system_state.sql
new file mode 100644
index 0000000..ead6f69
--- /dev/null
+++ b/src/trace_processor/metrics/sql/android/startup/system_state.sql
@@ -0,0 +1,42 @@
+--
+-- Copyright 2022 The Android Open Source Project
+--
+-- Licensed under the Apache License, Version 2.0 (the "License");
+-- you may not use this file except in compliance with the License.
+-- You may obtain a copy of the License at
+--
+-- https://www.apache.org/licenses/LICENSE-2.0
+--
+-- Unless required by applicable law or agreed to in writing, software
+-- distributed under the License is distributed on an "AS IS" BASIS,
+-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+-- See the License for the specific language governing permissions and
+-- limitations under the License.
+--
+
+-- Functions useful for filling the SystemState proto which gives
+-- context to what was happening on the system during a startup.
+
+-- Given a launch id and process name glob, returns whether a process with
+-- that name was running on a CPU concurrent to that launch.
+SELECT CREATE_FUNCTION(
+ 'IS_PROCESS_RUNNING_CONCURRENT_TO_LAUNCH(launch_id INT, process_glob STRING)',
+ 'BOOL',
+ '
+ SELECT EXISTS(
+ SELECT sched.dur
+ FROM sched
+ JOIN thread USING (utid)
+ JOIN process USING (upid)
+ JOIN (
+ SELECT ts, ts_end
+ FROM launches
+ WHERE id = $launch_id
+ ) launch
+ WHERE
+ process.name GLOB $process_glob AND
+ sched.ts BETWEEN launch.ts AND launch.ts_end
+ LIMIT 1
+ )
+ '
+);
diff --git a/test/trace_processor/startup/android_startup.out b/test/trace_processor/startup/android_startup.out
index bbb5d45..040d196 100644
--- a/test/trace_processor/startup/android_startup.out
+++ b/test/trace_processor/startup/android_startup.out
@@ -3,22 +3,7 @@
startup_id: 2
package_name: "com.google.android.calendar"
process_name: "com.google.android.calendar"
- process: {
- name: "com.google.android.calendar"
- uid: 10001
- package {
- package_name: "com.google.android.calendar"
- apk_version_code: 123
- debuggable: false
- }
- packages_for_uid {
- package_name: "com.google.android.calendar"
- apk_version_code: 123
- debuggable: false
- }
- }
zygote_new_process: false
- activity_hosting_process_count: 1
to_first_frame {
dur_ns: 108
main_thread_by_task_state {
@@ -38,6 +23,21 @@
}
dur_ms: 0.000108
}
+ activity_hosting_process_count: 1
+ process {
+ name: "com.google.android.calendar"
+ uid: 10001
+ package {
+ package_name: "com.google.android.calendar"
+ apk_version_code: 123
+ debuggable: false
+ }
+ packages_for_uid {
+ package_name: "com.google.android.calendar"
+ apk_version_code: 123
+ debuggable: false
+ }
+ }
report_fully_drawn {
dur_ns: 198
dur_ms: 0.000198
@@ -46,5 +46,9 @@
intent_received: 102
first_frame: 210
}
+ system_state {
+ dex2oat_running: false
+ installd_running: false
+ }
}
}
diff --git a/test/trace_processor/startup/android_startup_attribution.out b/test/trace_processor/startup/android_startup_attribution.out
index 8d18b5e..c19ec17 100644
--- a/test/trace_processor/startup/android_startup_attribution.out
+++ b/test/trace_processor/startup/android_startup_attribution.out
@@ -55,7 +55,7 @@
long_binder_transactions {
duration {
dur_ns: 100000000
- dur_ms: 100
+ dur_ms: 100.0
}
thread: "Binder"
destination_process: "system_server"
@@ -65,7 +65,7 @@
long_binder_transactions {
duration {
dur_ns: 200000000
- dur_ms: 200
+ dur_ms: 200.0
}
thread: "fonts"
destination_thread: "Binder"
@@ -73,5 +73,9 @@
flags: "0x00 No Flags Set"
code: "0x00 Java Layer Dependent"
}
+ system_state {
+ dex2oat_running: false
+ installd_running: false
+ }
}
}
diff --git a/test/trace_processor/startup/android_startup_breakdown.out b/test/trace_processor/startup/android_startup_breakdown.out
index cebd9d0..51e7856 100644
--- a/test/trace_processor/startup/android_startup_breakdown.out
+++ b/test/trace_processor/startup/android_startup_breakdown.out
@@ -15,32 +15,32 @@
other_processes_spawned_count: 0
time_activity_manager {
dur_ns: 8000000000
- dur_ms: 8000
+ dur_ms: 8000.0
}
time_bind_application {
dur_ns: 9000000000
- dur_ms: 9000
+ dur_ms: 9000.0
}
time_before_start_process {
dur_ns: 18000000000
- dur_ms: 18000
+ dur_ms: 18000.0
}
time_during_start_process {
dur_ns: 35000000000
- dur_ms: 35000
+ dur_ms: 35000.0
}
- dur_ms: 108000
+ dur_ms: 108000.0
to_bind_application {
dur_ns: 83000000000
- dur_ms: 83000
+ dur_ms: 83000.0
}
time_inflate {
dur_ns: 3000000000
- dur_ms: 3000
+ dur_ms: 3000.0
}
time_get_resources {
dur_ns: 1000000000
- dur_ms: 1000
+ dur_ms: 1000.0
}
mcycles_by_core_type {
unknown: 103
@@ -71,5 +71,9 @@
intent_received: 102000000000
first_frame: 210000000000
}
+ system_state {
+ dex2oat_running: false
+ installd_running: false
+ }
}
}
diff --git a/test/trace_processor/startup/android_startup_installd_dex2oat.out b/test/trace_processor/startup/android_startup_installd_dex2oat.out
new file mode 100644
index 0000000..19eded0
--- /dev/null
+++ b/test/trace_processor/startup/android_startup_installd_dex2oat.out
@@ -0,0 +1,102 @@
+android_startup {
+ startup {
+ startup_id: 1
+ package_name: "com.google.android.calendar"
+ zygote_new_process: false
+ to_first_frame {
+ dur_ns: 100
+ main_thread_by_task_state {
+ running_dur_ns: 0
+ runnable_dur_ns: 0
+ uninterruptible_sleep_dur_ns: 0
+ interruptible_sleep_dur_ns: 0
+ }
+ other_processes_spawned_count: 0
+ dur_ms: 0.0001
+ }
+ activity_hosting_process_count: 0
+ event_timestamps {
+ intent_received: 100
+ first_frame: 200
+ }
+ system_state {
+ dex2oat_running: false
+ installd_running: false
+ }
+ }
+ startup {
+ startup_id: 2
+ package_name: "com.google.android.calculator"
+ zygote_new_process: false
+ to_first_frame {
+ dur_ns: 100
+ main_thread_by_task_state {
+ running_dur_ns: 0
+ runnable_dur_ns: 0
+ uninterruptible_sleep_dur_ns: 0
+ interruptible_sleep_dur_ns: 0
+ }
+ other_processes_spawned_count: 0
+ dur_ms: 0.0001
+ }
+ activity_hosting_process_count: 0
+ event_timestamps {
+ intent_received: 300
+ first_frame: 400
+ }
+ system_state {
+ dex2oat_running: true
+ installd_running: false
+ }
+ }
+ startup {
+ startup_id: 3
+ package_name: "com.google.android.deskclock"
+ zygote_new_process: false
+ to_first_frame {
+ dur_ns: 100
+ main_thread_by_task_state {
+ running_dur_ns: 0
+ runnable_dur_ns: 0
+ uninterruptible_sleep_dur_ns: 0
+ interruptible_sleep_dur_ns: 0
+ }
+ other_processes_spawned_count: 0
+ dur_ms: 0.0001
+ }
+ activity_hosting_process_count: 0
+ event_timestamps {
+ intent_received: 500
+ first_frame: 600
+ }
+ system_state {
+ dex2oat_running: false
+ installd_running: true
+ }
+ }
+ startup {
+ startup_id: 4
+ package_name: "com.google.android.gm"
+ zygote_new_process: false
+ to_first_frame {
+ dur_ns: 100
+ main_thread_by_task_state {
+ running_dur_ns: 0
+ runnable_dur_ns: 0
+ uninterruptible_sleep_dur_ns: 0
+ interruptible_sleep_dur_ns: 0
+ }
+ other_processes_spawned_count: 0
+ dur_ms: 0.0001
+ }
+ activity_hosting_process_count: 0
+ event_timestamps {
+ intent_received: 700
+ first_frame: 800
+ }
+ system_state {
+ dex2oat_running: true
+ installd_running: true
+ }
+ }
+}
diff --git a/test/trace_processor/startup/android_startup_installd_dex2oat.py b/test/trace_processor/startup/android_startup_installd_dex2oat.py
new file mode 100644
index 0000000..4b3a214
--- /dev/null
+++ b/test/trace_processor/startup/android_startup_installd_dex2oat.py
@@ -0,0 +1,86 @@
+#!/usr/bin/env python3
+# Copyright (C) 2018 The Android Open Source Project
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http://www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+from os import sys
+
+import synth_common
+
+trace = synth_common.create_trace()
+trace.add_packet()
+trace.add_process(1, 0, 'init')
+trace.add_process(2, 1, 'system_server')
+trace.add_process(3, 1, 'com.google.android.calendar', 10003)
+trace.add_process(4, 1, 'com.google.android.calculator', 10004)
+trace.add_process(5, 1, 'com.google.android.deskclock', 10005)
+trace.add_process(6, 1, 'com.google.android.gm', 10006)
+trace.add_process(10, 1, 'dex2oat64')
+trace.add_process(11, 1, 'installd')
+
+trace.add_package_list(
+ ts=1, name='com.google.android.calendar', uid=10003, version_code=123)
+trace.add_package_list(
+ ts=2, name='com.google.android.calculator', uid=10004, version_code=123)
+trace.add_package_list(
+ ts=3, name='com.google.android.deskclock', uid=10005, version_code=123)
+trace.add_package_list(
+ ts=4, name='com.google.android.gm', uid=10006, version_code=123)
+
+trace.add_ftrace_packet(cpu=0)
+
+# First launch: don't have either dex2oat or installd
+trace.add_atrace_async_begin(ts=100, tid=2, pid=2, buf='launchingActivity#1')
+trace.add_atrace_async_end(ts=200, tid=2, pid=2, buf='launchingActivity#1')
+trace.add_atrace_instant(
+ ts=201,
+ tid=2,
+ pid=2,
+ buf='launchingActivity#1:completed:com.google.android.calendar')
+
+# Second launch: just dex2oat
+trace.add_atrace_async_begin(ts=300, tid=2, pid=2, buf='launchingActivity#2')
+trace.add_sched(ts=305, prev_pid=0, next_pid=10)
+trace.add_sched(ts=310, prev_pid=10, next_pid=0)
+trace.add_atrace_async_end(ts=400, tid=2, pid=2, buf='launchingActivity#2')
+trace.add_atrace_instant(
+ ts=401,
+ tid=2,
+ pid=2,
+ buf='launchingActivity#2:completed:com.google.android.calculator')
+
+# Third launch: just installd
+trace.add_atrace_async_begin(ts=500, tid=2, pid=2, buf='launchingActivity#3')
+trace.add_sched(ts=505, prev_pid=0, next_pid=11)
+trace.add_sched(ts=510, prev_pid=11, next_pid=0)
+trace.add_atrace_async_end(ts=600, tid=2, pid=2, buf='launchingActivity#3')
+trace.add_atrace_instant(
+ ts=601,
+ tid=2,
+ pid=2,
+ buf='launchingActivity#3:completed:com.google.android.deskclock')
+
+# Third launch: just installd
+trace.add_atrace_async_begin(ts=700, tid=2, pid=2, buf='launchingActivity#4')
+trace.add_sched(ts=705, prev_pid=0, next_pid=10)
+trace.add_sched(ts=710, prev_pid=10, next_pid=0)
+trace.add_sched(ts=715, prev_pid=0, next_pid=11)
+trace.add_sched(ts=720, prev_pid=11, next_pid=0)
+trace.add_atrace_async_end(ts=800, tid=2, pid=2, buf='launchingActivity#4')
+trace.add_atrace_instant(
+ ts=801,
+ tid=2,
+ pid=2,
+ buf='launchingActivity#4:completed:com.google.android.gm')
+
+sys.stdout.buffer.write(trace.trace.SerializeToString())
diff --git a/test/trace_processor/startup/android_startup_lock_contention.out b/test/trace_processor/startup/android_startup_lock_contention.out
index 89455a6..9b26942 100644
--- a/test/trace_processor/startup/android_startup_lock_contention.out
+++ b/test/trace_processor/startup/android_startup_lock_contention.out
@@ -50,5 +50,9 @@
intent_received: 110
first_frame: 210
}
+ system_state {
+ dex2oat_running: false
+ installd_running: false
+ }
}
}
diff --git a/test/trace_processor/startup/android_startup_minsdk33.out b/test/trace_processor/startup/android_startup_minsdk33.out
index a6b1b06..18b8489 100644
--- a/test/trace_processor/startup/android_startup_minsdk33.out
+++ b/test/trace_processor/startup/android_startup_minsdk33.out
@@ -19,5 +19,9 @@
intent_received: 110
first_frame: 210
}
+ system_state {
+ dex2oat_running: false
+ installd_running: false
+ }
}
}
diff --git a/test/trace_processor/startup/android_startup_process_track.out b/test/trace_processor/startup/android_startup_process_track.out
index e0f6011..b4efbc2 100644
--- a/test/trace_processor/startup/android_startup_process_track.out
+++ b/test/trace_processor/startup/android_startup_process_track.out
@@ -3,9 +3,6 @@
startup_id: 1
package_name: "com.google.android.calendar"
process_name: "com.google.android.calendar"
- process: {
- name: "com.google.android.calendar"
- }
zygote_new_process: false
to_first_frame {
dur_ns: 5
@@ -30,19 +27,23 @@
dur_ms: 3e-06
}
}
+ activity_hosting_process_count: 1
+ process {
+ name: "com.google.android.calendar"
+ }
event_timestamps {
intent_received: 100
first_frame: 105
}
- activity_hosting_process_count: 1
+ system_state {
+ dex2oat_running: false
+ installd_running: false
+ }
}
startup {
startup_id: 2
package_name: "com.google.android.calendar"
process_name: "com.google.android.calendar"
- process: {
- name: "com.google.android.calendar"
- }
zygote_new_process: false
to_first_frame {
dur_ns: 5
@@ -67,10 +68,17 @@
dur_ms: 3e-06
}
}
+ activity_hosting_process_count: 1
+ process {
+ name: "com.google.android.calendar"
+ }
event_timestamps {
intent_received: 200
first_frame: 205
}
- activity_hosting_process_count: 1
+ system_state {
+ dex2oat_running: false
+ installd_running: false
+ }
}
}
diff --git a/test/trace_processor/startup/index b/test/trace_processor/startup/index
index afdfdf5..8c5a7b5 100644
--- a/test/trace_processor/startup/index
+++ b/test/trace_processor/startup/index
@@ -10,6 +10,9 @@
# Test lock contention is correctly attributed.
android_startup_lock_contention.py android_startup android_startup_lock_contention.out
+# Test that dex2oat/installd running in parallel are flagged.
+android_startup_installd_dex2oat.py android_startup android_startup_installd_dex2oat.out
+
# Other metrics associated with startup.
android_startup_battery.py android_batt android_batt_counters.out
android_startup_cpu.py android_cpu android_startup_cpu.out