11#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_PROTO_H_
12#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_TRACE_PACKET_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"
33namespace perfetto_pbzero_enum_TracePacket {
44 TracePacket_SequenceFlags::SEQ_UNSPECIFIED;
46 TracePacket_SequenceFlags::SEQ_NEEDS_INCREMENTAL_STATE;
48PERFETTO_PROTOZERO_CONSTEXPR14_OR_INLINE
52 case ::perfetto::protos::pbzero::TracePacket_SequenceFlags::SEQ_UNSPECIFIED:
53 return "SEQ_UNSPECIFIED";
55 case ::perfetto::protos::pbzero::TracePacket_SequenceFlags::
56 SEQ_INCREMENTAL_STATE_CLEARED:
57 return "SEQ_INCREMENTAL_STATE_CLEARED";
59 case ::perfetto::protos::pbzero::TracePacket_SequenceFlags::
60 SEQ_NEEDS_INCREMENTAL_STATE:
61 return "SEQ_NEEDS_INCREMENTAL_STATE";
63 return "PBZERO_UNKNOWN_ENUM_VALUE";
71 : TypedProtoDecoder(data, len) {}
73 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
76 : TypedProtoDecoder(raw.data, raw.size) {}
78 uint64_t
timestamp()
const {
return at<8>().as_uint64(); }
82 ::protozero::ConstBytes
clock_snapshot()
const {
return at<6>().as_bytes(); }
84 ::protozero::ConstBytes
track_event()
const {
return at<11>().as_bytes(); }
87 return at<60>().as_bytes();
90 ::protozero::ConstBytes
perf_sample()
const {
return at<66>().as_bytes(); }
94 ::protozero::ConstBytes
interned_data()
const {
return at<12>().as_bytes(); }
114 return ".perfetto.protos.TracePacket";
119 return ::perfetto::protos::pbzero::TracePacket_SequenceFlags_Name(
value);
123 SequenceFlags::SEQ_INCREMENTAL_STATE_CLEARED;
125 SequenceFlags::SEQ_NEEDS_INCREMENTAL_STATE;
129 ::protozero::proto_utils::RepetitionType::kNotRepeated,
130 ::protozero::proto_utils::ProtoSchemaType::kUint64,
143 static constexpr uint32_t field_id = FieldMetadata_Timestamp::kFieldId;
146 ::protozero::internal::FieldWriter<
147 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
153 ::protozero::proto_utils::FieldMetadata<
155 ::protozero::proto_utils::RepetitionType::kNotRepeated,
156 ::protozero::proto_utils::ProtoSchemaType::kUint32,
171 static constexpr uint32_t field_id =
172 FieldMetadata_TimestampClockId::kFieldId;
175 ::protozero::internal::FieldWriter<
176 ::protozero::proto_utils::ProtoSchemaType::kUint32>::Append(*
this,
183 ::protozero::proto_utils::RepetitionType::kNotRepeated,
184 ::protozero::proto_utils::ProtoSchemaType::kMessage,
196 template <
typename T = ClockSnapshot>
198 return BeginNestedMessage<T>(6);
203 ::protozero::proto_utils::RepetitionType::kNotRepeated,
204 ::protozero::proto_utils::ProtoSchemaType::kMessage,
216 template <
typename T = TrackEvent>
218 return BeginNestedMessage<T>(11);
223 ::protozero::proto_utils::RepetitionType::kNotRepeated,
224 ::protozero::proto_utils::ProtoSchemaType::kMessage,
238 template <
typename T = TrackDescriptor>
240 return BeginNestedMessage<T>(60);
245 ::protozero::proto_utils::RepetitionType::kNotRepeated,
246 ::protozero::proto_utils::ProtoSchemaType::kMessage,
258 template <
typename T = PerfSample>
260 return BeginNestedMessage<T>(66);
264 ::protozero::proto_utils::FieldMetadata<
266 ::protozero::proto_utils::RepetitionType::kNotRepeated,
267 ::protozero::proto_utils::ProtoSchemaType::kUint32,
283 static constexpr uint32_t field_id =
284 FieldMetadata_TrustedPacketSequenceId::kFieldId;
287 ::protozero::internal::FieldWriter<
288 ::protozero::proto_utils::ProtoSchemaType::kUint32>::Append(*
this,
295 ::protozero::proto_utils::RepetitionType::kNotRepeated,
296 ::protozero::proto_utils::ProtoSchemaType::kMessage,
308 template <
typename T = InternedData>
310 return BeginNestedMessage<T>(12);
315 ::protozero::proto_utils::RepetitionType::kNotRepeated,
316 ::protozero::proto_utils::ProtoSchemaType::kUint32,
329 static constexpr uint32_t field_id = FieldMetadata_SequenceFlags::kFieldId;
332 ::protozero::internal::FieldWriter<
333 ::protozero::proto_utils::ProtoSchemaType::kUint32>::Append(*
this,
::protozero::ConstBytes track_event() const
uint64_t timestamp() const
::protozero::ConstBytes perf_sample() const
bool has_trusted_packet_sequence_id() const
bool has_track_event() const
bool has_perf_sample() const
::protozero::ConstBytes clock_snapshot() const
TracePacket_Decoder(const std::string &raw)
bool has_track_descriptor() const
bool has_timestamp() const
bool has_clock_snapshot() const
bool has_interned_data() const
::protozero::ConstBytes track_descriptor() const
uint32_t timestamp_clock_id() const
uint32_t trusted_packet_sequence_id() const
bool has_timestamp_clock_id() const
bool has_sequence_flags() const
TracePacket_Decoder(const ::protozero::ConstBytes &raw)
TracePacket_Decoder(const uint8_t *data, size_t len)
::protozero::ConstBytes interned_data() const
uint32_t sequence_flags() const
::protozero::proto_utils::FieldMetadata< 6, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kMessage, ClockSnapshot, TracePacket > FieldMetadata_ClockSnapshot
void set_sequence_flags(uint32_t value)
::protozero::proto_utils::FieldMetadata< 11, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kMessage, TrackEvent, TracePacket > FieldMetadata_TrackEvent
static constexpr FieldMetadata_TimestampClockId kTimestampClockId()
static const SequenceFlags SEQ_NEEDS_INCREMENTAL_STATE
void set_timestamp_clock_id(uint32_t value)
T * set_track_descriptor()
void set_trusted_packet_sequence_id(uint32_t value)
static constexpr const char * GetName()
static constexpr FieldMetadata_ClockSnapshot kClockSnapshot()
::protozero::proto_utils::FieldMetadata< 13, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint32, uint32_t, TracePacket > FieldMetadata_SequenceFlags
::protozero::proto_utils::FieldMetadata< 60, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kMessage, TrackDescriptor, TracePacket > FieldMetadata_TrackDescriptor
::protozero::proto_utils::FieldMetadata< 66, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kMessage, PerfSample, TracePacket > FieldMetadata_PerfSample
::protozero::proto_utils::FieldMetadata< 58, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint32, uint32_t, TracePacket > FieldMetadata_TimestampClockId
::protozero::proto_utils::FieldMetadata< 12, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kMessage, InternedData, TracePacket > FieldMetadata_InternedData
static const SequenceFlags SEQ_UNSPECIFIED
static constexpr FieldMetadata_TrackEvent kTrackEvent()
static const SequenceFlags SEQ_INCREMENTAL_STATE_CLEARED
static constexpr FieldMetadata_PerfSample kPerfSample()
::protozero::proto_utils::FieldMetadata< 10, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint32, uint32_t, TracePacket > FieldMetadata_TrustedPacketSequenceId
@ kTimestampClockIdFieldNumber
@ kTrackDescriptorFieldNumber
@ kInternedDataFieldNumber
@ kSequenceFlagsFieldNumber
@ kTrustedPacketSequenceIdFieldNumber
@ kClockSnapshotFieldNumber
void set_timestamp(uint64_t value)
static constexpr FieldMetadata_InternedData kInternedData()
::protozero::proto_utils::FieldMetadata< 8, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, TracePacket > FieldMetadata_Timestamp
static const char * SequenceFlags_Name(SequenceFlags value)
static constexpr FieldMetadata_TrustedPacketSequenceId kTrustedPacketSequenceId()
static constexpr FieldMetadata_Timestamp kTimestamp()
static constexpr FieldMetadata_TrackDescriptor kTrackDescriptor()
static constexpr FieldMetadata_SequenceFlags kSequenceFlags()
@ SEQ_NEEDS_INCREMENTAL_STATE
@ SEQ_INCREMENTAL_STATE_CLEARED
constexpr TracePacket_SequenceFlags TracePacket_SequenceFlags_MIN
PERFETTO_PROTOZERO_CONSTEXPR14_OR_INLINE const char * TracePacket_SequenceFlags_Name(::perfetto::protos::pbzero::TracePacket_SequenceFlags value)
perfetto_pbzero_enum_TracePacket::SequenceFlags TracePacket_SequenceFlags
constexpr TracePacket_SequenceFlags TracePacket_SequenceFlags_MAX