• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1--
2-- Copyright 2020 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
16SELECT RUN_METRIC(
17  'android/frame_missed.sql',
18  'track_name', 'PrevFrameMissed',
19  'output', 'frame_missed'
20);
21SELECT RUN_METRIC(
22  'android/frame_missed.sql',
23  'track_name', 'PrevHwcFrameMissed',
24  'output', 'hwc_frame_missed'
25);
26SELECT RUN_METRIC(
27  'android/frame_missed.sql',
28  'track_name', 'PrevGpuFrameMissed',
29  'output', 'gpu_frame_missed'
30);
31
32DROP VIEW IF EXISTS android_surfaceflinger_event;
33CREATE VIEW android_surfaceflinger_event AS
34SELECT
35  'slice' AS track_type,
36  'Android Missed Frames' AS track_name,
37  ts,
38  dur,
39  'Frame missed' AS slice_name
40FROM frame_missed
41WHERE value = 1 AND ts IS NOT NULL;
42
43DROP VIEW IF EXISTS android_surfaceflinger_output;
44CREATE VIEW android_surfaceflinger_output AS
45SELECT
46  AndroidSurfaceflingerMetric(
47    'missed_frames', (SELECT COUNT(1) FROM frame_missed WHERE value=1),
48    'missed_hwc_frames', (SELECT COUNT(1) FROM hwc_frame_missed WHERE value=1),
49    'missed_gpu_frames', (SELECT COUNT(1) FROM gpu_frame_missed WHERE value=1),
50    'missed_frame_rate', (SELECT AVG(value) FROM frame_missed),
51    'missed_hwc_frame_rate', (SELECT AVG(value) FROM hwc_frame_missed),
52    'missed_gpu_frame_rate', (SELECT AVG(value) FROM gpu_frame_missed)
53  );
54