pyroscope_rbspy_oncpu/ui/
perftools.profiles.rs

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