blob: 5e1d8605a516f874b56528be5b74ddda48a61387 [file] [log] [blame]
Yabin Cui42c8dc62016-06-03 15:06:53 -07001// The file format generated by report_sample.proto is as below:
2// LittleEndian32(record_size_0)
3// message Record(record_0) (having record_size_0 bytes)
4// LittleEndian32(record_size_1)
5// message Record(record_1) (having record_size_1 bytes)
6// ...
7// LittleEndian32(record_size_N)
8// message Record(record_N) (having record_size_N bytes)
9// LittleEndian32(0)
10
11syntax = "proto2";
12option optimize_for = LITE_RUNTIME;
13package simpleperf_report_proto;
Yabin Cui35df8632016-07-19 17:15:12 -070014option java_package = "com.android.tools.profiler.proto";
15option java_outer_classname = "SimpleperfReport";
Yabin Cui42c8dc62016-06-03 15:06:53 -070016
17message Sample {
Yabin Cui07ee9412017-05-02 13:25:21 -070018 // Wall clock time for current sample.
19 // By default, it is perf clock used in kernel.
Yabin Cui42c8dc62016-06-03 15:06:53 -070020 optional uint64 time = 1;
Yabin Cui16501ff2016-10-19 15:06:29 -070021 optional int32 thread_id = 2;
Yabin Cui42c8dc62016-06-03 15:06:53 -070022
23 message CallChainEntry {
Yabin Cui16501ff2016-10-19 15:06:29 -070024 // virtual address of the instruction in elf file
25 optional uint64 vaddr_in_file = 1;
26
27 // index of the elf file containing the instruction
28 optional uint32 file_id = 2;
29
30 // symbol_id refers to the name of the function containing the instruction.
31 // If the function name is found, it is a valid index in the symbol table
32 // of File with 'id' field being file_id, otherwise it is -1.
33 optional int32 symbol_id = 3;
Yabin Cui42c8dc62016-06-03 15:06:53 -070034 }
35
Yabin Cui16501ff2016-10-19 15:06:29 -070036 repeated CallChainEntry callchain = 3;
Yabin Cui07ee9412017-05-02 13:25:21 -070037
38 // Count of the events that have happened since last sample (regardless of
39 // whether the last sample is lost). The event type is decided by '-e' option
40 // in simpleperf record command. By default, '-e cpu-cycles' is used, and this
41 // field is the number of cpu cycles.
42 optional uint64 event_count = 4;
43
Yabin Cui42c8dc62016-06-03 15:06:53 -070044}
45
Yabin Cui587fb9b2016-07-26 19:49:15 -070046message LostSituation {
47 optional uint64 sample_count = 1;
48 optional uint64 lost_count = 2;
49}
50
Yabin Cui16501ff2016-10-19 15:06:29 -070051message File {
52 // unique id for each file, starting from 0, and add 1 each time.
53 optional uint32 id = 1;
54
55 // file path, like /system/lib/libc.so.
56 optional string path = 2;
57
58 // symbol table of the file.
59 repeated string symbol = 3;
60}
61
Yabin Cui42c8dc62016-06-03 15:06:53 -070062message Record {
Yabin Cui16501ff2016-10-19 15:06:29 -070063 oneof record_data {
64 Sample sample = 1;
65 LostSituation lost = 2;
66 File file = 3;
Yabin Cui42c8dc62016-06-03 15:06:53 -070067 }
Yabin Cui42c8dc62016-06-03 15:06:53 -070068}