• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1
2-- Copyright 2025 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
16INCLUDE PERFETTO MODULE android.startup.startups;
17INCLUDE PERFETTO MODULE wattson.curves.estimates;
18INCLUDE PERFETTO MODULE viz.summary.threads_w_processes;
19
20DROP VIEW IF EXISTS _app_startup_window;
21CREATE PERFETTO VIEW _app_startup_window AS
22SELECT
23  ts,
24  dur,
25  startup_id as period_id
26FROM android_startups;
27
28SELECT RUN_METRIC(
29  'android/wattson_tasks_attribution.sql',
30  'window_table',
31  '_app_startup_window'
32);
33
34DROP VIEW IF EXISTS wattson_app_startup_threads_output;
35CREATE PERFETTO VIEW wattson_app_startup_threads_output AS
36SELECT AndroidWattsonTasksAttributionMetric(
37  'metric_version', 4,
38  'power_model_version', 1,
39  'period_info', (
40    SELECT RepeatedField(
41      AndroidWattsonTaskPeriodInfo(
42        'period_id', period_id,
43        'task_info', proto
44      )
45    )
46    FROM _wattson_per_task
47  )
48);
49