Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
profile_common.pbzero.h
Go to the documentation of this file.
1// Copyright (c) 2023, the Dart project authors. Please see the AUTHORS file
2// for details. All rights reserved. Use of this source code is governed by a
3// BSD-style license that can be found in the LICENSE file.
4
5// IMPORTANT: This file should only ever be modified by modifying the
6// corresponding .proto file and then running
7// `dart runtime/vm/protos/tools/compile_perfetto_protos.dart` from the SDK root
8// directory.
9// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
10
11#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_COMMON_PROTO_H_
12#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_COMMON_PROTO_H_
13
14#include <stddef.h>
15#include <stdint.h>
16
17#include "perfetto/protozero/field_writer.h"
18#include "perfetto/protozero/message.h"
19#include "perfetto/protozero/packed_repeated_fields.h"
20#include "perfetto/protozero/proto_decoder.h"
21#include "perfetto/protozero/proto_utils.h"
22
23namespace perfetto {
24namespace protos {
25namespace pbzero {
26
27class Callstack_Decoder : public ::protozero::TypedProtoDecoder<
28 /*MAX_FIELD_ID=*/2,
29 /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
30 public:
31 Callstack_Decoder(const uint8_t* data, size_t len)
32 : TypedProtoDecoder(data, len) {}
33 explicit Callstack_Decoder(const std::string& raw)
34 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
35 raw.size()) {}
36 explicit Callstack_Decoder(const ::protozero::ConstBytes& raw)
37 : TypedProtoDecoder(raw.data, raw.size) {}
38 bool has_iid() const { return at<1>().valid(); }
39 uint64_t iid() const { return at<1>().as_uint64(); }
40 bool has_frame_ids() const { return at<2>().valid(); }
41 ::protozero::RepeatedFieldIterator<uint64_t> frame_ids() const {
42 return GetRepeated<uint64_t>(2);
43 }
44};
45
46class Callstack : public ::protozero::Message {
47 public:
49 enum : int32_t {
52 };
53 static constexpr const char* GetName() {
54 return ".perfetto.protos.Callstack";
55 }
56
57 using FieldMetadata_Iid = ::protozero::proto_utils::FieldMetadata<
58 1,
59 ::protozero::proto_utils::RepetitionType::kNotRepeated,
60 ::protozero::proto_utils::ProtoSchemaType::kUint64,
61 uint64_t,
62 Callstack>;
63
64 // Ceci n'est pas une pipe.
65 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
66 // type (and users are expected to use it as such, hence kCamelCase name).
67 // It is declared as a function to keep protozero bindings header-only as
68 // inline constexpr variables are not available until C++17 (while inline
69 // functions are).
70 // TODO(altimin): Use inline variable instead after adopting C++17.
71 static constexpr FieldMetadata_Iid kIid() { return {}; }
72 void set_iid(uint64_t value) {
73 static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
74 // Call the appropriate protozero::Message::Append(field_id, ...)
75 // method based on the type of the field.
76 ::protozero::internal::FieldWriter<
77 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
78 field_id,
79 value);
80 }
81
82 using FieldMetadata_FrameIds = ::protozero::proto_utils::FieldMetadata<
83 2,
84 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
85 ::protozero::proto_utils::ProtoSchemaType::kUint64,
86 uint64_t,
87 Callstack>;
88
89 // Ceci n'est pas une pipe.
90 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
91 // type (and users are expected to use it as such, hence kCamelCase name).
92 // It is declared as a function to keep protozero bindings header-only as
93 // inline constexpr variables are not available until C++17 (while inline
94 // functions are).
95 // TODO(altimin): Use inline variable instead after adopting C++17.
96 static constexpr FieldMetadata_FrameIds kFrameIds() { return {}; }
97 void add_frame_ids(uint64_t value) {
98 static constexpr uint32_t field_id = FieldMetadata_FrameIds::kFieldId;
99 // Call the appropriate protozero::Message::Append(field_id, ...)
100 // method based on the type of the field.
101 ::protozero::internal::FieldWriter<
102 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
103 field_id,
104 value);
105 }
106};
107
108class Frame_Decoder : public ::protozero::TypedProtoDecoder<
109 /*MAX_FIELD_ID=*/4,
110 /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
111 public:
112 Frame_Decoder(const uint8_t* data, size_t len)
113 : TypedProtoDecoder(data, len) {}
114 explicit Frame_Decoder(const std::string& raw)
115 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
116 raw.size()) {}
117 explicit Frame_Decoder(const ::protozero::ConstBytes& raw)
118 : TypedProtoDecoder(raw.data, raw.size) {}
119 bool has_iid() const { return at<1>().valid(); }
120 uint64_t iid() const { return at<1>().as_uint64(); }
121 bool has_function_name_id() const { return at<2>().valid(); }
122 uint64_t function_name_id() const { return at<2>().as_uint64(); }
123 bool has_mapping_id() const { return at<3>().valid(); }
124 uint64_t mapping_id() const { return at<3>().as_uint64(); }
125 bool has_rel_pc() const { return at<4>().valid(); }
126 uint64_t rel_pc() const { return at<4>().as_uint64(); }
127};
128
129class Frame : public ::protozero::Message {
130 public:
132 enum : int32_t {
137 };
138 static constexpr const char* GetName() { return ".perfetto.protos.Frame"; }
139
140 using FieldMetadata_Iid = ::protozero::proto_utils::FieldMetadata<
141 1,
142 ::protozero::proto_utils::RepetitionType::kNotRepeated,
143 ::protozero::proto_utils::ProtoSchemaType::kUint64,
144 uint64_t,
145 Frame>;
146
147 // Ceci n'est pas une pipe.
148 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
149 // type (and users are expected to use it as such, hence kCamelCase name).
150 // It is declared as a function to keep protozero bindings header-only as
151 // inline constexpr variables are not available until C++17 (while inline
152 // functions are).
153 // TODO(altimin): Use inline variable instead after adopting C++17.
154 static constexpr FieldMetadata_Iid kIid() { return {}; }
155 void set_iid(uint64_t value) {
156 static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
157 // Call the appropriate protozero::Message::Append(field_id, ...)
158 // method based on the type of the field.
159 ::protozero::internal::FieldWriter<
160 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
161 field_id,
162 value);
163 }
164
165 using FieldMetadata_FunctionNameId = ::protozero::proto_utils::FieldMetadata<
166 2,
167 ::protozero::proto_utils::RepetitionType::kNotRepeated,
168 ::protozero::proto_utils::ProtoSchemaType::kUint64,
169 uint64_t,
170 Frame>;
171
172 // Ceci n'est pas une pipe.
173 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
174 // type (and users are expected to use it as such, hence kCamelCase name).
175 // It is declared as a function to keep protozero bindings header-only as
176 // inline constexpr variables are not available until C++17 (while inline
177 // functions are).
178 // TODO(altimin): Use inline variable instead after adopting C++17.
179 static constexpr FieldMetadata_FunctionNameId kFunctionNameId() { return {}; }
180 void set_function_name_id(uint64_t value) {
181 static constexpr uint32_t field_id = FieldMetadata_FunctionNameId::kFieldId;
182 // Call the appropriate protozero::Message::Append(field_id, ...)
183 // method based on the type of the field.
184 ::protozero::internal::FieldWriter<
185 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
186 field_id,
187 value);
188 }
189
190 using FieldMetadata_MappingId = ::protozero::proto_utils::FieldMetadata<
191 3,
192 ::protozero::proto_utils::RepetitionType::kNotRepeated,
193 ::protozero::proto_utils::ProtoSchemaType::kUint64,
194 uint64_t,
195 Frame>;
196
197 // Ceci n'est pas une pipe.
198 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
199 // type (and users are expected to use it as such, hence kCamelCase name).
200 // It is declared as a function to keep protozero bindings header-only as
201 // inline constexpr variables are not available until C++17 (while inline
202 // functions are).
203 // TODO(altimin): Use inline variable instead after adopting C++17.
204 static constexpr FieldMetadata_MappingId kMappingId() { return {}; }
205 void set_mapping_id(uint64_t value) {
206 static constexpr uint32_t field_id = FieldMetadata_MappingId::kFieldId;
207 // Call the appropriate protozero::Message::Append(field_id, ...)
208 // method based on the type of the field.
209 ::protozero::internal::FieldWriter<
210 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
211 field_id,
212 value);
213 }
214
215 using FieldMetadata_RelPc = ::protozero::proto_utils::FieldMetadata<
216 4,
217 ::protozero::proto_utils::RepetitionType::kNotRepeated,
218 ::protozero::proto_utils::ProtoSchemaType::kUint64,
219 uint64_t,
220 Frame>;
221
222 // Ceci n'est pas une pipe.
223 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
224 // type (and users are expected to use it as such, hence kCamelCase name).
225 // It is declared as a function to keep protozero bindings header-only as
226 // inline constexpr variables are not available until C++17 (while inline
227 // functions are).
228 // TODO(altimin): Use inline variable instead after adopting C++17.
229 static constexpr FieldMetadata_RelPc kRelPc() { return {}; }
230 void set_rel_pc(uint64_t value) {
231 static constexpr uint32_t field_id = FieldMetadata_RelPc::kFieldId;
232 // Call the appropriate protozero::Message::Append(field_id, ...)
233 // method based on the type of the field.
234 ::protozero::internal::FieldWriter<
235 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
236 field_id,
237 value);
238 }
239};
240
241class Mapping_Decoder : public ::protozero::TypedProtoDecoder<
242 /*MAX_FIELD_ID=*/7,
243 /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
244 public:
245 Mapping_Decoder(const uint8_t* data, size_t len)
246 : TypedProtoDecoder(data, len) {}
247 explicit Mapping_Decoder(const std::string& raw)
248 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
249 raw.size()) {}
250 explicit Mapping_Decoder(const ::protozero::ConstBytes& raw)
251 : TypedProtoDecoder(raw.data, raw.size) {}
252 bool has_iid() const { return at<1>().valid(); }
253 uint64_t iid() const { return at<1>().as_uint64(); }
254 bool has_path_string_ids() const { return at<7>().valid(); }
255 ::protozero::RepeatedFieldIterator<uint64_t> path_string_ids() const {
256 return GetRepeated<uint64_t>(7);
257 }
258};
259
260class Mapping : public ::protozero::Message {
261 public:
263 enum : int32_t {
266 };
267 static constexpr const char* GetName() { return ".perfetto.protos.Mapping"; }
268
269 using FieldMetadata_Iid = ::protozero::proto_utils::FieldMetadata<
270 1,
271 ::protozero::proto_utils::RepetitionType::kNotRepeated,
272 ::protozero::proto_utils::ProtoSchemaType::kUint64,
273 uint64_t,
274 Mapping>;
275
276 // Ceci n'est pas une pipe.
277 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
278 // type (and users are expected to use it as such, hence kCamelCase name).
279 // It is declared as a function to keep protozero bindings header-only as
280 // inline constexpr variables are not available until C++17 (while inline
281 // functions are).
282 // TODO(altimin): Use inline variable instead after adopting C++17.
283 static constexpr FieldMetadata_Iid kIid() { return {}; }
284 void set_iid(uint64_t value) {
285 static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
286 // Call the appropriate protozero::Message::Append(field_id, ...)
287 // method based on the type of the field.
288 ::protozero::internal::FieldWriter<
289 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
290 field_id,
291 value);
292 }
293
294 using FieldMetadata_PathStringIds = ::protozero::proto_utils::FieldMetadata<
295 7,
296 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
297 ::protozero::proto_utils::ProtoSchemaType::kUint64,
298 uint64_t,
299 Mapping>;
300
301 // Ceci n'est pas une pipe.
302 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
303 // type (and users are expected to use it as such, hence kCamelCase name).
304 // It is declared as a function to keep protozero bindings header-only as
305 // inline constexpr variables are not available until C++17 (while inline
306 // functions are).
307 // TODO(altimin): Use inline variable instead after adopting C++17.
308 static constexpr FieldMetadata_PathStringIds kPathStringIds() { return {}; }
309 void add_path_string_ids(uint64_t value) {
310 static constexpr uint32_t field_id = FieldMetadata_PathStringIds::kFieldId;
311 // Call the appropriate protozero::Message::Append(field_id, ...)
312 // method based on the type of the field.
313 ::protozero::internal::FieldWriter<
314 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
315 field_id,
316 value);
317 }
318};
319
320class InternedString_Decoder : public ::protozero::TypedProtoDecoder<
321 /*MAX_FIELD_ID=*/2,
322 /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
323 public:
324 InternedString_Decoder(const uint8_t* data, size_t len)
325 : TypedProtoDecoder(data, len) {}
326 explicit InternedString_Decoder(const std::string& raw)
327 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
328 raw.size()) {}
329 explicit InternedString_Decoder(const ::protozero::ConstBytes& raw)
330 : TypedProtoDecoder(raw.data, raw.size) {}
331 bool has_iid() const { return at<1>().valid(); }
332 uint64_t iid() const { return at<1>().as_uint64(); }
333 bool has_str() const { return at<2>().valid(); }
334 ::protozero::ConstBytes str() const { return at<2>().as_bytes(); }
335};
336
337class InternedString : public ::protozero::Message {
338 public:
340 enum : int32_t {
343 };
344 static constexpr const char* GetName() {
345 return ".perfetto.protos.InternedString";
346 }
347
348 using FieldMetadata_Iid = ::protozero::proto_utils::FieldMetadata<
349 1,
350 ::protozero::proto_utils::RepetitionType::kNotRepeated,
351 ::protozero::proto_utils::ProtoSchemaType::kUint64,
352 uint64_t,
354
355 // Ceci n'est pas une pipe.
356 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
357 // type (and users are expected to use it as such, hence kCamelCase name).
358 // It is declared as a function to keep protozero bindings header-only as
359 // inline constexpr variables are not available until C++17 (while inline
360 // functions are).
361 // TODO(altimin): Use inline variable instead after adopting C++17.
362 static constexpr FieldMetadata_Iid kIid() { return {}; }
363 void set_iid(uint64_t value) {
364 static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
365 // Call the appropriate protozero::Message::Append(field_id, ...)
366 // method based on the type of the field.
367 ::protozero::internal::FieldWriter<
368 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*this,
369 field_id,
370 value);
371 }
372
373 using FieldMetadata_Str = ::protozero::proto_utils::FieldMetadata<
374 2,
375 ::protozero::proto_utils::RepetitionType::kNotRepeated,
376 ::protozero::proto_utils::ProtoSchemaType::kBytes,
377 std::string,
379
380 // Ceci n'est pas une pipe.
381 // This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
382 // type (and users are expected to use it as such, hence kCamelCase name).
383 // It is declared as a function to keep protozero bindings header-only as
384 // inline constexpr variables are not available until C++17 (while inline
385 // functions are).
386 // TODO(altimin): Use inline variable instead after adopting C++17.
387 static constexpr FieldMetadata_Str kStr() { return {}; }
388 void set_str(const uint8_t* data, size_t size) {
389 AppendBytes(FieldMetadata_Str::kFieldId, data, size);
390 }
391 void set_str(::protozero::ConstBytes bytes) {
392 AppendBytes(FieldMetadata_Str::kFieldId, bytes.data, bytes.size);
393 }
394 void set_str(std::string value) {
395 static constexpr uint32_t field_id = FieldMetadata_Str::kFieldId;
396 // Call the appropriate protozero::Message::Append(field_id, ...)
397 // method based on the type of the field.
398 ::protozero::internal::FieldWriter<
399 ::protozero::proto_utils::ProtoSchemaType::kBytes>::Append(*this,
400 field_id,
401 value);
402 }
403};
404
405} // namespace pbzero
406} // namespace protos
407} // namespace perfetto
408#endif // Include guard.
::protozero::RepeatedFieldIterator< uint64_t > frame_ids() const
Callstack_Decoder(const ::protozero::ConstBytes &raw)
Callstack_Decoder(const uint8_t *data, size_t len)
static constexpr FieldMetadata_Iid kIid()
static constexpr const char * GetName()
static constexpr FieldMetadata_FrameIds kFrameIds()
::protozero::proto_utils::FieldMetadata< 2, ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, Callstack > FieldMetadata_FrameIds
::protozero::proto_utils::FieldMetadata< 1, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, Callstack > FieldMetadata_Iid
Frame_Decoder(const uint8_t *data, size_t len)
Frame_Decoder(const ::protozero::ConstBytes &raw)
static constexpr FieldMetadata_Iid kIid()
::protozero::proto_utils::FieldMetadata< 4, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, Frame > FieldMetadata_RelPc
static constexpr FieldMetadata_MappingId kMappingId()
::protozero::proto_utils::FieldMetadata< 1, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, Frame > FieldMetadata_Iid
static constexpr FieldMetadata_RelPc kRelPc()
::protozero::proto_utils::FieldMetadata< 3, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, Frame > FieldMetadata_MappingId
static constexpr FieldMetadata_FunctionNameId kFunctionNameId()
static constexpr const char * GetName()
::protozero::proto_utils::FieldMetadata< 2, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, Frame > FieldMetadata_FunctionNameId
InternedString_Decoder(const uint8_t *data, size_t len)
InternedString_Decoder(const ::protozero::ConstBytes &raw)
::protozero::proto_utils::FieldMetadata< 1, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, InternedString > FieldMetadata_Iid
static constexpr FieldMetadata_Iid kIid()
void set_str(::protozero::ConstBytes bytes)
::protozero::proto_utils::FieldMetadata< 2, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kBytes, std::string, InternedString > FieldMetadata_Str
static constexpr FieldMetadata_Str kStr()
void set_str(const uint8_t *data, size_t size)
Mapping_Decoder(const ::protozero::ConstBytes &raw)
Mapping_Decoder(const uint8_t *data, size_t len)
::protozero::RepeatedFieldIterator< uint64_t > path_string_ids() const
::protozero::proto_utils::FieldMetadata< 7, ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, Mapping > FieldMetadata_PathStringIds
::protozero::proto_utils::FieldMetadata< 1, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, Mapping > FieldMetadata_Iid
static constexpr const char * GetName()
static constexpr FieldMetadata_PathStringIds kPathStringIds()
static constexpr FieldMetadata_Iid kIid()
uint8_t value