1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. 2 3 #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_H_ 4 #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_GPU_GPU_COUNTER_CONFIG_PROTO_H_ 5 6 #include <stddef.h> 7 #include <stdint.h> 8 9 #include "perfetto/protozero/field_writer.h" 10 #include "perfetto/protozero/message.h" 11 #include "perfetto/protozero/packed_repeated_fields.h" 12 #include "perfetto/protozero/proto_decoder.h" 13 #include "perfetto/protozero/proto_utils.h" 14 15 16 namespace perfetto { 17 namespace protos { 18 namespace pbzero { 19 20 class GpuCounterConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { 21 public: GpuCounterConfig_Decoder(const uint8_t * data,size_t len)22 GpuCounterConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} GpuCounterConfig_Decoder(const std::string & raw)23 explicit GpuCounterConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} GpuCounterConfig_Decoder(const::protozero::ConstBytes & raw)24 explicit GpuCounterConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_counter_period_ns()25 bool has_counter_period_ns() const { return at<1>().valid(); } counter_period_ns()26 uint64_t counter_period_ns() const { return at<1>().as_uint64(); } has_counter_ids()27 bool has_counter_ids() const { return at<2>().valid(); } counter_ids()28 ::protozero::RepeatedFieldIterator<uint32_t> counter_ids() const { return GetRepeated<uint32_t>(2); } has_instrumented_sampling()29 bool has_instrumented_sampling() const { return at<3>().valid(); } instrumented_sampling()30 bool instrumented_sampling() const { return at<3>().as_bool(); } has_fix_gpu_clock()31 bool has_fix_gpu_clock() const { return at<4>().valid(); } fix_gpu_clock()32 bool fix_gpu_clock() const { return at<4>().as_bool(); } 33 }; 34 35 class GpuCounterConfig : public ::protozero::Message { 36 public: 37 using Decoder = GpuCounterConfig_Decoder; 38 enum : int32_t { 39 kCounterPeriodNsFieldNumber = 1, 40 kCounterIdsFieldNumber = 2, 41 kInstrumentedSamplingFieldNumber = 3, 42 kFixGpuClockFieldNumber = 4, 43 }; GetName()44 static constexpr const char* GetName() { return ".perfetto.protos.GpuCounterConfig"; } 45 46 47 using FieldMetadata_CounterPeriodNs = 48 ::protozero::proto_utils::FieldMetadata< 49 1, 50 ::protozero::proto_utils::RepetitionType::kNotRepeated, 51 ::protozero::proto_utils::ProtoSchemaType::kUint64, 52 uint64_t, 53 GpuCounterConfig>; 54 55 static constexpr FieldMetadata_CounterPeriodNs kCounterPeriodNs{}; set_counter_period_ns(uint64_t value)56 void set_counter_period_ns(uint64_t value) { 57 static constexpr uint32_t field_id = FieldMetadata_CounterPeriodNs::kFieldId; 58 // Call the appropriate protozero::Message::Append(field_id, ...) 59 // method based on the type of the field. 60 ::protozero::internal::FieldWriter< 61 ::protozero::proto_utils::ProtoSchemaType::kUint64> 62 ::Append(*this, field_id, value); 63 } 64 65 using FieldMetadata_CounterIds = 66 ::protozero::proto_utils::FieldMetadata< 67 2, 68 ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, 69 ::protozero::proto_utils::ProtoSchemaType::kUint32, 70 uint32_t, 71 GpuCounterConfig>; 72 73 static constexpr FieldMetadata_CounterIds kCounterIds{}; add_counter_ids(uint32_t value)74 void add_counter_ids(uint32_t value) { 75 static constexpr uint32_t field_id = FieldMetadata_CounterIds::kFieldId; 76 // Call the appropriate protozero::Message::Append(field_id, ...) 77 // method based on the type of the field. 78 ::protozero::internal::FieldWriter< 79 ::protozero::proto_utils::ProtoSchemaType::kUint32> 80 ::Append(*this, field_id, value); 81 } 82 83 using FieldMetadata_InstrumentedSampling = 84 ::protozero::proto_utils::FieldMetadata< 85 3, 86 ::protozero::proto_utils::RepetitionType::kNotRepeated, 87 ::protozero::proto_utils::ProtoSchemaType::kBool, 88 bool, 89 GpuCounterConfig>; 90 91 static constexpr FieldMetadata_InstrumentedSampling kInstrumentedSampling{}; set_instrumented_sampling(bool value)92 void set_instrumented_sampling(bool value) { 93 static constexpr uint32_t field_id = FieldMetadata_InstrumentedSampling::kFieldId; 94 // Call the appropriate protozero::Message::Append(field_id, ...) 95 // method based on the type of the field. 96 ::protozero::internal::FieldWriter< 97 ::protozero::proto_utils::ProtoSchemaType::kBool> 98 ::Append(*this, field_id, value); 99 } 100 101 using FieldMetadata_FixGpuClock = 102 ::protozero::proto_utils::FieldMetadata< 103 4, 104 ::protozero::proto_utils::RepetitionType::kNotRepeated, 105 ::protozero::proto_utils::ProtoSchemaType::kBool, 106 bool, 107 GpuCounterConfig>; 108 109 static constexpr FieldMetadata_FixGpuClock kFixGpuClock{}; set_fix_gpu_clock(bool value)110 void set_fix_gpu_clock(bool value) { 111 static constexpr uint32_t field_id = FieldMetadata_FixGpuClock::kFieldId; 112 // Call the appropriate protozero::Message::Append(field_id, ...) 113 // method based on the type of the field. 114 ::protozero::internal::FieldWriter< 115 ::protozero::proto_utils::ProtoSchemaType::kBool> 116 ::Append(*this, field_id, value); 117 } 118 }; 119 120 } // Namespace. 121 } // Namespace. 122 } // Namespace. 123 #endif // Include guard. 124