11#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_PACKET_PROTO_H_
12#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_PROFILING_PROFILE_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"
32 : TypedProtoDecoder(data, len) {}
34 : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()),
37 : TypedProtoDecoder(raw.data, raw.size) {}
38 bool has_cpu()
const {
return at<1>().valid(); }
39 uint32_t
cpu()
const {
return at<1>().as_uint32(); }
40 bool has_pid()
const {
return at<2>().valid(); }
41 uint32_t
pid()
const {
return at<2>().as_uint32(); }
42 bool has_tid()
const {
return at<3>().valid(); }
43 uint32_t
tid()
const {
return at<3>().as_uint32(); }
58 return ".perfetto.protos.PerfSample";
63 ::protozero::proto_utils::RepetitionType::kNotRepeated,
64 ::protozero::proto_utils::ProtoSchemaType::kUint32,
77 static constexpr uint32_t field_id = FieldMetadata_Cpu::kFieldId;
80 ::protozero::internal::FieldWriter<
81 ::protozero::proto_utils::ProtoSchemaType::kUint32>::Append(*
this,
88 ::protozero::proto_utils::RepetitionType::kNotRepeated,
89 ::protozero::proto_utils::ProtoSchemaType::kUint32,
102 static constexpr uint32_t field_id = FieldMetadata_Pid::kFieldId;
105 ::protozero::internal::FieldWriter<
106 ::protozero::proto_utils::ProtoSchemaType::kUint32>::Append(*
this,
113 ::protozero::proto_utils::RepetitionType::kNotRepeated,
114 ::protozero::proto_utils::ProtoSchemaType::kUint32,
127 static constexpr uint32_t field_id = FieldMetadata_Tid::kFieldId;
130 ::protozero::internal::FieldWriter<
131 ::protozero::proto_utils::ProtoSchemaType::kUint32>::Append(*
this,
138 ::protozero::proto_utils::RepetitionType::kNotRepeated,
139 ::protozero::proto_utils::ProtoSchemaType::kUint64,
152 static constexpr uint32_t field_id = FieldMetadata_CallstackIid::kFieldId;
155 ::protozero::internal::FieldWriter<
156 ::protozero::proto_utils::ProtoSchemaType::kUint64>::Append(*
this,
PerfSample_Decoder(const uint8_t *data, size_t len)
bool has_callstack_iid() const
PerfSample_Decoder(const std::string &raw)
uint64_t callstack_iid() const
PerfSample_Decoder(const ::protozero::ConstBytes &raw)
static constexpr FieldMetadata_Cpu kCpu()
void set_pid(uint32_t value)
@ kCallstackIidFieldNumber
static constexpr FieldMetadata_Tid kTid()
::protozero::proto_utils::FieldMetadata< 1, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint32, uint32_t, PerfSample > FieldMetadata_Cpu
::protozero::proto_utils::FieldMetadata< 3, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint32, uint32_t, PerfSample > FieldMetadata_Tid
::protozero::proto_utils::FieldMetadata< 4, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint64, uint64_t, PerfSample > FieldMetadata_CallstackIid
void set_cpu(uint32_t value)
void set_callstack_iid(uint64_t value)
::protozero::proto_utils::FieldMetadata< 2, ::protozero::proto_utils::RepetitionType::kNotRepeated, ::protozero::proto_utils::ProtoSchemaType::kUint32, uint32_t, PerfSample > FieldMetadata_Pid
static constexpr FieldMetadata_CallstackIid kCallstackIid()
void set_tid(uint32_t value)
static constexpr const char * GetName()
static constexpr FieldMetadata_Pid kPid()