perf_profile.proto 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131
  1. syntax = "proto2";
  2. option java_package = "com.google.common.logging";
  3. option optimize_for = LITE_RUNTIME;
  4. package wireless_android_play_playlog;
  5. // An entry of the map from a stack of addresses to count.
  6. // Address here is the offset of the instruction address to the load address
  7. // of the load_module.
  8. message AddressSample {
  9. // List of addresses that represents a call stack.
  10. // address[0] is the leaf of the call stack.
  11. repeated uint64 address = 1;
  12. // List of load_module_ids that represents a call stack.
  13. // load_module_id[0] is the leaf of the call stack.
  14. // This field can be set as empty if all frame share the same load_module_id
  15. // with LoadModuleSamples.load_module_id.
  16. repeated int32 load_module_id = 2;
  17. // Total count that the address/address_range is sampled.
  18. optional int64 count = 3;
  19. };
  20. // An entry of the map from address_range to count.
  21. // [start, end] represents the range of addresses, end->to represents the
  22. // taken branch that ends the range.
  23. message RangeSample {
  24. // Start instruction address of a range.
  25. optional uint64 start = 1;
  26. // If "end" and "to" is not provided, "start" represents a single instruction.
  27. optional uint64 end = 2;
  28. optional uint64 to = 3;
  29. // Total count that the address/address_range is sampled.
  30. optional int64 count = 4;
  31. };
  32. // A load module.
  33. message LoadModule {
  34. // Name of the load_module.
  35. optional string name = 1;
  36. // LoadModule's linker build_id.
  37. optional string build_id = 2;
  38. // On-device symbolized entries.
  39. repeated string symbol = 3;
  40. }
  41. // All samples for a load_module.
  42. message LoadModuleSamples {
  43. optional int32 load_module_id = 1;
  44. // Map from a stack of addresses to count.
  45. repeated AddressSample address_samples = 2;
  46. // Map from a range triplet (start, end, to) to count.
  47. repeated RangeSample range_samples = 3;
  48. }
  49. // A table of program names.
  50. message ProcessNames {
  51. repeated string name = 1;
  52. }
  53. // All samples for a program.
  54. message ProgramSamples {
  55. // Name of the program.
  56. optional string name = 1;
  57. // Load module profiles.
  58. repeated LoadModuleSamples modules = 2;
  59. // Index into ProcessNames for the name of the process.
  60. optional uint32 process_name_id = 3;
  61. }
  62. // A compressed representation of a perf profile, which contains samples from
  63. // multiple binaries.
  64. message AndroidPerfProfile {
  65. // Type of the hardware event.
  66. enum EventType {
  67. CYCLE = 0;
  68. BRANCH = 1;
  69. }
  70. // Hardware event used in profiling.
  71. optional EventType event = 1;
  72. // Total number of samples in this profile.
  73. // This is the sum of counts of address_samples and range_samples in all
  74. // load_module_samples.
  75. optional int64 total_samples = 2;
  76. // Samples for all profiled programs.
  77. repeated ProgramSamples programs = 3;
  78. // List of all load modules.
  79. repeated LoadModule load_modules = 4;
  80. // Table of process names.
  81. optional ProcessNames process_names = 11;
  82. // is device screen on at point when profile is collected?
  83. optional bool display_on = 5;
  84. // system load at point when profile is collected; corresponds
  85. // to first value from /proc/loadavg multiplied by 100 then
  86. // converted to int32
  87. optional int32 sys_load_average = 6;
  88. // At the point when the profile was collected, was a camera active?
  89. optional bool camera_active = 7;
  90. // At the point when the profile was collected, was the device still booting?
  91. optional bool booting = 8;
  92. // At the point when the profile was collected, was the device plugged into
  93. // a charger?
  94. optional bool on_charger = 9;
  95. // CPU utilization measured prior to profile collection (expressed as
  96. // 100 minus the idle percentage).
  97. optional int32 cpu_utilization = 10;
  98. }