| // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. |
| |
| #ifndef PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_CONFIG_PROTO_H_ |
| #define PERFETTO_PROTOS_PROTOS_PERFETTO_CONFIG_FTRACE_FTRACE_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 { |
| |
| class FtraceConfig_CompactSchedConfig; |
| |
| class FtraceConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/14, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { |
| public: |
| FtraceConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit FtraceConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit FtraceConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_ftrace_events() const { return at<1>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstChars> ftrace_events() const { return GetRepeated<::protozero::ConstChars>(1); } |
| bool has_atrace_categories() const { return at<2>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstChars> atrace_categories() const { return GetRepeated<::protozero::ConstChars>(2); } |
| bool has_atrace_apps() const { return at<3>().valid(); } |
| ::protozero::RepeatedFieldIterator<::protozero::ConstChars> atrace_apps() const { return GetRepeated<::protozero::ConstChars>(3); } |
| bool has_buffer_size_kb() const { return at<10>().valid(); } |
| uint32_t buffer_size_kb() const { return at<10>().as_uint32(); } |
| bool has_drain_period_ms() const { return at<11>().valid(); } |
| uint32_t drain_period_ms() const { return at<11>().as_uint32(); } |
| bool has_compact_sched() const { return at<12>().valid(); } |
| ::protozero::ConstBytes compact_sched() const { return at<12>().as_bytes(); } |
| bool has_symbolize_ksyms() const { return at<13>().valid(); } |
| bool symbolize_ksyms() const { return at<13>().as_bool(); } |
| bool has_initialize_ksyms_synchronously_for_testing() const { return at<14>().valid(); } |
| bool initialize_ksyms_synchronously_for_testing() const { return at<14>().as_bool(); } |
| }; |
| |
| class FtraceConfig : public ::protozero::Message { |
| public: |
| using Decoder = FtraceConfig_Decoder; |
| enum : int32_t { |
| kFtraceEventsFieldNumber = 1, |
| kAtraceCategoriesFieldNumber = 2, |
| kAtraceAppsFieldNumber = 3, |
| kBufferSizeKbFieldNumber = 10, |
| kDrainPeriodMsFieldNumber = 11, |
| kCompactSchedFieldNumber = 12, |
| kSymbolizeKsymsFieldNumber = 13, |
| kInitializeKsymsSynchronouslyForTestingFieldNumber = 14, |
| }; |
| using CompactSchedConfig = ::perfetto::protos::pbzero::FtraceConfig_CompactSchedConfig; |
| |
| using FieldMetadata_FtraceEvents = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| FtraceConfig>; |
| |
| // 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_FtraceEvents kFtraceEvents() { return {}; } |
| void add_ftrace_events(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_FtraceEvents::kFieldId, data, size); |
| } |
| void add_ftrace_events(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_FtraceEvents::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_AtraceCategories = |
| ::protozero::proto_utils::FieldMetadata< |
| 2, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| FtraceConfig>; |
| |
| // 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_AtraceCategories kAtraceCategories() { return {}; } |
| void add_atrace_categories(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_AtraceCategories::kFieldId, data, size); |
| } |
| void add_atrace_categories(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_AtraceCategories::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_AtraceApps = |
| ::protozero::proto_utils::FieldMetadata< |
| 3, |
| ::protozero::proto_utils::RepetitionType::kRepeatedNotPacked, |
| ::protozero::proto_utils::ProtoSchemaType::kString, |
| std::string, |
| FtraceConfig>; |
| |
| // 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_AtraceApps kAtraceApps() { return {}; } |
| void add_atrace_apps(const char* data, size_t size) { |
| AppendBytes(FieldMetadata_AtraceApps::kFieldId, data, size); |
| } |
| void add_atrace_apps(std::string value) { |
| static constexpr uint32_t field_id = FieldMetadata_AtraceApps::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_BufferSizeKb = |
| ::protozero::proto_utils::FieldMetadata< |
| 10, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kUint32, |
| uint32_t, |
| FtraceConfig>; |
| |
| // 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_BufferSizeKb kBufferSizeKb() { return {}; } |
| void set_buffer_size_kb(uint32_t value) { |
| static constexpr uint32_t field_id = FieldMetadata_BufferSizeKb::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_DrainPeriodMs = |
| ::protozero::proto_utils::FieldMetadata< |
| 11, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kUint32, |
| uint32_t, |
| FtraceConfig>; |
| |
| // 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_DrainPeriodMs kDrainPeriodMs() { return {}; } |
| void set_drain_period_ms(uint32_t value) { |
| static constexpr uint32_t field_id = FieldMetadata_DrainPeriodMs::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_CompactSched = |
| ::protozero::proto_utils::FieldMetadata< |
| 12, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kMessage, |
| FtraceConfig_CompactSchedConfig, |
| FtraceConfig>; |
| |
| // 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_CompactSched kCompactSched() { return {}; } |
| template <typename T = FtraceConfig_CompactSchedConfig> T* set_compact_sched() { |
| return BeginNestedMessage<T>(12); |
| } |
| |
| |
| using FieldMetadata_SymbolizeKsyms = |
| ::protozero::proto_utils::FieldMetadata< |
| 13, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kBool, |
| bool, |
| FtraceConfig>; |
| |
| // 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_SymbolizeKsyms kSymbolizeKsyms() { return {}; } |
| void set_symbolize_ksyms(bool value) { |
| static constexpr uint32_t field_id = FieldMetadata_SymbolizeKsyms::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kBool> |
| ::Append(*this, field_id, value); |
| } |
| |
| using FieldMetadata_InitializeKsymsSynchronouslyForTesting = |
| ::protozero::proto_utils::FieldMetadata< |
| 14, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kBool, |
| bool, |
| FtraceConfig>; |
| |
| // 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_InitializeKsymsSynchronouslyForTesting kInitializeKsymsSynchronouslyForTesting() { return {}; } |
| void set_initialize_ksyms_synchronously_for_testing(bool value) { |
| static constexpr uint32_t field_id = FieldMetadata_InitializeKsymsSynchronouslyForTesting::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kBool> |
| ::Append(*this, field_id, value); |
| } |
| }; |
| |
| class FtraceConfig_CompactSchedConfig_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/1, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { |
| public: |
| FtraceConfig_CompactSchedConfig_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} |
| explicit FtraceConfig_CompactSchedConfig_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} |
| explicit FtraceConfig_CompactSchedConfig_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} |
| bool has_enabled() const { return at<1>().valid(); } |
| bool enabled() const { return at<1>().as_bool(); } |
| }; |
| |
| class FtraceConfig_CompactSchedConfig : public ::protozero::Message { |
| public: |
| using Decoder = FtraceConfig_CompactSchedConfig_Decoder; |
| enum : int32_t { |
| kEnabledFieldNumber = 1, |
| }; |
| |
| using FieldMetadata_Enabled = |
| ::protozero::proto_utils::FieldMetadata< |
| 1, |
| ::protozero::proto_utils::RepetitionType::kNotRepeated, |
| ::protozero::proto_utils::ProtoSchemaType::kBool, |
| bool, |
| FtraceConfig_CompactSchedConfig>; |
| |
| // 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_Enabled kEnabled() { return {}; } |
| void set_enabled(bool value) { |
| static constexpr uint32_t field_id = FieldMetadata_Enabled::kFieldId; |
| // Call the appropriate protozero::Message::Append(field_id, ...) |
| // method based on the type of the field. |
| ::protozero::internal::FieldWriter< |
| ::protozero::proto_utils::ProtoSchemaType::kBool> |
| ::Append(*this, field_id, value); |
| } |
| }; |
| |
| } // Namespace. |
| } // Namespace. |
| } // Namespace. |
| #endif // Include guard. |