• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1/*
2 * Copyright (C) 2020 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
21message ChromeLatencyInfo {
22  optional int64 trace_id = 1;
23
24  // NEXT ID: 11
25  // All step are optional but the enum is ordered (not by number) below in the
26  // order we expect them to appear if they are emitted in trace in a blocking
27  // fashion.
28  enum Step {
29    STEP_UNSPECIFIED = 0;
30    // Emitted on the browser main thread.
31    STEP_SEND_INPUT_EVENT_UI = 3;
32    // Happens on the renderer's compositor.
33    STEP_HANDLE_INPUT_EVENT_IMPL = 5;
34    STEP_DID_HANDLE_INPUT_AND_OVERSCROLL = 8;
35    // Occurs on the Renderer's main thread.
36    STEP_HANDLE_INPUT_EVENT_MAIN = 4;
37    STEP_MAIN_THREAD_SCROLL_UPDATE = 2;
38    STEP_HANDLE_INPUT_EVENT_MAIN_COMMIT = 1;
39    // Could be emitted on both the renderer's main OR compositor.
40    STEP_HANDLED_INPUT_EVENT_MAIN_OR_IMPL = 9;
41    // Optionally sometimes HANDLED_INPUT_EVENT_MAIN_OR_IMPL will proxy to the
42    // renderer's compositor and this will be emitted.
43    STEP_HANDLED_INPUT_EVENT_IMPL = 10;
44    // Renderer's compositor.
45    STEP_SWAP_BUFFERS = 6;
46    // Happens on the VizCompositor in the GPU process.
47    STEP_DRAW_AND_SWAP = 7;
48  };
49
50  optional Step step = 2;
51  optional int32 frame_tree_node_id = 3;
52
53  // This enum is a copy of LatencyComponentType enum in Chrome, located in
54  // ui/latency/latency_info.h, modulo added UNKNOWN value per protobuf
55  // practices.
56  enum LatencyComponentType {
57    COMPONENT_UNSPECIFIED = 0;
58    COMPONENT_INPUT_EVENT_LATENCY_BEGIN_RWH = 1;
59    COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_ORIGINAL = 2;
60    COMPONENT_INPUT_EVENT_LATENCY_FIRST_SCROLL_UPDATE_ORIGINAL = 3;
61    COMPONENT_INPUT_EVENT_LATENCY_ORIGINAL = 4;
62    COMPONENT_INPUT_EVENT_LATENCY_UI = 5;
63    COMPONENT_INPUT_EVENT_LATENCY_RENDERER_MAIN = 6;
64    COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_MAIN = 7;
65    COMPONENT_INPUT_EVENT_LATENCY_RENDERING_SCHEDULED_IMPL = 8;
66    COMPONENT_INPUT_EVENT_LATENCY_SCROLL_UPDATE_LAST_EVENT = 9;
67    COMPONENT_INPUT_EVENT_LATENCY_ACK_RWH = 10;
68    COMPONENT_INPUT_EVENT_LATENCY_RENDERER_SWAP = 11;
69    COMPONENT_DISPLAY_COMPOSITOR_RECEIVED_FRAME = 12;
70    COMPONENT_INPUT_EVENT_GPU_SWAP_BUFFER = 13;
71    COMPONENT_INPUT_EVENT_LATENCY_FRAME_SWAP = 14;
72  }
73
74  message ComponentInfo {
75    optional LatencyComponentType component_type = 1;
76
77    // Microsecond timestamp in CLOCK_MONOTONIC domain
78    optional uint64 time_us = 2;
79  };
80
81  repeated ComponentInfo component_info = 4;
82  optional bool is_coalesced = 5;
83  optional int64 gesture_scroll_id = 6;
84}
85