// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.

#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_PERF_EVENTS_PROTO_H_
#define PERFETTO_PROTOS_PROTOS_PERFETTO_COMMON_PERF_EVENTS_PROTO_H_

#include <stddef.h>
#include <stdint.h>

#include "perfetto/protozero/field_writer.h"
#include "perfetto/protozero/message.h"
#include "perfetto/protozero/packed_repeated_fields.h"
#include "perfetto/protozero/proto_decoder.h"
#include "perfetto/protozero/proto_utils.h"

namespace perfetto {
namespace protos {
namespace pbzero {
class PerfEvents_RawEvent;
class PerfEvents_Timebase;
class PerfEvents_Tracepoint;
namespace perfetto_pbzero_enum_PerfEvents {
enum Counter : int32_t;
}  // namespace perfetto_pbzero_enum_PerfEvents
using PerfEvents_Counter = perfetto_pbzero_enum_PerfEvents::Counter;
namespace perfetto_pbzero_enum_PerfEvents {
enum PerfClock : int32_t;
}  // namespace perfetto_pbzero_enum_PerfEvents
using PerfEvents_PerfClock = perfetto_pbzero_enum_PerfEvents::PerfClock;
} // Namespace pbzero.
} // Namespace protos.
} // Namespace perfetto.

namespace perfetto {
namespace protos {
namespace pbzero {

namespace perfetto_pbzero_enum_PerfEvents {
enum Counter : int32_t {
  UNKNOWN_COUNTER = 0,
  SW_CPU_CLOCK = 1,
  SW_PAGE_FAULTS = 2,
  SW_TASK_CLOCK = 3,
  SW_CONTEXT_SWITCHES = 4,
  SW_CPU_MIGRATIONS = 5,
  SW_PAGE_FAULTS_MIN = 6,
  SW_PAGE_FAULTS_MAJ = 7,
  SW_ALIGNMENT_FAULTS = 8,
  SW_EMULATION_FAULTS = 9,
  SW_DUMMY = 20,
  HW_CPU_CYCLES = 10,
  HW_INSTRUCTIONS = 11,
  HW_CACHE_REFERENCES = 12,
  HW_CACHE_MISSES = 13,
  HW_BRANCH_INSTRUCTIONS = 14,
  HW_BRANCH_MISSES = 15,
  HW_BUS_CYCLES = 16,
  HW_STALLED_CYCLES_FRONTEND = 17,
  HW_STALLED_CYCLES_BACKEND = 18,
  HW_REF_CPU_CYCLES = 19,
};
} // namespace perfetto_pbzero_enum_PerfEvents
using PerfEvents_Counter = perfetto_pbzero_enum_PerfEvents::Counter;


constexpr PerfEvents_Counter PerfEvents_Counter_MIN = PerfEvents_Counter::UNKNOWN_COUNTER;
constexpr PerfEvents_Counter PerfEvents_Counter_MAX = PerfEvents_Counter::SW_DUMMY;


PERFETTO_PROTOZERO_CONSTEXPR14_OR_INLINE
const char* PerfEvents_Counter_Name(::perfetto::protos::pbzero::PerfEvents_Counter value) {
  switch (value) {
  case ::perfetto::protos::pbzero::PerfEvents_Counter::UNKNOWN_COUNTER:
    return "UNKNOWN_COUNTER";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::SW_CPU_CLOCK:
    return "SW_CPU_CLOCK";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::SW_PAGE_FAULTS:
    return "SW_PAGE_FAULTS";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::SW_TASK_CLOCK:
    return "SW_TASK_CLOCK";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::SW_CONTEXT_SWITCHES:
    return "SW_CONTEXT_SWITCHES";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::SW_CPU_MIGRATIONS:
    return "SW_CPU_MIGRATIONS";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::SW_PAGE_FAULTS_MIN:
    return "SW_PAGE_FAULTS_MIN";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::SW_PAGE_FAULTS_MAJ:
    return "SW_PAGE_FAULTS_MAJ";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::SW_ALIGNMENT_FAULTS:
    return "SW_ALIGNMENT_FAULTS";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::SW_EMULATION_FAULTS:
    return "SW_EMULATION_FAULTS";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::SW_DUMMY:
    return "SW_DUMMY";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::HW_CPU_CYCLES:
    return "HW_CPU_CYCLES";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::HW_INSTRUCTIONS:
    return "HW_INSTRUCTIONS";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::HW_CACHE_REFERENCES:
    return "HW_CACHE_REFERENCES";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::HW_CACHE_MISSES:
    return "HW_CACHE_MISSES";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::HW_BRANCH_INSTRUCTIONS:
    return "HW_BRANCH_INSTRUCTIONS";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::HW_BRANCH_MISSES:
    return "HW_BRANCH_MISSES";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::HW_BUS_CYCLES:
    return "HW_BUS_CYCLES";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::HW_STALLED_CYCLES_FRONTEND:
    return "HW_STALLED_CYCLES_FRONTEND";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::HW_STALLED_CYCLES_BACKEND:
    return "HW_STALLED_CYCLES_BACKEND";

  case ::perfetto::protos::pbzero::PerfEvents_Counter::HW_REF_CPU_CYCLES:
    return "HW_REF_CPU_CYCLES";
  }
  return "PBZERO_UNKNOWN_ENUM_VALUE";
}

namespace perfetto_pbzero_enum_PerfEvents {
enum PerfClock : int32_t {
  UNKNOWN_PERF_CLOCK = 0,
  PERF_CLOCK_REALTIME = 1,
  PERF_CLOCK_MONOTONIC = 2,
  PERF_CLOCK_MONOTONIC_RAW = 3,
  PERF_CLOCK_BOOTTIME = 4,
};
} // namespace perfetto_pbzero_enum_PerfEvents
using PerfEvents_PerfClock = perfetto_pbzero_enum_PerfEvents::PerfClock;


constexpr PerfEvents_PerfClock PerfEvents_PerfClock_MIN = PerfEvents_PerfClock::UNKNOWN_PERF_CLOCK;
constexpr PerfEvents_PerfClock PerfEvents_PerfClock_MAX = PerfEvents_PerfClock::PERF_CLOCK_BOOTTIME;


PERFETTO_PROTOZERO_CONSTEXPR14_OR_INLINE
const char* PerfEvents_PerfClock_Name(::perfetto::protos::pbzero::PerfEvents_PerfClock value) {
  switch (value) {
  case ::perfetto::protos::pbzero::PerfEvents_PerfClock::UNKNOWN_PERF_CLOCK:
    return "UNKNOWN_PERF_CLOCK";

  case ::perfetto::protos::pbzero::PerfEvents_PerfClock::PERF_CLOCK_REALTIME:
    return "PERF_CLOCK_REALTIME";

  case ::perfetto::protos::pbzero::PerfEvents_PerfClock::PERF_CLOCK_MONOTONIC:
    return "PERF_CLOCK_MONOTONIC";

  case ::perfetto::protos::pbzero::PerfEvents_PerfClock::PERF_CLOCK_MONOTONIC_RAW:
    return "PERF_CLOCK_MONOTONIC_RAW";

  case ::perfetto::protos::pbzero::PerfEvents_PerfClock::PERF_CLOCK_BOOTTIME:
    return "PERF_CLOCK_BOOTTIME";
  }
  return "PBZERO_UNKNOWN_ENUM_VALUE";
}

class FollowerEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
 public:
  FollowerEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
  explicit FollowerEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
  explicit FollowerEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
  bool has_counter() const { return at<1>().valid(); }
  int32_t counter() const { return at<1>().as_int32(); }
  bool has_tracepoint() const { return at<2>().valid(); }
  ::protozero::ConstBytes tracepoint() const { return at<2>().as_bytes(); }
  bool has_raw_event() const { return at<3>().valid(); }
  ::protozero::ConstBytes raw_event() const { return at<3>().as_bytes(); }
  bool has_name() const { return at<4>().valid(); }
  ::protozero::ConstChars name() const { return at<4>().as_string(); }
};

class FollowerEvent : public ::protozero::Message {
 public:
  using Decoder = FollowerEvent_Decoder;
  enum : int32_t {
    kCounterFieldNumber = 1,
    kTracepointFieldNumber = 2,
    kRawEventFieldNumber = 3,
    kNameFieldNumber = 4,
  };
  static constexpr const char* GetName() { return ".perfetto.protos.FollowerEvent"; }


