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