• 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
16DROP VIEW IF EXISTS rt_runtime_all;
17
18CREATE VIEW rt_runtime_all
19AS
20SELECT ts, dur, thread.name AS tname
21FROM sched_slice
22LEFT JOIN thread
23  USING (utid)
24LEFT JOIN process
25  USING (upid)
26WHERE priority < 100
27ORDER BY dur DESC;
28
29DROP VIEW IF EXISTS android_rt_runtime_output;
30
31CREATE VIEW android_rt_runtime_output
32AS
33SELECT
34  AndroidRtRuntimeMetric(
35    'max_runtime',
36    (SELECT dur FROM rt_runtime_all LIMIT 1),
37    'over_5ms_count',
38    (SELECT COUNT(*) FROM rt_runtime_all WHERE dur > 5e6),
39    'longest_rt_slices',
40    (
41      SELECT
42        RepeatedField(
43          AndroidRtRuntimeMetric_RtSlice(
44            'tname', tname, 'ts', ts, 'dur', dur))
45      FROM (SELECT ts, dur, tname FROM rt_runtime_all LIMIT 10)
46    ));
47