11#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_COMMON_PROTO_H_
12#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_COMMON_PROTO_H_
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"
32 : TypedProtoDecoder(data, len) {}
34 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
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(); }
41 ::protozero::RepeatedFieldIterator<uint64_t>
frame_ids()
const {
42 return GetRepeated<uint64_t>(2);
54 return ".perfetto.protos.Callstack";
59 ::protozero::proto_utils::RepetitionType::kNotRepeated,
60 ::protozero::proto_utils::ProtoSchemaType::kUint64,
73 static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
76 ::protozero::internal::FieldWriter<
77 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
84 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
85 ::protozero::proto_utils::ProtoSchemaType::kUint64,
98 static constexpr uint32_t field_id = FieldMetadata_FrameIds::kFieldId;
101 ::protozero::internal::FieldWriter<
102 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
113 : TypedProtoDecoder(data, len) {}
115 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
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(); }
126 uint64_t
rel_pc()
const {
return at<4>().as_uint64(); }
129class Frame :
public ::protozero::Message {
138 static constexpr const char*
GetName() {
return ".perfetto.protos.Frame"; }
142 ::protozero::proto_utils::RepetitionType::kNotRepeated,
143 ::protozero::proto_utils::ProtoSchemaType::kUint64,
156 static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
159 ::protozero::internal::FieldWriter<
160 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
167 ::protozero::proto_utils::RepetitionType::kNotRepeated,
168 ::protozero::proto_utils::ProtoSchemaType::kUint64,
181 static constexpr uint32_t field_id = FieldMetadata_FunctionNameId::kFieldId;
184 ::protozero::internal::FieldWriter<
185 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
192 ::protozero::proto_utils::RepetitionType::kNotRepeated,
193 ::protozero::proto_utils::ProtoSchemaType::kUint64,
206 static constexpr uint32_t field_id = FieldMetadata_MappingId::kFieldId;
209 ::protozero::internal::FieldWriter<
210 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
217 ::protozero::proto_utils::RepetitionType::kNotRepeated,
218 ::protozero::proto_utils::ProtoSchemaType::kUint64,
231 static constexpr uint32_t field_id = FieldMetadata_RelPc::kFieldId;
234 ::protozero::internal::FieldWriter<
235 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
246 : TypedProtoDecoder(data, len) {}
248 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
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(); }
256 return GetRepeated<uint64_t>(7);
267 static constexpr const char*
GetName() {
return ".perfetto.protos.Mapping"; }
271 ::protozero::proto_utils::RepetitionType::kNotRepeated,
272 ::protozero::proto_utils::ProtoSchemaType::kUint64,
285 static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
288 ::protozero::internal::FieldWriter<
289 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
296 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
297 ::protozero::proto_utils::ProtoSchemaType::kUint64,
310 static constexpr uint32_t field_id = FieldMetadata_PathStringIds::kFieldId;
313 ::protozero::internal::FieldWriter<
314 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
325 : TypedProtoDecoder(data, len) {}
327 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
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(); }
345 return ".perfetto.protos.InternedString";
350 ::protozero::proto_utils::RepetitionType::kNotRepeated,
351 ::protozero::proto_utils::ProtoSchemaType::kUint64,
364 static constexpr uint32_t field_id = FieldMetadata_Iid::kFieldId;
367 ::protozero::internal::FieldWriter<
368 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
375 ::protozero::proto_utils::RepetitionType::kNotRepeated,
376 ::protozero::proto_utils::ProtoSchemaType::kBytes,
388 void set_str(
const uint8_t* data,
size_t size) {
389 AppendBytes(FieldMetadata_Str::kFieldId, data, size);
392 AppendBytes(FieldMetadata_Str::kFieldId, bytes.data, bytes.size);
395 static constexpr uint32_t field_id = FieldMetadata_Str::kFieldId;
398 ::protozero::internal::FieldWriter<
399 ::protozero::proto_utils::ProtoSchemaType::kBytes>::Append(*
this,
::protozero::RepeatedFieldIterator< uint64_t > frame_ids() const
Callstack_Decoder(const ::protozero::ConstBytes &raw)
Callstack_Decoder(const uint8_t *data, size_t len)
Callstack_Decoder(const std::string &raw)
bool has_frame_ids() const
static constexpr FieldMetadata_Iid kIid()
void add_frame_ids(uint64_t value)
static constexpr const char * GetName()
static constexpr FieldMetadata_FrameIds kFrameIds()
void set_iid(uint64_t value)
::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
uint64_t function_name_id() const
Frame_Decoder(const uint8_t *data, size_t len)
bool has_function_name_id() const
uint64_t mapping_id() const
Frame_Decoder(const std::string &raw)
Frame_Decoder(const ::protozero::ConstBytes &raw)
bool has_mapping_id() const
void set_function_name_id(uint64_t value)
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
void set_iid(uint64_t value)
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()
void set_rel_pc(uint64_t value)
void set_mapping_id(uint64_t value)
::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()
@ kFunctionNameIdFieldNumber
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
::protozero::ConstBytes str() const
InternedString_Decoder(const uint8_t *data, size_t len)
InternedString_Decoder(const ::protozero::ConstBytes &raw)
InternedString_Decoder(const std::string &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)
static constexpr const char * GetName()
void set_str(std::string value)
::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)
void set_iid(uint64_t value)
Mapping_Decoder(const std::string &raw)
bool has_path_string_ids() const
Mapping_Decoder(const ::protozero::ConstBytes &raw)
Mapping_Decoder(const uint8_t *data, size_t len)
::protozero::RepeatedFieldIterator< uint64_t > path_string_ids() const
@ kPathStringIdsFieldNumber
::protozero::proto_utils::FieldMetadata< 7, ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, Mapping > FieldMetadata_PathStringIds
void add_path_string_ids(uint64_t value)
void set_iid(uint64_t value)
::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()