John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 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 | |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 17 | syntax = "proto2"; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 18 | package android.service; |
| 19 | |
| 20 | option java_multiple_files = true; |
| 21 | option java_outer_classname = "GraphicsStatsServiceProto"; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 22 | |
| 23 | message GraphicsStatsServiceDumpProto { |
| 24 | repeated GraphicsStatsProto stats = 1; |
| 25 | } |
| 26 | |
| 27 | message GraphicsStatsProto { |
| 28 | |
| 29 | // The package name of the app |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 30 | optional string package_name = 1; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 31 | |
| 32 | // The version code of the app |
Dianne Hackborn | 73453e4 | 2017-12-11 16:30:36 -0800 | [diff] [blame] | 33 | optional int64 version_code = 2; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 34 | |
| 35 | // The start & end timestamps in UTC as |
| 36 | // milliseconds since January 1, 1970 |
| 37 | // Compatible with java.util.Date#setTime() |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 38 | optional int64 stats_start = 3; |
| 39 | optional int64 stats_end = 4; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 40 | |
| 41 | // The aggregated statistics for the package |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 42 | optional GraphicsStatsJankSummaryProto summary = 5; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 43 | |
| 44 | // The frame time histogram for the package |
| 45 | repeated GraphicsStatsHistogramBucketProto histogram = 6; |
| 46 | } |
| 47 | |
| 48 | message GraphicsStatsJankSummaryProto { |
| 49 | // Distinct frame count. |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 50 | optional int32 total_frames = 1; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 51 | |
| 52 | // Number of frames with slow render time. Frames are considered janky if |
| 53 | // they took more than a vsync interval (typically 16.667ms) to be rendered. |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 54 | optional int32 janky_frames = 2; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 55 | |
| 56 | // Number of "missed vsync" events. |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 57 | optional int32 missed_vsync_count = 3; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 58 | |
John Reck | 0e48647 | 2018-03-19 14:06:16 -0700 | [diff] [blame] | 59 | // Number of frames in triple-buffering scenario (high input latency) |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 60 | optional int32 high_input_latency_count = 4; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 61 | |
| 62 | // Number of "slow UI thread" events. |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 63 | optional int32 slow_ui_thread_count = 5; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 64 | |
| 65 | // Number of "slow bitmap upload" events. |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 66 | optional int32 slow_bitmap_upload_count = 6; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 67 | |
| 68 | // Number of "slow draw" events. |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 69 | optional int32 slow_draw_count = 7; |
John Reck | 0e48647 | 2018-03-19 14:06:16 -0700 | [diff] [blame] | 70 | |
| 71 | // Number of frames that missed their deadline (aka, visibly janked) |
| 72 | optional int32 missed_deadline_count = 8; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 73 | } |
| 74 | |
| 75 | message GraphicsStatsHistogramBucketProto { |
| 76 | // Lower bound of render time in milliseconds. |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 77 | optional int32 render_millis = 1; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 78 | // Number of frames in the bucket. |
Yi Jin | c7f9307 | 2017-09-29 15:29:38 -0700 | [diff] [blame] | 79 | optional int32 frame_count = 2; |
John Reck | df1742e | 2017-01-19 15:56:21 -0800 | [diff] [blame] | 80 | } |