• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1// Copyright (c) 2021 Huawei Device Co., Ltd.
2// Licensed under the Apache License, Version 2.0 (the "License");
3// you may not use this file except in compliance with the License.
4// You may obtain a copy of the License at
5//
6//     http://www.apache.org/licenses/LICENSE-2.0
7//
8// Unless required by applicable law or agreed to in writing, software
9// distributed under the License is distributed on an "AS IS" BASIS,
10// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
11// See the License for the specific language governing permissions and
12// limitations under the License.
13
14// report_sample.proto format:
15// char magic[10] = "HIPERF_PB_";
16// LittleEndian16(version) = 1;
17// LittleEndian32(sample_size)
18// message Record(sample)
19// LittleEndian32(sample_size)
20// message Record(sample)
21// ...
22// LittleEndian32(sample_size)
23// message Record(sample)
24// LittleEndian32(0)
25
26syntax = "proto2";
27option optimize_for = LITE_RUNTIME;
28package OHOS.Developtools.Hiperf.Proto;
29
30message CallStackSample {
31  optional uint64 time = 1;
32  optional uint32 tid = 2;
33
34  message CallStackFrame {
35    // virtual address of the instruction in symbols file
36    optional uint64 symbols_vaddr = 1;
37
38    // index of index of SymbolTableFile::id, base from 0
39    optional uint32 symbols_file_id = 2;
40
41    // index of SymbolTableFile::symbol_name, base from 0
42    // -1 means not found
43    optional int32 function_name_id = 3;
44  }
45
46  repeated CallStackFrame callStackFrame = 3;
47
48  // not include lost
49  optional uint64 event_count = 4;
50
51  // index of ReportInfo::config_name
52  optional uint32 config_name_id = 5;
53}
54
55message SampleStatistic {
56  optional uint64 count = 1;
57  optional uint64 lost = 2;
58}
59
60message SymbolTableFile {
61  // unique id , start from 0
62  optional uint32 id = 1;
63
64  // symbols file path, like developtools/hiperf/hiperf
65  optional string path = 2;
66
67  // function symbol table of the file (always mangled).
68  repeated string function_name = 3;
69
70}
71
72message VirtualThreadInfo {
73  optional uint32 tid = 1;
74  optional uint32 pid = 2;
75  optional string name = 3;
76}
77
78message ReportInfo {
79  repeated string config_name = 1;
80  optional string workload_cmd = 2;
81}
82
83message HiperfRecord {
84  oneof RecordType {
85    CallStackSample sample = 1;
86    SampleStatistic statistic = 2;
87    SymbolTableFile file = 3;
88    VirtualThreadInfo thread = 4;
89    ReportInfo info= 5;
90  }
91}