1/* 2 * Copyright (C) 2017 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 * http://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 17syntax = "proto2"; 18package android.service; 19 20option java_multiple_files = true; 21option java_outer_classname = "GraphicsStatsServiceProto"; 22 23import "frameworks/base/core/proto/android/privacy.proto"; 24 25// This file is based on frameworks/base/libs/hwui/protos/graphicsstats.proto. 26// Please try to keep the two files in sync. 27 28message GraphicsStatsServiceDumpProto { 29 option (android.msg_privacy).dest = DEST_AUTOMATIC; 30 31 repeated GraphicsStatsProto stats = 1; 32} 33 34message GraphicsStatsProto { 35 enum PipelineType { 36 UNKNOWN = 0; 37 GL = 1; 38 VULKAN = 2; 39 } 40 option (android.msg_privacy).dest = DEST_AUTOMATIC; 41 42 // The package name of the app 43 optional string package_name = 1; 44 45 // The version code of the app 46 optional int64 version_code = 2; 47 48 // The start & end timestamps in UTC as 49 // milliseconds since January 1, 1970 50 // Compatible with java.util.Date#setTime() 51 optional int64 stats_start = 3; 52 optional int64 stats_end = 4; 53 54 // The aggregated statistics for the package. 55 optional GraphicsStatsJankSummaryProto summary = 5; 56 57 // The frame time histogram for the package. 58 repeated GraphicsStatsHistogramBucketProto histogram = 6; 59 60 // The gpu frame time histogram for the package 61 repeated GraphicsStatsHistogramBucketProto gpu_histogram = 7; 62 63 // HWUI renders pipeline type: GL or Vulkan 64 optional PipelineType pipeline = 8; 65} 66 67message GraphicsStatsJankSummaryProto { 68 option (android.msg_privacy).dest = DEST_AUTOMATIC; 69 70 // Distinct frame count. 71 optional int32 total_frames = 1; 72 73 // Number of frames with slow render time. Frames are considered janky if 74 // they took more than a vsync interval (typically 16.667ms) to be rendered. 75 optional int32 janky_frames = 2; 76 77 // Number of "missed vsync" events. 78 optional int32 missed_vsync_count = 3; 79 80 // Number of frames in triple-buffering scenario (high input latency) 81 optional int32 high_input_latency_count = 4; 82 83 // Number of "slow UI thread" events. 84 optional int32 slow_ui_thread_count = 5; 85 86 // Number of "slow bitmap upload" events. 87 optional int32 slow_bitmap_upload_count = 6; 88 89 // Number of "slow draw" events. 90 optional int32 slow_draw_count = 7; 91 92 // Number of frames that missed their deadline (aka, visibly janked) 93 optional int32 missed_deadline_count = 8; 94} 95 96message GraphicsStatsHistogramBucketProto { 97 option (android.msg_privacy).dest = DEST_AUTOMATIC; 98 99 // Lower bound of render time in milliseconds. 100 optional int32 render_millis = 1; 101 // Number of frames in the bucket. 102 optional int32 frame_count = 2; 103} 104