blob: 0d68aca77e86576cbf05ab8c2b65cb31493650a5 [file] [log] [blame]
// Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT.
#ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_STATS_PROTO_H_
#define PERFETTO_PROTOS_PROTOS_PERFETTO_TRACE_FTRACE_FTRACE_STATS_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 FtraceCpuStats;
enum FtraceStats_Phase : int32_t;
enum FtraceStats_Phase : int32_t {
FtraceStats_Phase_UNSPECIFIED = 0,
FtraceStats_Phase_START_OF_TRACE = 1,
FtraceStats_Phase_END_OF_TRACE = 2,
};
const FtraceStats_Phase FtraceStats_Phase_MIN = FtraceStats_Phase_UNSPECIFIED;
const FtraceStats_Phase FtraceStats_Phase_MAX = FtraceStats_Phase_END_OF_TRACE;
class FtraceStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/4, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> {
public:
FtraceStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
explicit FtraceStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
explicit FtraceStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
bool has_phase() const { return at<1>().valid(); }
int32_t phase() const { return at<1>().as_int32(); }
bool has_cpu_stats() const { return at<2>().valid(); }
::protozero::RepeatedFieldIterator<::protozero::ConstBytes> cpu_stats() const { return GetRepeated<::protozero::ConstBytes>(2); }
bool has_kernel_symbols_parsed() const { return at<3>().valid(); }
uint32_t kernel_symbols_parsed() const { return at<3>().as_uint32(); }
bool has_kernel_symbols_mem_kb() const { return at<4>().valid(); }
uint32_t kernel_symbols_mem_kb() const { return at<4>().as_uint32(); }
};
class FtraceStats : public ::protozero::Message {
public:
using Decoder = FtraceStats_Decoder;
enum : int32_t {
kPhaseFieldNumber = 1,
kCpuStatsFieldNumber = 2,
kKernelSymbolsParsedFieldNumber = 3,
kKernelSymbolsMemKbFieldNumber = 4,
};
using Phase = ::perfetto::protos::pbzero::FtraceStats_Phase;
static const Phase UNSPECIFIED = FtraceStats_Phase_UNSPECIFIED;
static const Phase START_OF_TRACE = FtraceStats_Phase_START_OF_TRACE;
static const Phase END_OF_TRACE = FtraceStats_Phase_END_OF_TRACE;
using FieldMetadata_Phase =
::protozero::proto_utils::FieldMetadata<
1,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kEnum,
::perfetto::protos::pbzero::FtraceStats_Phase,
FtraceStats>;
// 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_Phase kPhase() { return {}; }
void set_phase(::perfetto::protos::pbzero::FtraceStats_Phase value) {
static constexpr uint32_t field_id = FieldMetadata_Phase::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_CpuStats =
::protozero::proto_utils::FieldMetadata<
2,
::protozero::proto_utils::RepetitionType::kRepeatedNotPacked,
::protozero::proto_utils::ProtoSchemaType::kMessage,
FtraceCpuStats,
FtraceStats>;
// 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_CpuStats kCpuStats() { return {}; }
template <typename T = FtraceCpuStats> T* add_cpu_stats() {
return BeginNestedMessage<T>(2);
}
using FieldMetadata_KernelSymbolsParsed =
::protozero::proto_utils::FieldMetadata<
3,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint32,
uint32_t,
FtraceStats>;
// 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_KernelSymbolsParsed kKernelSymbolsParsed() { return {}; }
void set_kernel_symbols_parsed(uint32_t value) {
static constexpr uint32_t field_id = FieldMetadata_KernelSymbolsParsed::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_KernelSymbolsMemKb =
::protozero::proto_utils::FieldMetadata<
4,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint32,
uint32_t,
FtraceStats>;
// 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_KernelSymbolsMemKb kKernelSymbolsMemKb() { return {}; }
void set_kernel_symbols_mem_kb(uint32_t value) {
static constexpr uint32_t field_id = FieldMetadata_KernelSymbolsMemKb::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);
}
};
class FtraceCpuStats_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/9, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> {
public:
FtraceCpuStats_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {}
explicit FtraceCpuStats_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {}
explicit FtraceCpuStats_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {}
bool has_cpu() const { return at<1>().valid(); }
uint64_t cpu() const { return at<1>().as_uint64(); }
bool has_entries() const { return at<2>().valid(); }
uint64_t entries() const { return at<2>().as_uint64(); }
bool has_overrun() const { return at<3>().valid(); }
uint64_t overrun() const { return at<3>().as_uint64(); }
bool has_commit_overrun() const { return at<4>().valid(); }
uint64_t commit_overrun() const { return at<4>().as_uint64(); }
bool has_bytes_read() const { return at<5>().valid(); }
uint64_t bytes_read() const { return at<5>().as_uint64(); }
bool has_oldest_event_ts() const { return at<6>().valid(); }
double oldest_event_ts() const { return at<6>().as_double(); }
bool has_now_ts() const { return at<7>().valid(); }
double now_ts() const { return at<7>().as_double(); }
bool has_dropped_events() const { return at<8>().valid(); }
uint64_t dropped_events() const { return at<8>().as_uint64(); }
bool has_read_events() const { return at<9>().valid(); }
uint64_t read_events() const { return at<9>().as_uint64(); }
};
class FtraceCpuStats : public ::protozero::Message {
public:
using Decoder = FtraceCpuStats_Decoder;
enum : int32_t {
kCpuFieldNumber = 1,
kEntriesFieldNumber = 2,
kOverrunFieldNumber = 3,
kCommitOverrunFieldNumber = 4,
kBytesReadFieldNumber = 5,
kOldestEventTsFieldNumber = 6,
kNowTsFieldNumber = 7,
kDroppedEventsFieldNumber = 8,
kReadEventsFieldNumber = 9,
};
using FieldMetadata_Cpu =
::protozero::proto_utils::FieldMetadata<
1,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
FtraceCpuStats>;
// 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_Cpu kCpu() { return {}; }
void set_cpu(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_Cpu::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_Entries =
::protozero::proto_utils::FieldMetadata<
2,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
FtraceCpuStats>;
// 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_Entries kEntries() { return {}; }
void set_entries(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_Entries::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_Overrun =
::protozero::proto_utils::FieldMetadata<
3,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
FtraceCpuStats>;
// 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_Overrun kOverrun() { return {}; }
void set_overrun(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_Overrun::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_CommitOverrun =
::protozero::proto_utils::FieldMetadata<
4,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
FtraceCpuStats>;
// 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_CommitOverrun kCommitOverrun() { return {}; }
void set_commit_overrun(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_CommitOverrun::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_BytesRead =
::protozero::proto_utils::FieldMetadata<
5,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
FtraceCpuStats>;
// 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_BytesRead kBytesRead() { return {}; }
void set_bytes_read(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_BytesRead::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_OldestEventTs =
::protozero::proto_utils::FieldMetadata<
6,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kDouble,
double,
FtraceCpuStats>;
// 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_OldestEventTs kOldestEventTs() { return {}; }
void set_oldest_event_ts(double value) {
static constexpr uint32_t field_id = FieldMetadata_OldestEventTs::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kDouble>
::Append(*this, field_id, value);
}
using FieldMetadata_NowTs =
::protozero::proto_utils::FieldMetadata<
7,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kDouble,
double,
FtraceCpuStats>;
// 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_NowTs kNowTs() { return {}; }
void set_now_ts(double value) {
static constexpr uint32_t field_id = FieldMetadata_NowTs::kFieldId;
// Call the appropriate protozero::Message::Append(field_id, ...)
// method based on the type of the field.
::protozero::internal::FieldWriter<
::protozero::proto_utils::ProtoSchemaType::kDouble>
::Append(*this, field_id, value);
}
using FieldMetadata_DroppedEvents =
::protozero::proto_utils::FieldMetadata<
8,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
FtraceCpuStats>;
// 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_DroppedEvents kDroppedEvents() { return {}; }
void set_dropped_events(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_DroppedEvents::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_ReadEvents =
::protozero::proto_utils::FieldMetadata<
9,
::protozero::proto_utils::RepetitionType::kNotRepeated,
::protozero::proto_utils::ProtoSchemaType::kUint64,
uint64_t,
FtraceCpuStats>;
// 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_ReadEvents kReadEvents() { return {}; }
void set_read_events(uint64_t value) {
static constexpr uint32_t field_id = FieldMetadata_ReadEvents::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);
}
};
} // Namespace.
} // Namespace.
} // Namespace.
#endif // Include guard.