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 | |
| 6 | package wireless_android_play_playlog; |
| 7 | |
| 8 | // An entry of the map from a stack of addresses to count. |
| 9 | // Address here is the offset of the instruction address to the load address |
| 10 | // of the load_module. |
| 11 | message AddressSample { |
| 12 | // List of addresses that represents a call stack. |
| 13 | // address[0] is the leaf of the call stack. |
| 14 | repeated uint64 address = 1; |
| 15 | |
| 16 | // List of load_module_ids that represents a call stack. |
| 17 | // load_module_id[0] is the leaf of the call stack. |
| 18 | // This field can be set as empty if all frame share the same load_module_id |
| 19 | // with LoadModuleSamples.load_module_id. |
| 20 | repeated int32 load_module_id = 2; |
| 21 | |
| 22 | // Total count that the address/address_range is sampled. |
| 23 | optional int64 count = 3; |
| 24 | }; |
| 25 | |
| 26 | // An entry of the map from address_range to count. |
| 27 | // [start, end] represents the range of addresses, end->to represents the |
| 28 | // taken branch that ends the range. |
| 29 | message RangeSample { |
| 30 | // Start instruction address of a range. |
| 31 | optional uint64 start = 1; |
| 32 | |
| 33 | // If "end" and "to" is not provided, "start" represents a single instruction. |
| 34 | optional uint64 end = 2; |
| 35 | optional uint64 to = 3; |
| 36 | |
| 37 | // Total count that the address/address_range is sampled. |
| 38 | optional int64 count = 4; |
| 39 | }; |
| 40 | |
| 41 | // A load module. |
| 42 | message LoadModule { |
| 43 | // Name of the load_module. |
| 44 | optional string name = 1; |
| 45 | |
| 46 | // LoadModule's linker build_id. |
| 47 | optional string build_id = 2; |
| 48 | } |
| 49 | |
| 50 | // All samples for a load_module. |
| 51 | message LoadModuleSamples { |
| 52 | optional int32 load_module_id = 1; |
| 53 | |
| 54 | // Map from a stack of addresses to count. |
| 55 | repeated AddressSample address_samples = 2; |
| 56 | |
| 57 | // Map from a range triplet (start, end, to) to count. |
| 58 | repeated RangeSample range_samples = 3; |
| 59 | } |
| 60 | |
| 61 | // All samples for a program. |
| 62 | message ProgramSamples { |
| 63 | // Name of the program. |
| 64 | optional string name = 1; |
| 65 | |
| 66 | // Load module profiles. |
| 67 | repeated LoadModuleSamples modules = 2; |
| 68 | } |
| 69 | |
| 70 | // A compressed representation of a perf profile, which contains samples from |
| 71 | // multiple binaries. |
| 72 | message AndroidPerfProfile { |
| 73 | |
| 74 | // Type of the hardware event. |
| 75 | enum EventType { |
| 76 | CYCLE = 0; |
| 77 | BRANCH = 1; |
| 78 | } |
| 79 | // Hardware event used in profiling. |
| 80 | optional EventType event = 1; |
| 81 | |
| 82 | // Total number of samples in this profile. |
| 83 | // This is the sum of counts of address_samples and range_samples in all |
| 84 | // load_module_samples. |
| 85 | optional int64 total_samples = 2; |
| 86 | |
| 87 | // Samples for all profiled programs. |
| 88 | repeated ProgramSamples programs = 3; |
| 89 | |
| 90 | // List of all load modules. |
| 91 | repeated LoadModule load_modules = 4; |
| 92 | } |