Adrian Roos | 1e1a128 | 2017-11-01 19:05:31 +0100 | [diff] [blame] | 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 | |
| 17 | syntax = "proto2"; |
| 18 | option optimize_for = LITE_RUNTIME; |
| 19 | |
| 20 | import "frameworks/native/services/surfaceflinger/layerproto/layers.proto"; |
chaviw | 0a39899 | 2021-08-13 10:13:01 -0500 | [diff] [blame] | 21 | import "frameworks/native/services/surfaceflinger/layerproto/display.proto"; |
Adrian Roos | 1e1a128 | 2017-11-01 19:05:31 +0100 | [diff] [blame] | 22 | |
| 23 | package android.surfaceflinger; |
| 24 | |
| 25 | /* represents a file full of surface flinger trace entries. |
| 26 | Encoded, it should start with 0x4c 0x59 0x52 0x54 0x52 0x41 0x43 0x45 (.LYRTRACE), such |
| 27 | that they can be easily identified. */ |
| 28 | message LayersTraceFileProto { |
| 29 | |
| 30 | /* constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 | MagicNumber.MAGIC_NUMBER_L |
| 31 | (this is needed because enums have to be 32 bits and there's no nice way to put 64bit |
| 32 | constants into .proto files. */ |
| 33 | enum MagicNumber { |
| 34 | INVALID = 0; |
| 35 | MAGIC_NUMBER_L = 0x5452594c; /* LYRT (little-endian ASCII) */ |
| 36 | MAGIC_NUMBER_H = 0x45434152; /* RACE (little-endian ASCII) */ |
| 37 | } |
| 38 | |
| 39 | optional fixed64 magic_number = 1; /* Must be the first field, set to value in MagicNumber */ |
| 40 | repeated LayersTraceProto entry = 2; |
Kean Mariotti | c44fdaf | 2022-07-29 14:20:39 +0000 | [diff] [blame] | 41 | |
| 42 | /* offset between real-time clock and elapsed time clock in nanoseconds. |
| 43 | Calculated as: systemTime(SYSTEM_TIME_REALTIME) - systemTime(SYSTEM_TIME_MONOTONIC) */ |
| 44 | optional fixed64 real_to_elapsed_time_offset_nanos = 3; |
Adrian Roos | 1e1a128 | 2017-11-01 19:05:31 +0100 | [diff] [blame] | 45 | } |
| 46 | |
Pablo Gamito | b877579 | 2022-06-10 15:02:42 +0000 | [diff] [blame] | 47 | /* one layers trace entry. */ |
Adrian Roos | 1e1a128 | 2017-11-01 19:05:31 +0100 | [diff] [blame] | 48 | message LayersTraceProto { |
| 49 | /* required: elapsed realtime in nanos since boot of when this entry was logged */ |
Vishnu Nair | 31a8dbc | 2020-10-27 17:37:49 -0700 | [diff] [blame] | 50 | optional sfixed64 elapsed_realtime_nanos = 1; |
Adrian Roos | 1e1a128 | 2017-11-01 19:05:31 +0100 | [diff] [blame] | 51 | |
| 52 | /* where the trace originated */ |
| 53 | optional string where = 2; |
| 54 | |
| 55 | optional LayersProto layers = 3; |
Alec Mouri | 6b9e991 | 2020-01-21 10:50:24 -0800 | [diff] [blame] | 56 | |
| 57 | // Blob for the current HWC information for all layers, reported by dumpsys. |
| 58 | optional string hwc_blob = 4; |
Vishnu Nair | 60db8c0 | 2020-04-02 11:55:16 -0700 | [diff] [blame] | 59 | |
| 60 | /* Includes state sent during composition like visible region and composition type. */ |
| 61 | optional bool excludes_composition_state = 5; |
| 62 | |
| 63 | /* Number of missed entries since the last entry was recorded. */ |
Vishnu Nair | 31a8dbc | 2020-10-27 17:37:49 -0700 | [diff] [blame] | 64 | optional uint32 missed_entries = 6; |
chaviw | 0a39899 | 2021-08-13 10:13:01 -0500 | [diff] [blame] | 65 | |
| 66 | repeated DisplayProto displays = 7; |
Pablo Gamito | b877579 | 2022-06-10 15:02:42 +0000 | [diff] [blame] | 67 | |
| 68 | optional int64 vsync_id = 8; |
Adrian Roos | 1e1a128 | 2017-11-01 19:05:31 +0100 | [diff] [blame] | 69 | } |