  using FieldMetadata_Counter =
    ::protozero::proto_utils::FieldMetadata<
      1,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kEnum,
      PerfEvents_Counter,
      FollowerEvent>;

  static constexpr FieldMetadata_Counter kCounter{};
  void set_counter(PerfEvents_Counter value) {
    static constexpr uint32_t field_id = FieldMetadata_Counter::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kEnum>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_Tracepoint =
    ::protozero::proto_utils::FieldMetadata<
      2,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kMessage,
      PerfEvents_Tracepoint,
      FollowerEvent>;

  static constexpr FieldMetadata_Tracepoint kTracepoint{};
  template <typename T = PerfEvents_Tracepoint> T* set_tracepoint() {
    return BeginNestedMessage<T>(2);
  }


  using FieldMetadata_RawEvent =
    ::protozero::proto_utils::FieldMetadata<
      3,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kMessage,
      PerfEvents_RawEvent,
      FollowerEvent>;

  static constexpr FieldMetadata_RawEvent kRawEvent{};
  template <typename T = PerfEvents_RawEvent> T* set_raw_event() {
    return BeginNestedMessage<T>(3);
  }


  using FieldMetadata_Name =
    ::protozero::proto_utils::FieldMetadata<
      4,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kString,
      std::string,
      FollowerEvent>;

  static constexpr FieldMetadata_Name kName{};
  void set_name(const char* data, size_t size) {
    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
  }
  void set_name(::protozero::ConstChars chars) {
    AppendBytes(FieldMetadata_Name::kFieldId, chars.data, chars.size);
  }
  void set_name(std::string value) {
    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kString>
        ::Append(*this, field_id, value);
  }
};

class PerfEvents_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/0, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
 public:
  PerfEvents_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
  explicit PerfEvents_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
  explicit PerfEvents_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
};

class PerfEvents : public ::protozero::Message {
 public:
  using Decoder = PerfEvents_Decoder;
  static constexpr const char* GetName() { return ".perfetto.protos.PerfEvents"; }

