1-- 2-- Copyright 2021 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/composition_layers.sql', 18 'track_name', 'HWComposer: Total Layer', 19 'output', 'total_layers' 20); 21 22SELECT RUN_METRIC( 23 'android/composition_layers.sql', 24 'track_name', 'HWComposer: DPU Layer', 25 'output', 'dpu_layers' 26); 27 28SELECT RUN_METRIC( 29 'android/composition_layers.sql', 30 'track_name', 'HWComposer: GPU Layer', 31 'output', 'gpu_layers' 32); 33 34SELECT RUN_METRIC( 35 'android/composition_layers.sql', 36 'track_name', 'HWComposer: DPU Cached Layer', 37 'output', 'dpu_cached_layers' 38); 39 40SELECT RUN_METRIC( 41 'android/composition_layers.sql', 42 'track_name', 'HWComposer: SF Cached Layer', 43 'output', 'sf_cached_layers' 44); 45 46SELECT RUN_METRIC( 47 'android/composer_execution.sql', 48 'output', 'hwc_execution_spans' 49); 50 51DROP VIEW IF EXISTS android_hwcomposer_output; 52CREATE VIEW android_hwcomposer_output AS 53SELECT AndroidHwcomposerMetrics( 54 'composition_total_layers', (SELECT AVG(value) FROM total_layers), 55 'composition_dpu_layers', (SELECT AVG(value) FROM dpu_layers), 56 'composition_gpu_layers', (SELECT AVG(value) FROM gpu_layers), 57 'composition_dpu_cached_layers', (SELECT AVG(value) FROM dpu_cached_layers), 58 'composition_sf_cached_layers', (SELECT AVG(value) FROM sf_cached_layers), 59 'skipped_validation_count', 60 (SELECT COUNT(*) FROM hwc_execution_spans 61 WHERE validation_type = 'skipped_validation'), 62 'unskipped_validation_count', 63 (SELECT COUNT(*) FROM hwc_execution_spans 64 WHERE validation_type = 'unskipped_validation'), 65 'separated_validation_count', 66 (SELECT COUNT(*) FROM hwc_execution_spans 67 WHERE validation_type = 'separated_validation'), 68 'unknown_validation_count', 69 (SELECT COUNT(*) FROM hwc_execution_spans 70 WHERE validation_type = 'unknown'), 71 'avg_all_execution_time_ms', 72 (SELECT AVG(execution_time_ns) / 1e6 FROM hwc_execution_spans 73 WHERE validation_type != 'unknown'), 74 'avg_skipped_execution_time_ms', 75 (SELECT AVG(execution_time_ns) / 1e6 FROM hwc_execution_spans 76 WHERE validation_type = 'skipped_validation'), 77 'avg_unskipped_execution_time_ms', 78 (SELECT AVG(execution_time_ns) / 1e6 FROM hwc_execution_spans 79 WHERE validation_type = 'unskipped_validation'), 80 'avg_separated_execution_time_ms', 81 (SELECT AVG(execution_time_ns) / 1e6 FROM hwc_execution_spans 82 WHERE validation_type = 'separated_validation') 83); 84