1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/config/etw/etw_config.proto
3 
4 #include "protos/perfetto/config/etw/etw_config.pb.h"
5 
6 #include <algorithm>
7 #include <cstdint>
8 
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15 
16 PROTOBUF_PRAGMA_INIT_SEG
17 
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20 
21 namespace perfetto {
22 namespace protos {
EtwConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR EtwConfig::EtwConfig(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_.kernel_flags_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}} {}
27 struct EtwConfigDefaultTypeInternal {
EtwConfigDefaultTypeInternalperfetto::protos::EtwConfigDefaultTypeInternal28   PROTOBUF_CONSTEXPR EtwConfigDefaultTypeInternal()
29       : _instance(::_pbi::ConstantInitialized{}) {}
~EtwConfigDefaultTypeInternalperfetto::protos::EtwConfigDefaultTypeInternal30   ~EtwConfigDefaultTypeInternal() {}
31   union {  // NOLINT(misc-non-private-member-variables-in-classes)
32     EtwConfig _instance;
33   };
34 };
35 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EtwConfigDefaultTypeInternal _EtwConfig_default_instance_;
36 }  // namespace protos
37 }  // namespace perfetto
38 namespace perfetto {
39 namespace protos {
EtwConfig_KernelFlag_IsValid(int value)40 bool EtwConfig_KernelFlag_IsValid(int value) {
41   switch (value) {
42     case 0:
43     case 1:
44       return true;
45     default:
46       return false;
47   }
48 }
49 
50 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> EtwConfig_KernelFlag_strings[2] = {};
51 
52 static const char EtwConfig_KernelFlag_names[] =
53   "CSWITCH"
54   "DISPATCHER";
55 
56 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry EtwConfig_KernelFlag_entries[] = {
57   { {EtwConfig_KernelFlag_names + 0, 7}, 0 },
58   { {EtwConfig_KernelFlag_names + 7, 10}, 1 },
59 };
60 
61 static const int EtwConfig_KernelFlag_entries_by_number[] = {
62   0, // 0 -> CSWITCH
63   1, // 1 -> DISPATCHER
64 };
65 
EtwConfig_KernelFlag_Name(EtwConfig_KernelFlag value)66 const std::string& EtwConfig_KernelFlag_Name(
67     EtwConfig_KernelFlag value) {
68   static const bool dummy =
69       ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
70           EtwConfig_KernelFlag_entries,
71           EtwConfig_KernelFlag_entries_by_number,
72           2, EtwConfig_KernelFlag_strings);
73   (void) dummy;
74   int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
75       EtwConfig_KernelFlag_entries,
76       EtwConfig_KernelFlag_entries_by_number,
77       2, value);
78   return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
79                      EtwConfig_KernelFlag_strings[idx].get();
80 }
EtwConfig_KernelFlag_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,EtwConfig_KernelFlag * value)81 bool EtwConfig_KernelFlag_Parse(
82     ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, EtwConfig_KernelFlag* value) {
83   int int_value;
84   bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
85       EtwConfig_KernelFlag_entries, 2, name, &int_value);
86   if (success) {
87     *value = static_cast<EtwConfig_KernelFlag>(int_value);
88   }
89   return success;
90 }
91 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
92 constexpr EtwConfig_KernelFlag EtwConfig::CSWITCH;
93 constexpr EtwConfig_KernelFlag EtwConfig::DISPATCHER;
94 constexpr EtwConfig_KernelFlag EtwConfig::KernelFlag_MIN;
95 constexpr EtwConfig_KernelFlag EtwConfig::KernelFlag_MAX;
96 constexpr int EtwConfig::KernelFlag_ARRAYSIZE;
97 #endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
98 
99 // ===================================================================
100 
101 class EtwConfig::_Internal {
102  public:
103 };
104 
EtwConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)105 EtwConfig::EtwConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
106                          bool is_message_owned)
107   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
108   SharedCtor(arena, is_message_owned);
109   // @@protoc_insertion_point(arena_constructor:perfetto.protos.EtwConfig)
110 }
EtwConfig(const EtwConfig & from)111 EtwConfig::EtwConfig(const EtwConfig& from)
112   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
113   EtwConfig* const _this = this; (void)_this;
114   new (&_impl_) Impl_{
115       decltype(_impl_.kernel_flags_){from._impl_.kernel_flags_}
116     , /*decltype(_impl_._cached_size_)*/{}};
117 
118   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
119   // @@protoc_insertion_point(copy_constructor:perfetto.protos.EtwConfig)
120 }
121 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)122 inline void EtwConfig::SharedCtor(
123     ::_pb::Arena* arena, bool is_message_owned) {
124   (void)arena;
125   (void)is_message_owned;
126   new (&_impl_) Impl_{
127       decltype(_impl_.kernel_flags_){arena}
128     , /*decltype(_impl_._cached_size_)*/{}
129   };
130 }
131 
~EtwConfig()132 EtwConfig::~EtwConfig() {
133   // @@protoc_insertion_point(destructor:perfetto.protos.EtwConfig)
134   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
135   (void)arena;
136     return;
137   }
138   SharedDtor();
139 }
140 
SharedDtor()141 inline void EtwConfig::SharedDtor() {
142   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
143   _impl_.kernel_flags_.~RepeatedField();
144 }
145 
SetCachedSize(int size) const146 void EtwConfig::SetCachedSize(int size) const {
147   _impl_._cached_size_.Set(size);
148 }
149 
Clear()150 void EtwConfig::Clear() {
151 // @@protoc_insertion_point(message_clear_start:perfetto.protos.EtwConfig)
152   ::uint32_t cached_has_bits = 0;
153   // Prevent compiler warnings about cached_has_bits being unused
154   (void) cached_has_bits;
155 
156   _impl_.kernel_flags_.Clear();
157   _internal_metadata_.Clear<std::string>();
158 }
159 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)160 const char* EtwConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
161 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
162   while (!ctx->Done(&ptr)) {
163     ::uint32_t tag;
164     ptr = ::_pbi::ReadTag(ptr, &tag);
165     switch (tag >> 3) {
166       // repeated .perfetto.protos.EtwConfig.KernelFlag kernel_flags = 1;
167       case 1:
168         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
169           ptr -= 1;
170           do {
171             ptr += 1;
172             ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
173             CHK_(ptr);
174             if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::EtwConfig_KernelFlag_IsValid(val))) {
175               _internal_add_kernel_flags(static_cast<::perfetto::protos::EtwConfig_KernelFlag>(val));
176             } else {
177               ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
178             }
179             if (!ctx->DataAvailable(ptr)) break;
180           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<8>(ptr));
181         } else if (static_cast<::uint8_t>(tag) == 10) {
182           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_kernel_flags(), ptr, ctx, ::perfetto::protos::EtwConfig_KernelFlag_IsValid, &_internal_metadata_, 1);
183           CHK_(ptr);
184         } else {
185           goto handle_unusual;
186         }
187         continue;
188       default:
189         goto handle_unusual;
190     }  // switch
191   handle_unusual:
192     if ((tag == 0) || ((tag & 7) == 4)) {
193       CHK_(ptr);
194       ctx->SetLastTag(tag);
195       goto message_done;
196     }
197     ptr = UnknownFieldParse(
198         tag,
199         _internal_metadata_.mutable_unknown_fields<std::string>(),
200         ptr, ctx);
201     CHK_(ptr != nullptr);
202   }  // while
203 message_done:
204   return ptr;
205 failure:
206   ptr = nullptr;
207   goto message_done;
208 #undef CHK_
209 }
210 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const211 ::uint8_t* EtwConfig::_InternalSerialize(
212     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
213   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.EtwConfig)
214   ::uint32_t cached_has_bits = 0;
215   (void) cached_has_bits;
216 
217   // repeated .perfetto.protos.EtwConfig.KernelFlag kernel_flags = 1;
218   for (int i = 0, n = this->_internal_kernel_flags_size(); i < n; i++) {
219     target = stream->EnsureSpace(target);
220     target = ::_pbi::WireFormatLite::WriteEnumToArray(
221         1, this->_internal_kernel_flags(i), target);
222   }
223 
224   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
225     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
226         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
227   }
228   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.EtwConfig)
229   return target;
230 }
231 
ByteSizeLong() const232 size_t EtwConfig::ByteSizeLong() const {
233 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.EtwConfig)
234   size_t total_size = 0;
235 
236   ::uint32_t cached_has_bits = 0;
237   // Prevent compiler warnings about cached_has_bits being unused
238   (void) cached_has_bits;
239 
240   // repeated .perfetto.protos.EtwConfig.KernelFlag kernel_flags = 1;
241   {
242     size_t data_size = 0;
243     unsigned int count = static_cast<unsigned int>(this->_internal_kernel_flags_size());for (unsigned int i = 0; i < count; i++) {
244       data_size += ::_pbi::WireFormatLite::EnumSize(
245         this->_internal_kernel_flags(static_cast<int>(i)));
246     }
247     total_size += (1UL * count) + data_size;
248   }
249 
250   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
251     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
252   }
253   int cached_size = ::_pbi::ToCachedSize(total_size);
254   SetCachedSize(cached_size);
255   return total_size;
256 }
257 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)258 void EtwConfig::CheckTypeAndMergeFrom(
259     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
260   MergeFrom(*::_pbi::DownCast<const EtwConfig*>(
261       &from));
262 }
263 
MergeFrom(const EtwConfig & from)264 void EtwConfig::MergeFrom(const EtwConfig& from) {
265   EtwConfig* const _this = this;
266   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.EtwConfig)
267   GOOGLE_DCHECK_NE(&from, _this);
268   ::uint32_t cached_has_bits = 0;
269   (void) cached_has_bits;
270 
271   _this->_impl_.kernel_flags_.MergeFrom(from._impl_.kernel_flags_);
272   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
273 }
274 
CopyFrom(const EtwConfig & from)275 void EtwConfig::CopyFrom(const EtwConfig& from) {
276 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.EtwConfig)
277   if (&from == this) return;
278   Clear();
279   MergeFrom(from);
280 }
281 
IsInitialized() const282 bool EtwConfig::IsInitialized() const {
283   return true;
284 }
285 
InternalSwap(EtwConfig * other)286 void EtwConfig::InternalSwap(EtwConfig* other) {
287   using std::swap;
288   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
289   _impl_.kernel_flags_.InternalSwap(&other->_impl_.kernel_flags_);
290 }
291 
GetTypeName() const292 std::string EtwConfig::GetTypeName() const {
293   return "perfetto.protos.EtwConfig";
294 }
295 
296 
297 // @@protoc_insertion_point(namespace_scope)
298 }  // namespace protos
299 }  // namespace perfetto
300 PROTOBUF_NAMESPACE_OPEN
301 template<> PROTOBUF_NOINLINE ::perfetto::protos::EtwConfig*
CreateMaybeMessage(Arena * arena)302 Arena::CreateMaybeMessage< ::perfetto::protos::EtwConfig >(Arena* arena) {
303   return Arena::CreateMessageInternal< ::perfetto::protos::EtwConfig >(arena);
304 }
305 PROTOBUF_NAMESPACE_CLOSE
306 
307 // @@protoc_insertion_point(global_scope)
308 #include <google/protobuf/port_undef.inc>
309