1/* 2 * Copyright (C) 2022 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 perfetto.protos; 20 21import "protos/perfetto/metrics/android/process_metadata.proto"; 22 23message AndroidJankCujMetric { 24 repeated Cuj cuj = 1; 25 26 // Next id: 12 27 message Cuj { 28 // ID of the CUJ that is unique within the trace. 29 optional int32 id = 1; 30 31 // Name of the CUJ, extracted from the CUJ trace marker. 32 // For example SHADE_EXPAND_COLLAPSE from J<SHADE_EXPAND_COLLAPSE>. 33 optional string name = 2; 34 35 // Details about the process (uid, version, etc) 36 optional AndroidProcessMetadata process = 3; 37 38 // ts of the CUJ trace marker slice. 39 optional int64 ts = 4; 40 41 // dur of the CUJ trace marker slice. 42 optional int64 dur = 5; 43 44 // Details about each of the frames within the CUJ. 45 repeated Frame frame = 6; 46 47 // Details about each of the SF frames within the CUJ. 48 repeated Frame sf_frame = 10; 49 50 // Metrics extracted from the counters output by FrameTracker 51 // Does not contain the frame_dur percentile information. 52 optional Metrics counter_metrics = 7; 53 54 // Metrics extracted from the frame timeline. 55 optional Metrics timeline_metrics = 8; 56 57 // Metrics extracted from the trace slices. 58 optional Metrics trace_metrics = 9; 59 60 // Layer name of the surface where the cuj is drawn. 61 optional string layer_name = 11; 62 } 63 64 // Next id: 10 65 message Frame { 66 // Index of the frame within the single user journey. 67 optional int64 frame_number = 1; 68 69 // VSYNC ID of the frame. 70 optional int64 vsync = 2; 71 72 optional int64 ts = 3; 73 optional int64 dur = 4; 74 optional int64 dur_expected = 7; 75 76 // Whether the app process missed the frame deadline. 77 // Only set for the App frames. Always left unset for SF frames. 78 optional bool app_missed = 5; 79 80 // Whether SF missed the frame deadline. 81 optional bool sf_missed = 6; 82 83 // Whether the SF callback missed before emitting jank metrics. 84 // SF callback is used to get the jank classification. 85 optional bool sf_callback_missed = 8; 86 87 // Whether the HWUI callback missed before emitting jank metrics. 88 // HWUI callback is used to get the frame duration. 89 optional bool hwui_callback_missed = 9; 90 } 91 92 // Next id: 18 93 message Metrics { 94 // Overall number of frames within the CUJ. 95 optional int64 total_frames = 1; 96 97 // Number of missed frames. 98 optional int64 missed_frames = 2; 99 100 // Number of frames missed due to the app missing the deadline. 101 optional int64 missed_app_frames = 3; 102 103 // Number of frames missed due to SF. 104 optional int64 missed_sf_frames = 4; 105 106 // Number of successive frames missed. 107 // Not available in timeline_metrics and trace_metrics. 108 optional int64 missed_frames_max_successive = 5; 109 110 // Max frame duration in nanoseconds. 111 optional int64 frame_dur_max = 6; 112 113 // Average frame duration in nanoseconds. 114 // Not available in counter_metrics. 115 optional int64 frame_dur_avg = 7; 116 117 // Median frame duration in nanoseconds. 118 // Not available in counter_metrics. 119 optional int64 frame_dur_p50 = 8; 120 121 // P90 frame duration in nanoseconds. 122 // Not available in counter_metrics. 123 optional int64 frame_dur_p90 = 9; 124 125 // P95 frame duration in nanoseconds. 126 // Not available in counter_metrics. 127 optional int64 frame_dur_p95 = 10; 128 129 // P99 frame duration in nanoseconds. 130 // Not available in counter_metrics. 131 optional int64 frame_dur_p99 = 11; 132 133 // Median frame duration in milliseconds. 134 // Not available in counter_metrics. 135 optional double frame_dur_ms_p50 = 12; 136 137 // P90 frame duration in milliseconds. 138 // Not available in counter_metrics. 139 optional double frame_dur_ms_p90 = 13; 140 141 // P95 frame duration in milliseconds. 142 // Not available in counter_metrics. 143 optional double frame_dur_ms_p95 = 14; 144 145 // P99 frame duration in milliseconds. 146 // Not available in counter_metrics. 147 optional double frame_dur_ms_p99 = 15; 148 149 // Number of frames with missed SF callback. 150 optional int64 sf_callback_missed_frames = 16; 151 152 // Number of frames with missed HWUI callback. 153 optional int64 hwui_callback_missed_frames = 17; 154 } 155} 156