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