• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1--
2-- Copyright 2022 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.startup.startups;
18
19DROP VIEW IF EXISTS slow_start_thresholds;
20CREATE PERFETTO VIEW slow_start_thresholds AS
21SELECT
22  15 AS runnable_percentage,
23  2900000000 AS interruptible_sleep_ns,
24  450000000 AS blocking_io_ns,
25  20 AS open_dex_files_from_oat_percentage,
26  1250000000 AS bind_application_ns,
27  450000000 AS view_inflation_ns,
28  130000000 AS resources_manager_get_resources_ns,
29  15 AS verify_classes_percentage,
30  100000000 AS potential_cpu_contention_ns,
31  100000000 AS jit_activity_ns,
32  20 AS lock_contention_percentage,
33  15 AS monitor_contention_percentage,
34  65 AS jit_compiled_methods_count,
35  15 AS broadcast_dispatched_count,
36  50 AS broadcast_received_count;
37
38CREATE OR REPLACE PERFETTO FUNCTION threshold_runnable_percentage()
39RETURNS INT AS
40  SELECT runnable_percentage
41  FROM slow_start_thresholds;
42
43CREATE OR REPLACE PERFETTO FUNCTION threshold_interruptible_sleep_ns()
44RETURNS INT AS
45  SELECT interruptible_sleep_ns
46  FROM slow_start_thresholds;
47
48CREATE OR REPLACE PERFETTO FUNCTION threshold_blocking_io_ns()
49RETURNS INT AS
50  SELECT blocking_io_ns
51  FROM slow_start_thresholds;
52
53CREATE OR REPLACE PERFETTO FUNCTION threshold_open_dex_files_from_oat_percentage()
54RETURNS INT AS
55  SELECT open_dex_files_from_oat_percentage
56  FROM slow_start_thresholds;
57
58CREATE OR REPLACE PERFETTO FUNCTION threshold_bind_application_ns()
59RETURNS INT AS
60  SELECT bind_application_ns
61  FROM slow_start_thresholds;
62
63CREATE OR REPLACE PERFETTO FUNCTION threshold_view_inflation_ns()
64RETURNS INT AS
65  SELECT view_inflation_ns
66  FROM slow_start_thresholds;
67
68CREATE OR REPLACE PERFETTO FUNCTION threshold_resources_manager_get_resources_ns()
69RETURNS INT AS
70  SELECT resources_manager_get_resources_ns
71  FROM slow_start_thresholds;
72
73CREATE OR REPLACE PERFETTO FUNCTION threshold_verify_classes_percentage()
74RETURNS INT AS
75  SELECT verify_classes_percentage
76  FROM slow_start_thresholds;
77
78CREATE OR REPLACE PERFETTO FUNCTION threshold_potential_cpu_contention_ns()
79RETURNS INT AS
80  SELECT potential_cpu_contention_ns
81  FROM slow_start_thresholds;
82
83CREATE OR REPLACE PERFETTO FUNCTION threshold_jit_activity_ns()
84RETURNS INT AS
85  SELECT jit_activity_ns
86  FROM slow_start_thresholds;
87
88CREATE OR REPLACE PERFETTO FUNCTION threshold_lock_contention_percentage()
89RETURNS INT AS
90  SELECT lock_contention_percentage
91  FROM slow_start_thresholds;
92
93CREATE OR REPLACE PERFETTO FUNCTION threshold_monitor_contention_percentage()
94RETURNS INT AS
95  SELECT monitor_contention_percentage
96  FROM slow_start_thresholds;
97
98CREATE OR REPLACE PERFETTO FUNCTION threshold_jit_compiled_methods_count()
99RETURNS INT AS
100  SELECT jit_compiled_methods_count
101  FROM slow_start_thresholds;
102
103CREATE OR REPLACE PERFETTO FUNCTION threshold_broadcast_dispatched_count()
104RETURNS INT AS
105  SELECT broadcast_dispatched_count
106  FROM slow_start_thresholds;
107
108CREATE OR REPLACE PERFETTO FUNCTION threshold_broadcast_received_count()
109RETURNS INT AS
110  SELECT broadcast_received_count
111  FROM slow_start_thresholds;
112