blob: bd111a22a260f4509e04a088b836276bc14eb38c [file] [log] [blame]
// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_PROTO_H_
#define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_SYS_STATS_SYS_STATS_CONFIG_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 {
enum MeminfoCounters : int32_t;
enum SysStatsConfig_StatCounters : int32_t;
enum VmstatCounters : int32_t;
enum SysStatsConfig_StatCounters : int32_t {
SysStatsConfig_StatCounters_STAT_UNSPECIFIED = 0,
SysStatsConfig_StatCounters_STAT_CPU_TIMES = 1,
SysStatsConfig_StatCounters_STAT_IRQ_COUNTS = 2,
SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS = 3,
SysStatsConfig_StatCounters_STAT_FORK_COUNT = 4,
};
const SysStatsConfig_StatCounters SysStatsConfig_StatCounters_MIN = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
const SysStatsConfig_StatCounters SysStatsConfig_StatCounters_MAX = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
class SysStatsConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/6, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
public:
SysStatsConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
explicit SysStatsConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
explicit SysStatsConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
bool has_meminfo_period_ms() const { return at<1>().valid(); }
uint32_t meminfo_period_ms() const { return at<1>().as_uint32(); }
bool has_meminfo_counters() const { return at<2>().valid(); }
::protozero::RepeatedFieldIterator<int32_t> meminfo_counters() const { return GetRepeated<int32_t>(2); }
bool has_vmstat_period_ms() const { return at<3>().valid(); }
uint32_t vmstat_period_ms() const { return at<3>().as_uint32(); }
bool has_vmstat_counters() const { return at<4>().valid(); }
::protozero::RepeatedFieldIterator<int32_t> vmstat_counters() const { return GetRepeated<int32_t>(4); }
bool has_stat_period_ms() const { return at<5>().valid(); }
uint32_t stat_period_ms() const { return at<5>().as_uint32(); }
bool has_stat_counters() const { return at<6>().valid(); }
::protozero::RepeatedFieldIterator<int32_t> stat_counters() const { return GetRepeated<int32_t>(6); }
};
class SysStatsConfig : public ::protozero::Message {
public:
using Decoder = SysStatsConfig_Decoder;
enum : int32_t {
kMeminfoPeriodMsFieldNumber = 1,
kMeminfoCountersFieldNumber = 2,
kVmstatPeriodMsFieldNumber = 3,
kVmstatCountersFieldNumber = 4,
kStatPeriodMsFieldNumber = 5,
kStatCountersFieldNumber = 6,
};
using StatCounters = ::perfetto::protos::pbzero::SysStatsConfig_StatCounters;
static const StatCounters STAT_UNSPECIFIED = SysStatsConfig_StatCounters_STAT_UNSPECIFIED;
static const StatCounters STAT_CPU_TIMES = SysStatsConfig_StatCounters_STAT_CPU_TIMES;
static const StatCounters STAT_IRQ_COUNTS = SysStatsConfig_StatCounters_STAT_IRQ_COUNTS;
static const StatCounters STAT_SOFTIRQ_COUNTS = SysStatsConfig_StatCounters_STAT_SOFTIRQ_COUNTS;
static const StatCounters STAT_FORK_COUNT = SysStatsConfig_StatCounters_STAT_FORK_COUNT;
using FieldMetadata_MeminfoPeriodMs =
::protozero::proto_utils::FieldMetadata<
1,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint32,
uint32_t,
SysStatsConfig>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_MeminfoPeriodMs kMeminfoPeriodMs() { return {}; }
void set_meminfo_period_ms(uint32_t value) {
static constexpr uint32_t field_id = FieldMetadata_MeminfoPeriodMs::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_MeminfoCounters =
::protozero::proto_utils::FieldMetadata<
2,
::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
::protozero::proto_utils::ProtoSchemaType::kEnum,
::perfetto::protos::pbzero::MeminfoCounters,
SysStatsConfig>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_MeminfoCounters kMeminfoCounters() { return {}; }
void add_meminfo_counters(::perfetto::protos::pbzero::MeminfoCounters value) {
static constexpr uint32_t field_id = FieldMetadata_MeminfoCounters::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_VmstatPeriodMs =
::protozero::proto_utils::FieldMetadata<
3,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint32,
uint32_t,
SysStatsConfig>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_VmstatPeriodMs kVmstatPeriodMs() { return {}; }
void set_vmstat_period_ms(uint32_t value) {
static constexpr uint32_t field_id = FieldMetadata_VmstatPeriodMs::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_VmstatCounters =
::protozero::proto_utils::FieldMetadata<
4,
::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
::protozero::proto_utils::ProtoSchemaType::kEnum,
::perfetto::protos::pbzero::VmstatCounters,
SysStatsConfig>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_VmstatCounters kVmstatCounters() { return {}; }
void add_vmstat_counters(::perfetto::protos::pbzero::VmstatCounters value) {
static constexpr uint32_t field_id = FieldMetadata_VmstatCounters::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_StatPeriodMs =
::protozero::proto_utils::FieldMetadata<
5,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint32,
uint32_t,
SysStatsConfig>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_StatPeriodMs kStatPeriodMs() { return {}; }
void set_stat_period_ms(uint32_t value) {
static constexpr uint32_t field_id = FieldMetadata_StatPeriodMs::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_StatCounters =
::protozero::proto_utils::FieldMetadata<
6,
::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
::protozero::proto_utils::ProtoSchemaType::kEnum,
::perfetto::protos::pbzero::SysStatsConfig_StatCounters,
SysStatsConfig>;
// Ceci n'est pas une pipe.
// This is actually a variable of FieldMetadataHelper<FieldMetadata<...>>
// type (and users are expected to use it as such, hence kCamelCase name).
// It is declared as a function to keep protozero bindings header-only as
// inline constexpr variables are not available until C++17 (while inline
// functions are).
// TODO(altimin): Use inline variable instead after adopting C++17.
static constexpr FieldMetadata_StatCounters kStatCounters() { return {}; }
void add_stat_counters(::perfetto::protos::pbzero::SysStatsConfig_StatCounters value) {
static constexpr uint32_t field_id = FieldMetadata_StatCounters::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);
}
};
} // Namespace.
} // Namespace.
} // Namespace.
#endif // Include guard.