layerstrace.proto 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  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. syntax = "proto2";
  17. option optimize_for = LITE_RUNTIME;
  18. import "frameworks/native/services/surfaceflinger/layerproto/layers.proto";
  19. package android.surfaceflinger;
  20. /* represents a file full of surface flinger trace entries.
  21. Encoded, it should start with 0x4c 0x59 0x52 0x54 0x52 0x41 0x43 0x45 (.LYRTRACE), such
  22. that they can be easily identified. */
  23. message LayersTraceFileProto {
  24. /* constant; MAGIC_NUMBER = (long) MAGIC_NUMBER_H << 32 | MagicNumber.MAGIC_NUMBER_L
  25. (this is needed because enums have to be 32 bits and there's no nice way to put 64bit
  26. constants into .proto files. */
  27. enum MagicNumber {
  28. INVALID = 0;
  29. MAGIC_NUMBER_L = 0x5452594c; /* LYRT (little-endian ASCII) */
  30. MAGIC_NUMBER_H = 0x45434152; /* RACE (little-endian ASCII) */
  31. }
  32. optional fixed64 magic_number = 1; /* Must be the first field, set to value in MagicNumber */
  33. repeated LayersTraceProto entry = 2;
  34. }
  35. /* one window manager trace entry. */
  36. message LayersTraceProto {
  37. /* required: elapsed realtime in nanos since boot of when this entry was logged */
  38. optional fixed64 elapsed_realtime_nanos = 1;
  39. /* where the trace originated */
  40. optional string where = 2;
  41. optional LayersProto layers = 3;
  42. }