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 17/* 18 This file is a snapshot of 19 frameworks/base/libs/WindowManager/Shell/proto/wm_shell_transition_trace.proto 20 before it got moved to external/perfetto as part of the winscope-to-perfetto migration. 21 */ 22syntax = "proto2"; 23 24package com.android.wm.shell; 25 26option java_multiple_files = true; 27 28/* Represents a file full of transition entries. 29 Encoded, it should start with 0x09 0x57 0x4D 0x53 0x54 0x52 0x41 0x43 0x45 (.WMSTRACE), such 30 that it can be easily identified. */ 31message WmShellTransitionTraceProto { 32 /* constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 | MagicNumber.MAGIC_NUMBER_L 33 (this is needed because enums have to be 32 bits and there's no nice way to put 64bit 34 constants into .proto files. */ 35 enum MagicNumber { 36 INVALID = 0; 37 MAGIC_NUMBER_L = 0x54534D57; /* WMST (little-endian ASCII) */ 38 MAGIC_NUMBER_H = 0x45434152; /* RACE (little-endian ASCII) */ 39 } 40 41 // Must be the first field, set to value in MagicNumber 42 required fixed64 magic_number = 1; 43 repeated Transition transitions = 2; 44 repeated HandlerMapping handlerMappings = 3; 45 /* offset between real-time clock and elapsed time clock in nanoseconds. 46 Calculated as: 1000000 * System.currentTimeMillis() - SystemClock.elapsedRealtimeNanos() */ 47 optional fixed64 real_to_elapsed_time_offset_nanos = 4; 48} 49 50message Transition { 51 required int32 id = 1; 52 optional int64 dispatch_time_ns = 2; 53 optional int32 handler = 3; 54 optional int64 merge_time_ns = 4; 55 optional int64 merge_request_time_ns = 5; 56 optional int32 merge_target = 6; 57 optional int64 abort_time_ns = 7; 58} 59 60message HandlerMapping { 61 required int32 id = 1; 62 required string name = 2; 63} 64