pprof_proto/perfetto.third_party.perftools.profiles.rs
1#[derive(Clone, PartialEq, ::prost::Message)]
2pub struct Profile {
3 /// A description of the samples associated with each Sample.value.
4 /// For a cpu profile this might be:
5 /// \[["cpu","nanoseconds"]\] or \[["wall","seconds"]\] or \[["syscall","count"]\]
6 /// For a heap profile, this might be:
7 /// \[["allocations","count"\], \["space","bytes"]\],
8 /// If one of the values represents the number of events represented
9 /// by the sample, by convention it should be at index 0 and use
10 /// sample_type.unit == "count".
11 #[prost(message, repeated, tag="1")]
12 pub sample_type: ::prost::alloc::vec::Vec<ValueType>,
13 /// The set of samples recorded in this profile.
14 #[prost(message, repeated, tag="2")]
15 pub sample: ::prost::alloc::vec::Vec<Sample>,
16 /// Mapping from address ranges to the image/binary/library mapped
17 /// into that address range. mapping\[0\] will be the main binary.
18 #[prost(message, repeated, tag="3")]
19 pub mapping: ::prost::alloc::vec::Vec<Mapping>,
20 /// Useful program location
21 #[prost(message, repeated, tag="4")]
22 pub location: ::prost::alloc::vec::Vec<Location>,
23 /// Functions referenced by locations
24 #[prost(message, repeated, tag="5")]
25 pub function: ::prost::alloc::vec::Vec<Function>,
26 /// A common table for strings referenced by various messages.
27 /// string_table\[0\] must always be "".
28 #[prost(string, repeated, tag="6")]
29 pub string_table: ::prost::alloc::vec::Vec<::prost::alloc::string::String>,
30 /// frames with Function.function_name fully matching the following
31 /// regexp will be dropped from the samples, along with their successors.
32 /// Index into string table.
33 #[prost(int64, tag="7")]
34 pub drop_frames: i64,
35 /// frames with Function.function_name fully matching the following
36 /// regexp will be kept, even if it matches drop_functions.
37 /// Index into string table.
38 #[prost(int64, tag="8")]
39 pub keep_frames: i64,
40 // The following fields are informational, do not affect
41 // interpretation of results.
42
43 /// Time of collection (UTC) represented as nanoseconds past the epoch.
44 #[prost(int64, tag="9")]
45 pub time_nanos: i64,
46 /// Duration of the profile, if a duration makes sense.
47 #[prost(int64, tag="10")]
48 pub duration_nanos: i64,
49 /// The kind of events between sampled ocurrences.
50 /// e.g [ "cpu","cycles" ] or [ "heap","bytes" ]
51 #[prost(message, optional, tag="11")]
52 pub period_type: ::core::option::Option<ValueType>,
53 /// The number of events between sampled occurrences.
54 #[prost(int64, tag="12")]
55 pub period: i64,
56 /// Freeform text associated to the profile.
57 /// Indices into string table.
58 #[prost(int64, repeated, tag="13")]
59 pub comment: ::prost::alloc::vec::Vec<i64>,
60 /// Index into the string table of the type of the preferred sample
61 /// value. If unset, clients should default to the last sample value.
62 #[prost(int64, tag="14")]
63 pub default_sample_type: i64,
64}
65/// ValueType describes the semantics and measurement units of a value.
66#[derive(Clone, PartialEq, ::prost::Message)]
67pub struct ValueType {
68 /// Index into string table.
69 #[prost(int64, tag="1")]
70 pub r#type: i64,
71 /// Index into string table.
72 #[prost(int64, tag="2")]
73 pub unit: i64,
74}
75/// Each Sample records values encountered in some program
76/// context. The program context is typically a stack trace, perhaps
77/// augmented with auxiliary information like the thread-id, some
78/// indicator of a higher level request being handled etc.
79#[derive(Clone, PartialEq, ::prost::Message)]
80pub struct Sample {
81 /// The ids recorded here correspond to a Profile.location.id.
82 /// The leaf is at location_id\[0\].
83 #[prost(uint64, repeated, tag="1")]
84 pub location_id: ::prost::alloc::vec::Vec<u64>,
85 /// The type and unit of each value is defined by the corresponding
86 /// entry in Profile.sample_type. All samples must have the same
87 /// number of values, the same as the length of Profile.sample_type.
88 /// When aggregating multiple samples into a single sample, the
89 /// result has a list of values that is the elemntwise sum of the
90 /// lists of the originals.
91 #[prost(int64, repeated, tag="2")]
92 pub value: ::prost::alloc::vec::Vec<i64>,
93 /// label includes additional context for this sample. It can include
94 /// things like a thread id, allocation size, etc
95 #[prost(message, repeated, tag="3")]
96 pub label: ::prost::alloc::vec::Vec<Label>,
97}
98#[derive(Clone, PartialEq, ::prost::Message)]
99pub struct Label {
100 /// Index into string table
101 #[prost(int64, tag="1")]
102 pub key: i64,
103 // At most one of the following must be present
104
105 /// Index into string table
106 #[prost(int64, tag="2")]
107 pub str: i64,
108 #[prost(int64, tag="3")]
109 pub num: i64,
110 // Should only be present when num is present.
111 // Specifies the units of num.
112 // Use arbitrary string (for example, "requests") as a custom count unit.
113 // If no unit is specified, consumer may apply heuristic to deduce the unit.
114 // Consumers may also interpret units like "bytes" and "kilobytes" as memory
115 // units and units like "seconds" and "nanoseconds" as time units,
116 // and apply appropriate unit conversions to these.
117
118 /// Index into string table
119 #[prost(int64, tag="4")]
120 pub num_unit: i64,
121}
122#[derive(Clone, PartialEq, ::prost::Message)]
123pub struct Mapping {
124 /// Unique nonzero id for the mapping.
125 #[prost(uint64, tag="1")]
126 pub id: u64,
127 /// Address at which the binary (or DLL) is loaded into memory.
128 #[prost(uint64, tag="2")]
129 pub memory_start: u64,
130 /// The limit of the address range occupied by this mapping.
131 #[prost(uint64, tag="3")]
132 pub memory_limit: u64,
133 /// Offset in the binary that corresponds to the first mapped address.
134 #[prost(uint64, tag="4")]
135 pub file_offset: u64,
136 /// The object this entry is loaded from. This can be a filename on
137 /// disk for the main binary and shared libraries, or virtual
138 /// abstractions like "\[vdso\]".
139 /// Index into string table
140 #[prost(int64, tag="5")]
141 pub filename: i64,
142 /// A string that uniquely identifies a particular program version
143 /// with high probability. E.g., for binaries generated by GNU tools,
144 /// it could be the contents of the .note.gnu.build-id field.
145 /// Index into string table
146 #[prost(int64, tag="6")]
147 pub build_id: i64,
148 /// The following fields indicate the resolution of symbolic info.
149 #[prost(bool, tag="7")]
150 pub has_functions: bool,
151 #[prost(bool, tag="8")]
152 pub has_filenames: bool,
153 #[prost(bool, tag="9")]
154 pub has_line_numbers: bool,
155 #[prost(bool, tag="10")]
156 pub has_inline_frames: bool,
157}
158/// Describes function and line table debug information.
159#[derive(Clone, PartialEq, ::prost::Message)]
160pub struct Location {
161 /// Unique nonzero id for the location. A profile could use
162 /// instruction addresses or any integer sequence as ids.
163 #[prost(uint64, tag="1")]
164 pub id: u64,
165 /// The id of the corresponding profile.Mapping for this location.
166 /// It can be unset if the mapping is unknown or not applicable for
167 /// this profile type.
168 #[prost(uint64, tag="2")]
169 pub mapping_id: u64,
170 /// The instruction address for this location, if available. It
171 /// should be within \[Mapping.memory_start...Mapping.memory_limit\]
172 /// for the corresponding mapping. A non-leaf address may be in the
173 /// middle of a call instruction. It is up to display tools to find
174 /// the beginning of the instruction if necessary.
175 #[prost(uint64, tag="3")]
176 pub address: u64,
177 /// Multiple line indicates this location has inlined functions,
178 /// where the last entry represents the caller into which the
179 /// preceding entries were inlined.
180 ///
181 /// E.g., if memcpy() is inlined into printf:
182 /// line\[0\].function_name == "memcpy"
183 /// line\[1\].function_name == "printf"
184 #[prost(message, repeated, tag="4")]
185 pub line: ::prost::alloc::vec::Vec<Line>,
186 /// Provides an indication that multiple symbols map to this location's
187 /// address, for example due to identical code folding by the linker. In that
188 /// case the line information above represents one of the multiple
189 /// symbols. This field must be recomputed when the symbolization state of the
190 /// profile changes.
191 #[prost(bool, tag="5")]
192 pub is_folded: bool,
193}
194#[derive(Clone, PartialEq, ::prost::Message)]
195pub struct Line {
196 /// The id of the corresponding profile.Function for this line.
197 #[prost(uint64, tag="1")]
198 pub function_id: u64,
199 /// Line number in source code.
200 #[prost(int64, tag="2")]
201 pub line: i64,
202}
203#[derive(Clone, PartialEq, ::prost::Message)]
204pub struct Function {
205 /// Unique nonzero id for the function.
206 #[prost(uint64, tag="1")]
207 pub id: u64,
208 /// Name of the function, in human-readable form if available.
209 /// Index into string table
210 #[prost(int64, tag="2")]
211 pub name: i64,
212 /// Name of the function, as identified by the system.
213 /// For instance, it can be a C++ mangled name.
214 /// Index into string table
215 #[prost(int64, tag="3")]
216 pub system_name: i64,
217 /// Source file containing the function.
218 /// Index into string table
219 #[prost(int64, tag="4")]
220 pub filename: i64,
221 /// Line number in source file.
222 #[prost(int64, tag="5")]
223 pub start_line: i64,
224}