1
2syntax = "proto2";
3
4option java_package = "com.google.common.logging";
5
6option optimize_for = LITE_RUNTIME;
7
8package 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.
13message 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.
31message 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.
44message 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  // On-device symbolized entries.
52  repeated string symbol = 3;
53}
54
55// All samples for a load_module.
56message LoadModuleSamples {
57  optional int32 load_module_id = 1;
58
59  // Map from a stack of addresses to count.
60  repeated AddressSample address_samples = 2;
61
62  // Map from a range triplet (start, end, to) to count.
63  repeated RangeSample range_samples = 3;
64}
65
66// A table of program names.
67message ProcessNames {
68  repeated string name = 1;
69}
70
71// All samples for a program.
72message ProgramSamples {
73  // Name of the program.
74  optional string name = 1;
75
76  // Load module profiles.
77  repeated LoadModuleSamples modules = 2;
78
79  // Index into ProcessNames for the name of the process.
80  optional uint32 process_name_id = 3;
81}
82
83// A compressed representation of a perf profile, which contains samples from
84// multiple binaries.
85message AndroidPerfProfile {
86
87  // Type of the hardware event.
88  enum EventType {
89    CYCLE = 0;
90    BRANCH = 1;
91  }
92  // Hardware event used in profiling.
93  optional EventType event = 1;
94
95  // Total number of samples in this profile.
96  // This is the sum of counts of address_samples and range_samples in all
97  // load_module_samples.
98  optional int64 total_samples = 2;
99
100  // Samples for all profiled programs.
101  repeated ProgramSamples programs = 3;
102
103  // List of all load modules.
104  repeated LoadModule load_modules = 4;
105
106  // Table of process names.
107  optional ProcessNames process_names = 11;
108
109  // is device screen on at point when profile is collected?
110  optional bool display_on = 5;
111
112  // system load at point when profile is collected; corresponds
113  // to first value from /proc/loadavg multiplied by 100 then
114  // converted to int32
115  optional int32 sys_load_average = 6;
116
117  // At the point when the profile was collected, was a camera active?
118  optional bool camera_active = 7;
119
120  // At the point when the profile was collected, was the device still booting?
121  optional bool booting = 8;
122
123  // At the point when the profile was collected, was the device plugged into
124  // a charger?
125  optional bool on_charger = 9;
126
127  // CPU utilization measured prior to profile collection (expressed as
128  // 100 minus the idle percentage).
129  optional int32 cpu_utilization = 10;
130
131}
132