• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1--
2-- Copyright 2024 The Android Open Source Project
3--
4-- Licensed under the Apache License, Version 2.0 (the "License");
5-- you may not use this file except in compliance with the License.
6-- You may obtain a copy of the License at
7--
8--     https://www.apache.org/licenses/LICENSE-2.0
9--
10-- Unless required by applicable law or agreed to in writing, software
11-- distributed under the License is distributed on an "AS IS" BASIS,
12-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-- See the License for the specific language governing permissions and
14-- limitations under the License.
15--
16
17INCLUDE PERFETTO MODULE android.app_process_starts;
18
19DROP VIEW IF EXISTS android_app_process_starts_output;
20CREATE PERFETTO VIEW android_app_process_starts_output AS
21SELECT AndroidAppProcessStartsMetric(
22  'all_apps', (
23    SELECT RepeatedField(
24        AndroidAppProcessStartsMetric_ProcessStart(
25            'process_name', process_name,
26            'intent', intent,
27            'reason', reason,
28            'proc_start_dur', proc_start_dur,
29            'bind_app_dur', bind_app_dur,
30            'intent_dur', intent_dur,
31            'total_dur', total_dur
32        )
33    )
34    FROM android_app_process_starts
35  ),
36  'started_by_broadcast', (
37    SELECT RepeatedField(
38        AndroidAppProcessStartsMetric_ProcessStart(
39            'process_name', process_name,
40            'intent', intent,
41            'reason', reason,
42            'proc_start_dur', proc_start_dur,
43            'bind_app_dur', bind_app_dur,
44            'intent_dur', intent_dur,
45            'total_dur', total_dur
46        )
47    )
48    FROM android_app_process_starts where reason = "broadcast"
49  ),
50  'started_by_service', (
51    SELECT RepeatedField(
52        AndroidAppProcessStartsMetric_ProcessStart(
53            'process_name', process_name,
54            'intent', intent,
55            'reason', reason,
56            'proc_start_dur', proc_start_dur,
57            'bind_app_dur', bind_app_dur,
58            'intent_dur', intent_dur,
59            'total_dur', total_dur
60        )
61    )
62    FROM android_app_process_starts where reason = "service"
63  )
64);
65