xref: /aosp_15_r20/development/tools/winscope/protos/surfaceflinger/udc/layerstrace.proto (revision 90c8c64db3049935a07c6143d7fd006e26f8ecca)
1*90c8c64dSAndroid Build Coastguard Worker/*
2*90c8c64dSAndroid Build Coastguard Worker * Copyright (C) 2017 The Android Open Source Project
3*90c8c64dSAndroid Build Coastguard Worker *
4*90c8c64dSAndroid Build Coastguard Worker * Licensed under the Apache License, Version 2.0 (the "License");
5*90c8c64dSAndroid Build Coastguard Worker * you may not use this file except in compliance with the License.
6*90c8c64dSAndroid Build Coastguard Worker * You may obtain a copy of the License at
7*90c8c64dSAndroid Build Coastguard Worker *
8*90c8c64dSAndroid Build Coastguard Worker *      http://www.apache.org/licenses/LICENSE-2.0
9*90c8c64dSAndroid Build Coastguard Worker *
10*90c8c64dSAndroid Build Coastguard Worker * Unless required by applicable law or agreed to in writing, software
11*90c8c64dSAndroid Build Coastguard Worker * distributed under the License is distributed on an "AS IS" BASIS,
12*90c8c64dSAndroid Build Coastguard Worker * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*90c8c64dSAndroid Build Coastguard Worker * See the License for the specific language governing permissions and
14*90c8c64dSAndroid Build Coastguard Worker * limitations under the License.
15*90c8c64dSAndroid Build Coastguard Worker */
16*90c8c64dSAndroid Build Coastguard Worker
17*90c8c64dSAndroid Build Coastguard Workersyntax = "proto2";
18*90c8c64dSAndroid Build Coastguard Workeroption optimize_for = LITE_RUNTIME;
19*90c8c64dSAndroid Build Coastguard Worker
20*90c8c64dSAndroid Build Coastguard Workerimport "protos/surfaceflinger/udc/layers.proto";
21*90c8c64dSAndroid Build Coastguard Workerimport "protos/surfaceflinger/udc/display.proto";
22*90c8c64dSAndroid Build Coastguard Worker
23*90c8c64dSAndroid Build Coastguard Workerpackage android.surfaceflinger;
24*90c8c64dSAndroid Build Coastguard Worker
25*90c8c64dSAndroid Build Coastguard Worker/* represents a file full of surface flinger trace entries.
26*90c8c64dSAndroid Build Coastguard Worker   Encoded, it should start with 0x4c 0x59 0x52 0x54 0x52 0x41 0x43 0x45 (.LYRTRACE), such
27*90c8c64dSAndroid Build Coastguard Worker   that they can be easily identified. */
28*90c8c64dSAndroid Build Coastguard Workermessage LayersTraceFileProto {
29*90c8c64dSAndroid Build Coastguard Worker
30*90c8c64dSAndroid Build Coastguard Worker    /* constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 | MagicNumber.MAGIC_NUMBER_L
31*90c8c64dSAndroid Build Coastguard Worker       (this is needed because enums have to be 32 bits and there's no nice way to put 64bit
32*90c8c64dSAndroid Build Coastguard Worker        constants into .proto files. */
33*90c8c64dSAndroid Build Coastguard Worker    enum MagicNumber {
34*90c8c64dSAndroid Build Coastguard Worker        INVALID = 0;
35*90c8c64dSAndroid Build Coastguard Worker        MAGIC_NUMBER_L = 0x5452594c;  /* LYRT (little-endian ASCII) */
36*90c8c64dSAndroid Build Coastguard Worker        MAGIC_NUMBER_H = 0x45434152;  /* RACE (little-endian ASCII) */
37*90c8c64dSAndroid Build Coastguard Worker    }
38*90c8c64dSAndroid Build Coastguard Worker
39*90c8c64dSAndroid Build Coastguard Worker    optional fixed64 magic_number = 1;  /* Must be the first field, set to value in MagicNumber */
40*90c8c64dSAndroid Build Coastguard Worker    repeated LayersTraceProto entry = 2;
41*90c8c64dSAndroid Build Coastguard Worker
42*90c8c64dSAndroid Build Coastguard Worker    /* offset between real-time clock and elapsed time clock in nanoseconds.
43*90c8c64dSAndroid Build Coastguard Worker       Calculated as: systemTime(SYSTEM_TIME_REALTIME) - systemTime(SYSTEM_TIME_MONOTONIC) */
44*90c8c64dSAndroid Build Coastguard Worker    optional fixed64 real_to_elapsed_time_offset_nanos = 3;
45*90c8c64dSAndroid Build Coastguard Worker}
46*90c8c64dSAndroid Build Coastguard Worker
47*90c8c64dSAndroid Build Coastguard Worker/* one layers trace entry. */
48*90c8c64dSAndroid Build Coastguard Workermessage LayersTraceProto {
49*90c8c64dSAndroid Build Coastguard Worker    /* required: elapsed realtime in nanos since boot of when this entry was logged */
50*90c8c64dSAndroid Build Coastguard Worker    optional sfixed64 elapsed_realtime_nanos = 1;
51*90c8c64dSAndroid Build Coastguard Worker
52*90c8c64dSAndroid Build Coastguard Worker    /* where the trace originated */
53*90c8c64dSAndroid Build Coastguard Worker    optional string where = 2;
54*90c8c64dSAndroid Build Coastguard Worker
55*90c8c64dSAndroid Build Coastguard Worker    optional LayersProto layers = 3;
56*90c8c64dSAndroid Build Coastguard Worker
57*90c8c64dSAndroid Build Coastguard Worker    // Blob for the current HWC information for all layers, reported by dumpsys.
58*90c8c64dSAndroid Build Coastguard Worker    optional string hwc_blob = 4;
59*90c8c64dSAndroid Build Coastguard Worker
60*90c8c64dSAndroid Build Coastguard Worker    /* Includes state sent during composition like visible region and composition type. */
61*90c8c64dSAndroid Build Coastguard Worker    optional bool excludes_composition_state = 5;
62*90c8c64dSAndroid Build Coastguard Worker
63*90c8c64dSAndroid Build Coastguard Worker    /* Number of missed entries since the last entry was recorded. */
64*90c8c64dSAndroid Build Coastguard Worker    optional uint32 missed_entries = 6;
65*90c8c64dSAndroid Build Coastguard Worker
66*90c8c64dSAndroid Build Coastguard Worker    repeated DisplayProto displays = 7;
67*90c8c64dSAndroid Build Coastguard Worker
68*90c8c64dSAndroid Build Coastguard Worker    optional int64 vsync_id = 8;
69*90c8c64dSAndroid Build Coastguard Worker}
70