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