  using Timebase = ::perfetto::protos::pbzero::PerfEvents_Timebase;
  using Tracepoint = ::perfetto::protos::pbzero::PerfEvents_Tracepoint;
  using RawEvent = ::perfetto::protos::pbzero::PerfEvents_RawEvent;

  using Counter = ::perfetto::protos::pbzero::PerfEvents_Counter;
  static inline const char* Counter_Name(Counter value) {
    return ::perfetto::protos::pbzero::PerfEvents_Counter_Name(value);
  }

  using PerfClock = ::perfetto::protos::pbzero::PerfEvents_PerfClock;
  static inline const char* PerfClock_Name(PerfClock value) {
    return ::perfetto::protos::pbzero::PerfEvents_PerfClock_Name(value);
  }
  static inline const Counter UNKNOWN_COUNTER = Counter::UNKNOWN_COUNTER;
  static inline const Counter SW_CPU_CLOCK = Counter::SW_CPU_CLOCK;
  static inline const Counter SW_PAGE_FAULTS = Counter::SW_PAGE_FAULTS;
  static inline const Counter SW_TASK_CLOCK = Counter::SW_TASK_CLOCK;
  static inline const Counter SW_CONTEXT_SWITCHES = Counter::SW_CONTEXT_SWITCHES;
  static inline const Counter SW_CPU_MIGRATIONS = Counter::SW_CPU_MIGRATIONS;
  static inline const Counter SW_PAGE_FAULTS_MIN = Counter::SW_PAGE_FAULTS_MIN;
  static inline const Counter SW_PAGE_FAULTS_MAJ = Counter::SW_PAGE_FAULTS_MAJ;
  static inline const Counter SW_ALIGNMENT_FAULTS = Counter::SW_ALIGNMENT_FAULTS;
  static inline const Counter SW_EMULATION_FAULTS = Counter::SW_EMULATION_FAULTS;
  static inline const Counter SW_DUMMY = Counter::SW_DUMMY;
  static inline const Counter HW_CPU_CYCLES = Counter::HW_CPU_CYCLES;
  static inline const Counter HW_INSTRUCTIONS = Counter::HW_INSTRUCTIONS;
  static inline const Counter HW_CACHE_REFERENCES = Counter::HW_CACHE_REFERENCES;
  static inline const Counter HW_CACHE_MISSES = Counter::HW_CACHE_MISSES;
  static inline const Counter HW_BRANCH_INSTRUCTIONS = Counter::HW_BRANCH_INSTRUCTIONS;
  static inline const Counter HW_BRANCH_MISSES = Counter::HW_BRANCH_MISSES;
  static inline const Counter HW_BUS_CYCLES = Counter::HW_BUS_CYCLES;
  static inline const Counter HW_STALLED_CYCLES_FRONTEND = Counter::HW_STALLED_CYCLES_FRONTEND;
  static inline const Counter HW_STALLED_CYCLES_BACKEND = Counter::HW_STALLED_CYCLES_BACKEND;
  static inline const Counter HW_REF_CPU_CYCLES = Counter::HW_REF_CPU_CYCLES;
  static inline const PerfClock UNKNOWN_PERF_CLOCK = PerfClock::UNKNOWN_PERF_CLOCK;
  static inline const PerfClock PERF_CLOCK_REALTIME = PerfClock::PERF_CLOCK_REALTIME;
  static inline const PerfClock PERF_CLOCK_MONOTONIC = PerfClock::PERF_CLOCK_MONOTONIC;
  static inline const PerfClock PERF_CLOCK_MONOTONIC_RAW = PerfClock::PERF_CLOCK_MONOTONIC_RAW;
  static inline const PerfClock PERF_CLOCK_BOOTTIME = PerfClock::PERF_CLOCK_BOOTTIME;
};

class PerfEvents_RawEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
 public:
  PerfEvents_RawEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
  explicit PerfEvents_RawEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
  explicit PerfEvents_RawEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
  bool has_type() const { return at<1>().valid(); }
  uint32_t type() const { return at<1>().as_uint32(); }
  bool has_config() const { return at<2>().valid(); }
  uint64_t config() const { return at<2>().as_uint64(); }
  bool has_config1() const { return at<3>().valid(); }
  uint64_t config1() const { return at<3>().as_uint64(); }
  bool has_config2() const { return at<4>().valid(); }
  uint64_t config2() const { return at<4>().as_uint64(); }
};

class PerfEvents_RawEvent : public ::protozero::Message {
 public:
  using Decoder = PerfEvents_RawEvent_Decoder;
  enum : int32_t {
    kTypeFieldNumber = 1,
    kConfigFieldNumber = 2,
    kConfig1FieldNumber = 3,
    kConfig2FieldNumber = 4,
  };
  static constexpr const char* GetName() { return ".perfetto.protos.PerfEvents.RawEvent"; }


