xref: /aosp_15_r20/external/perfetto/protos/perfetto/metrics/chrome/scroll_jank_v3.proto (revision 6dbdd20afdafa5e3ca9b8809fa73465d530080dc)
1/*
2 * Copyright (C) 2023 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/custom_options.proto";
22
23message ChromeScrollJankV3 {
24  // Total count of unique frames in the trace.
25  optional int64 trace_num_frames = 1 [(unit) = "count_biggerIsBetter"];
26  // Number of frames in the trace that had missed vsyncs.
27  optional int64 trace_num_janky_frames = 2 [(unit) = "count_smallerIsBetter"];
28  // Computed as: `100 * trace_num_janky_frames /
29  // trace_num_frames`.
30  optional double trace_scroll_jank_percentage = 3
31      [(unit) = "n%_smallerIsBetter"];
32  // Vsync interval at the time of recording the trace.
33  optional double vsync_interval_ms = 4 [(unit) = "ms_biggerIsBetter"];
34  // Per-scroll metrics.
35  message Scroll {
36    // Total count of unique frames during this scroll.
37    optional int64 num_frames = 1 [(unit) = "count_biggerIsBetter"];
38    // Number of frames during this scroll that had missed vsyncs.
39    optional int64 num_janky_frames = 2 [(unit) = "count_smallerIsBetter"];
40    // Computed as: `100 * num_janky_frames / num_frames`.
41    optional double scroll_jank_percentage = 3 [(unit) = "n%_smallerIsBetter"];
42    // Maximum `delay_since_last_frame` for janky frames during this scroll
43    // (i.e. maximum `delay_since_last_frame` from the `scroll_jank_causes`
44    // repeated field below).
45    // This is measured in units of vsync interval. For example, a value of 2
46    // means the delay was 2x the vsync interval.
47    optional double max_delay_since_last_frame = 4
48        [(unit) = "unitless_smallerIsBetter"];
49    // The primary cause and sub-cause for scroll jank, one for each jank.
50    // There are exactly `num_janky_frames` items in this field.
51    message ScrollJankCause {
52      // May be empty, if a cause is not available.
53      optional string cause = 1;
54      // May be empty, if a sub-cause is not available.
55      optional string sub_cause = 2;
56      // Number of vsyncs elapsed since the previous frame was presented: will
57      // be > 1.0 since this was a "janky" frame. For example, a value of 2
58      // means the delay was 2x the vsync interval.
59      optional double delay_since_last_frame = 3
60          [(unit) = "unitless_smallerIsBetter"];
61    }
62    repeated ScrollJankCause scroll_jank_causes = 5;
63  }
64  repeated Scroll scrolls = 5;
65}
66