1/* 2 * Copyright (C) 2021 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 */ 16syntax = "proto2"; 17 18package perfetto.protos; 19 20// Common state for UIs visualizing Perfetto traces. 21// This message can be appended as a TracePacket by UIs to save the 22// visible state (e.g. scroll position/zoom state) for future opening 23// of the trace. 24// Design doc: go/trace-ui-state. 25message UiState { 26 // The start and end bounds of the viewport of the UI in nanoseconds. 27 // 28 // This is the absolute time associated to slices and other events in 29 // trace processor tables (i.e. the |ts| column of most tables) 30 optional int64 timeline_start_ts = 1; 31 optional int64 timeline_end_ts = 2; 32 33 // Indicates that the given process should be highlighted by the UI. 34 message HighlightProcess { 35 oneof selector { 36 // The pid of the process to highlight. This is useful for UIs to focus 37 // on tracks of a particular process in the trace. 38 // 39 // If more than one process in a trace has the same pid, it is UI 40 // implementation specific how the process to be focused will be 41 // chosen. 42 uint32 pid = 1; 43 44 // The command line of the process to highlight; for most Android apps, 45 // this is the package name of the app. This is useful for UIs to focus 46 // on a particular app in the trace. 47 // 48 // If more than one process hasthe same cmdline, it is UI implementation 49 // specific how the process to be focused will be chosen. 50 string cmdline = 2; 51 } 52 } 53 optional HighlightProcess highlight_process = 3; 54}