1/* 2 * Copyright (C) 2017 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 19import "protos/perfetto/trace/android/server/windowmanagerservice.proto"; 20 21package perfetto.protos; 22 23// Represents a file full of window manager trace entries. 24// Encoded, it should start with 0x9 0x57 0x49 0x4e 0x54 0x52 0x41 0x43 0x45 25// (.WINTRACE), such that they can be easily identified. 26message WindowManagerTraceFileProto { 27 // constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 | 28 // MagicNumber.MAGIC_NUMBER_L (this is needed because enums have to be 32 bits 29 // and there's no nice way to put 64bit constants into .proto files. 30 enum MagicNumber { 31 INVALID = 0; 32 // WINT (little-endian ASCII) 33 MAGIC_NUMBER_L = 0x544e4957; 34 // RACE (little-endian ASCII) 35 MAGIC_NUMBER_H = 0x45434152; 36 } 37 38 // Must be the first field, set to value in MagicNumber 39 optional fixed64 magic_number = 1; 40 repeated WindowManagerTraceEntry entry = 2; 41 42 // offset between real-time clock and elapsed time clock in nanoseconds. 43 // Calculated as: 1000000 * System.currentTimeMillis() - 44 // SystemClock.elapsedRealtimeNanos() 45 optional fixed64 real_to_elapsed_time_offset_nanos = 3; 46} 47 48// one window manager trace entry 49message WindowManagerTraceEntry { 50 // required: elapsed realtime in nanos since boot of when this entry was 51 // logged 52 optional fixed64 elapsed_realtime_nanos = 1; 53 54 // where the trace originated 55 optional string where = 2; 56 57 optional WindowManagerServiceDumpProto window_manager_service = 3; 58} 59