  using FieldMetadata_Type =
    ::protozero::proto_utils::FieldMetadata<
      1,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kUint32,
      uint32_t,
      PerfEvents_RawEvent>;

  static constexpr FieldMetadata_Type kType{};
  void set_type(uint32_t value) {
    static constexpr uint32_t field_id = FieldMetadata_Type::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kUint32>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_Config =
    ::protozero::proto_utils::FieldMetadata<
      2,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kUint64,
      uint64_t,
      PerfEvents_RawEvent>;

  static constexpr FieldMetadata_Config kConfig{};
  void set_config(uint64_t value) {
    static constexpr uint32_t field_id = FieldMetadata_Config::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kUint64>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_Config1 =
    ::protozero::proto_utils::FieldMetadata<
      3,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kUint64,
      uint64_t,
      PerfEvents_RawEvent>;

  static constexpr FieldMetadata_Config1 kConfig1{};
  void set_config1(uint64_t value) {
    static constexpr uint32_t field_id = FieldMetadata_Config1::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kUint64>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_Config2 =
    ::protozero::proto_utils::FieldMetadata<
      4,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kUint64,
      uint64_t,
      PerfEvents_RawEvent>;

  static constexpr FieldMetadata_Config2 kConfig2{};
  void set_config2(uint64_t value) {
    static constexpr uint32_t field_id = FieldMetadata_Config2::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kUint64>
        ::Append(*this, field_id, value);
  }
};

class PerfEvents_Tracepoint_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
 public:
  PerfEvents_Tracepoint_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
  explicit PerfEvents_Tracepoint_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
  explicit PerfEvents_Tracepoint_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
  bool has_name() const { return at<1>().valid(); }
  ::protozero::ConstChars name() const { return at<1>().as_string(); }
  bool has_filter() const { return at<2>().valid(); }
  ::protozero::ConstChars filter() const { return at<2>().as_string(); }
};

class PerfEvents_Tracepoint : public ::protozero::Message {
 public:
  using Decoder = PerfEvents_Tracepoint_Decoder;
  enum : int32_t {
    kNameFieldNumber = 1,
    kFilterFieldNumber = 2,
  };
  static constexpr const char* GetName() { return ".perfetto.protos.PerfEvents.Tracepoint"; }


  using FieldMetadata_Name =
    ::protozero::proto_utils::FieldMetadata<
      1,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kString,
      std::string,
      PerfEvents_Tracepoint>;

  static constexpr FieldMetadata_Name kName{};
  void set_name(const char* data, size_t size) {
    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
  }
  void set_name(::protozero::ConstChars chars) {
    AppendBytes(FieldMetadata_Name::kFieldId, chars.data, chars.size);
  }
  void set_name(std::string value) {
    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kString>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_Filter =
    ::protozero::proto_utils::FieldMetadata<
      2,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kString,
      std::string,
      PerfEvents_Tracepoint>;

  static constexpr FieldMetadata_Filter kFilter{};
  void set_filter(const char* data, size_t size) {
    AppendBytes(FieldMetadata_Filter::kFieldId, data, size);
  }
  void set_filter(::protozero::ConstChars chars) {
    AppendBytes(FieldMetadata_Filter::kFieldId, chars.data, chars.size);
  }
  void set_filter(std::string value) {
    static constexpr uint32_t field_id = FieldMetadata_Filter::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kString>
        ::Append(*this, field_id, value);
  }
};

class PerfEvents_Timebase_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/11, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
 public:
  PerfEvents_Timebase_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
  explicit PerfEvents_Timebase_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
  explicit PerfEvents_Timebase_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
  bool has_frequency() const { return at<2>().valid(); }
  uint64_t frequency() const { return at<2>().as_uint64(); }
  bool has_period() const { return at<1>().valid(); }
  uint64_t period() const { return at<1>().as_uint64(); }
  bool has_poll_period_ms() const { return at<6>().valid(); }
  uint32_t poll_period_ms() const { return at<6>().as_uint32(); }
  bool has_counter() const { return at<4>().valid(); }
  int32_t counter() const { return at<4>().as_int32(); }
  bool has_tracepoint() const { return at<3>().valid(); }
  ::protozero::ConstBytes tracepoint() const { return at<3>().as_bytes(); }
  bool has_raw_event() const { return at<5>().valid(); }
  ::protozero::ConstBytes raw_event() const { return at<5>().as_bytes(); }
  bool has_timestamp_clock() const { return at<11>().valid(); }
  int32_t timestamp_clock() const { return at<11>().as_int32(); }
  bool has_name() const { return at<10>().valid(); }
  ::protozero::ConstChars name() const { return at<10>().as_string(); }
};

class PerfEvents_Timebase : public ::protozero::Message {
 public:
  using Decoder = PerfEvents_Timebase_Decoder;
  enum : int32_t {
    kFrequencyFieldNumber = 2,
    kPeriodFieldNumber = 1,
    kPollPeriodMsFieldNumber = 6,
    kCounterFieldNumber = 4,
    kTracepointFieldNumber = 3,
    kRawEventFieldNumber = 5,
    kTimestampClockFieldNumber = 11,
    kNameFieldNumber = 10,
  };
  static constexpr const char* GetName() { return ".perfetto.protos.PerfEvents.Timebase"; }


  using FieldMetadata_Frequency =
    ::protozero::proto_utils::FieldMetadata<
      2,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kUint64,
      uint64_t,
      PerfEvents_Timebase>;

  static constexpr FieldMetadata_Frequency kFrequency{};
  void set_frequency(uint64_t value) {
    static constexpr uint32_t field_id = FieldMetadata_Frequency::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kUint64>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_Period =
    ::protozero::proto_utils::FieldMetadata<
      1,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kUint64,
      uint64_t,
      PerfEvents_Timebase>;

  static constexpr FieldMetadata_Period kPeriod{};
  void set_period(uint64_t value) {
    static constexpr uint32_t field_id = FieldMetadata_Period::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kUint64>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_PollPeriodMs =
    ::protozero::proto_utils::FieldMetadata<
      6,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kUint32,
      uint32_t,
      PerfEvents_Timebase>;

  static constexpr FieldMetadata_PollPeriodMs kPollPeriodMs{};
  void set_poll_period_ms(uint32_t value) {
    static constexpr uint32_t field_id = FieldMetadata_PollPeriodMs::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kUint32>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_Counter =
    ::protozero::proto_utils::FieldMetadata<
      4,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kEnum,
      PerfEvents_Counter,
      PerfEvents_Timebase>;

  static constexpr FieldMetadata_Counter kCounter{};
  void set_counter(PerfEvents_Counter value) {
    static constexpr uint32_t field_id = FieldMetadata_Counter::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kEnum>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_Tracepoint =
    ::protozero::proto_utils::FieldMetadata<
      3,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kMessage,
      PerfEvents_Tracepoint,
      PerfEvents_Timebase>;

  static constexpr FieldMetadata_Tracepoint kTracepoint{};
  template <typename T = PerfEvents_Tracepoint> T* set_tracepoint() {
    return BeginNestedMessage<T>(3);
  }


  using FieldMetadata_RawEvent =
    ::protozero::proto_utils::FieldMetadata<
      5,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kMessage,
      PerfEvents_RawEvent,
      PerfEvents_Timebase>;

  static constexpr FieldMetadata_RawEvent kRawEvent{};
  template <typename T = PerfEvents_RawEvent> T* set_raw_event() {
    return BeginNestedMessage<T>(5);
  }


  using FieldMetadata_TimestampClock =
    ::protozero::proto_utils::FieldMetadata<
      11,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kEnum,
      PerfEvents_PerfClock,
      PerfEvents_Timebase>;

  static constexpr FieldMetadata_TimestampClock kTimestampClock{};
  void set_timestamp_clock(PerfEvents_PerfClock value) {
    static constexpr uint32_t field_id = FieldMetadata_TimestampClock::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kEnum>
        ::Append(*this, field_id, value);
  }

  using FieldMetadata_Name =
    ::protozero::proto_utils::FieldMetadata<
      10,
      ::protozero::proto_utils::RepetitionType::kNotRepeated,
      ::protozero::proto_utils::ProtoSchemaType::kString,
      std::string,
      PerfEvents_Timebase>;

  static constexpr FieldMetadata_Name kName{};
  void set_name(const char* data, size_t size) {
    AppendBytes(FieldMetadata_Name::kFieldId, data, size);
  }
  void set_name(::protozero::ConstChars chars) {
    AppendBytes(FieldMetadata_Name::kFieldId, chars.data, chars.size);
  }
  void set_name(std::string value) {
    static constexpr uint32_t field_id = FieldMetadata_Name::kFieldId;
    // Call the appropriate protozero::Message::Append(field_id, ...)
    // method based on the type of the field.
    ::protozero::internal::FieldWriter<
      ::protozero::proto_utils::ProtoSchemaType::kString>
        ::Append(*this, field_id, value);
  }
};

} // Namespace.
} // Namespace.
} // Namespace.
#endif  // Include guard.
