1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/trace/ftrace/lwis.proto
3 
4 #include "protos/perfetto/trace/ftrace/lwis.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 {
LwisTracingMarkWriteFtraceEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR LwisTracingMarkWriteFtraceEvent::LwisTracingMarkWriteFtraceEvent(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.lwis_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28   , /*decltype(_impl_.func_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
29   , /*decltype(_impl_.type_)*/0u
30   , /*decltype(_impl_.pid_)*/0
31   , /*decltype(_impl_.value_)*/::int64_t{0}} {}
32 struct LwisTracingMarkWriteFtraceEventDefaultTypeInternal {
LwisTracingMarkWriteFtraceEventDefaultTypeInternalperfetto::protos::LwisTracingMarkWriteFtraceEventDefaultTypeInternal33   PROTOBUF_CONSTEXPR LwisTracingMarkWriteFtraceEventDefaultTypeInternal()
34       : _instance(::_pbi::ConstantInitialized{}) {}
~LwisTracingMarkWriteFtraceEventDefaultTypeInternalperfetto::protos::LwisTracingMarkWriteFtraceEventDefaultTypeInternal35   ~LwisTracingMarkWriteFtraceEventDefaultTypeInternal() {}
36   union {  // NOLINT(misc-non-private-member-variables-in-classes)
37     LwisTracingMarkWriteFtraceEvent _instance;
38   };
39 };
40 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 LwisTracingMarkWriteFtraceEventDefaultTypeInternal _LwisTracingMarkWriteFtraceEvent_default_instance_;
41 }  // namespace protos
42 }  // namespace perfetto
43 namespace perfetto {
44 namespace protos {
45 
46 // ===================================================================
47 
48 class LwisTracingMarkWriteFtraceEvent::_Internal {
49  public:
50   using HasBits = decltype(std::declval<LwisTracingMarkWriteFtraceEvent>()._impl_._has_bits_);
set_has_lwis_name(HasBits * has_bits)51   static void set_has_lwis_name(HasBits* has_bits) {
52     (*has_bits)[0] |= 1u;
53   }
set_has_type(HasBits * has_bits)54   static void set_has_type(HasBits* has_bits) {
55     (*has_bits)[0] |= 4u;
56   }
set_has_pid(HasBits * has_bits)57   static void set_has_pid(HasBits* has_bits) {
58     (*has_bits)[0] |= 8u;
59   }
set_has_func_name(HasBits * has_bits)60   static void set_has_func_name(HasBits* has_bits) {
61     (*has_bits)[0] |= 2u;
62   }
set_has_value(HasBits * has_bits)63   static void set_has_value(HasBits* has_bits) {
64     (*has_bits)[0] |= 16u;
65   }
66 };
67 
LwisTracingMarkWriteFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)68 LwisTracingMarkWriteFtraceEvent::LwisTracingMarkWriteFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
69                          bool is_message_owned)
70   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
71   SharedCtor(arena, is_message_owned);
72   // @@protoc_insertion_point(arena_constructor:perfetto.protos.LwisTracingMarkWriteFtraceEvent)
73 }
LwisTracingMarkWriteFtraceEvent(const LwisTracingMarkWriteFtraceEvent & from)74 LwisTracingMarkWriteFtraceEvent::LwisTracingMarkWriteFtraceEvent(const LwisTracingMarkWriteFtraceEvent& from)
75   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
76   LwisTracingMarkWriteFtraceEvent* const _this = this; (void)_this;
77   new (&_impl_) Impl_{
78       decltype(_impl_._has_bits_){from._impl_._has_bits_}
79     , /*decltype(_impl_._cached_size_)*/{}
80     , decltype(_impl_.lwis_name_){}
81     , decltype(_impl_.func_name_){}
82     , decltype(_impl_.type_){}
83     , decltype(_impl_.pid_){}
84     , decltype(_impl_.value_){}};
85 
86   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
87   _impl_.lwis_name_.InitDefault();
88   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
89     _impl_.lwis_name_.Set("", GetArenaForAllocation());
90   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
91   if (from._internal_has_lwis_name()) {
92     _this->_impl_.lwis_name_.Set(from._internal_lwis_name(),
93       _this->GetArenaForAllocation());
94   }
95   _impl_.func_name_.InitDefault();
96   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
97     _impl_.func_name_.Set("", GetArenaForAllocation());
98   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
99   if (from._internal_has_func_name()) {
100     _this->_impl_.func_name_.Set(from._internal_func_name(),
101       _this->GetArenaForAllocation());
102   }
103   ::memcpy(&_impl_.type_, &from._impl_.type_,
104     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.value_) -
105     reinterpret_cast<char*>(&_impl_.type_)) + sizeof(_impl_.value_));
106   // @@protoc_insertion_point(copy_constructor:perfetto.protos.LwisTracingMarkWriteFtraceEvent)
107 }
108 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)109 inline void LwisTracingMarkWriteFtraceEvent::SharedCtor(
110     ::_pb::Arena* arena, bool is_message_owned) {
111   (void)arena;
112   (void)is_message_owned;
113   new (&_impl_) Impl_{
114       decltype(_impl_._has_bits_){}
115     , /*decltype(_impl_._cached_size_)*/{}
116     , decltype(_impl_.lwis_name_){}
117     , decltype(_impl_.func_name_){}
118     , decltype(_impl_.type_){0u}
119     , decltype(_impl_.pid_){0}
120     , decltype(_impl_.value_){::int64_t{0}}
121   };
122   _impl_.lwis_name_.InitDefault();
123   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
124     _impl_.lwis_name_.Set("", GetArenaForAllocation());
125   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
126   _impl_.func_name_.InitDefault();
127   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
128     _impl_.func_name_.Set("", GetArenaForAllocation());
129   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
130 }
131 
~LwisTracingMarkWriteFtraceEvent()132 LwisTracingMarkWriteFtraceEvent::~LwisTracingMarkWriteFtraceEvent() {
133   // @@protoc_insertion_point(destructor:perfetto.protos.LwisTracingMarkWriteFtraceEvent)
134   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
135   (void)arena;
136     return;
137   }
138   SharedDtor();
139 }
140 
SharedDtor()141 inline void LwisTracingMarkWriteFtraceEvent::SharedDtor() {
142   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
143   _impl_.lwis_name_.Destroy();
144   _impl_.func_name_.Destroy();
145 }
146 
SetCachedSize(int size) const147 void LwisTracingMarkWriteFtraceEvent::SetCachedSize(int size) const {
148   _impl_._cached_size_.Set(size);
149 }
150 
Clear()151 void LwisTracingMarkWriteFtraceEvent::Clear() {
152 // @@protoc_insertion_point(message_clear_start:perfetto.protos.LwisTracingMarkWriteFtraceEvent)
153   ::uint32_t cached_has_bits = 0;
154   // Prevent compiler warnings about cached_has_bits being unused
155   (void) cached_has_bits;
156 
157   cached_has_bits = _impl_._has_bits_[0];
158   if (cached_has_bits & 0x00000003u) {
159     if (cached_has_bits & 0x00000001u) {
160       _impl_.lwis_name_.ClearNonDefaultToEmpty();
161     }
162     if (cached_has_bits & 0x00000002u) {
163       _impl_.func_name_.ClearNonDefaultToEmpty();
164     }
165   }
166   if (cached_has_bits & 0x0000001cu) {
167     ::memset(&_impl_.type_, 0, static_cast<size_t>(
168         reinterpret_cast<char*>(&_impl_.value_) -
169         reinterpret_cast<char*>(&_impl_.type_)) + sizeof(_impl_.value_));
170   }
171   _impl_._has_bits_.Clear();
172   _internal_metadata_.Clear<std::string>();
173 }
174 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)175 const char* LwisTracingMarkWriteFtraceEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
176 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
177   _Internal::HasBits has_bits{};
178   while (!ctx->Done(&ptr)) {
179     ::uint32_t tag;
180     ptr = ::_pbi::ReadTag(ptr, &tag);
181     switch (tag >> 3) {
182       // optional string lwis_name = 1;
183       case 1:
184         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
185           auto str = _internal_mutable_lwis_name();
186           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
187           CHK_(ptr);
188         } else {
189           goto handle_unusual;
190         }
191         continue;
192       // optional uint32 type = 2;
193       case 2:
194         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
195           _Internal::set_has_type(&has_bits);
196           _impl_.type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
197           CHK_(ptr);
198         } else {
199           goto handle_unusual;
200         }
201         continue;
202       // optional int32 pid = 3;
203       case 3:
204         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
205           _Internal::set_has_pid(&has_bits);
206           _impl_.pid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
207           CHK_(ptr);
208         } else {
209           goto handle_unusual;
210         }
211         continue;
212       // optional string func_name = 4;
213       case 4:
214         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
215           auto str = _internal_mutable_func_name();
216           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
217           CHK_(ptr);
218         } else {
219           goto handle_unusual;
220         }
221         continue;
222       // optional int64 value = 5;
223       case 5:
224         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
225           _Internal::set_has_value(&has_bits);
226           _impl_.value_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
227           CHK_(ptr);
228         } else {
229           goto handle_unusual;
230         }
231         continue;
232       default:
233         goto handle_unusual;
234     }  // switch
235   handle_unusual:
236     if ((tag == 0) || ((tag & 7) == 4)) {
237       CHK_(ptr);
238       ctx->SetLastTag(tag);
239       goto message_done;
240     }
241     ptr = UnknownFieldParse(
242         tag,
243         _internal_metadata_.mutable_unknown_fields<std::string>(),
244         ptr, ctx);
245     CHK_(ptr != nullptr);
246   }  // while
247 message_done:
248   _impl_._has_bits_.Or(has_bits);
249   return ptr;
250 failure:
251   ptr = nullptr;
252   goto message_done;
253 #undef CHK_
254 }
255 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const256 ::uint8_t* LwisTracingMarkWriteFtraceEvent::_InternalSerialize(
257     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
258   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.LwisTracingMarkWriteFtraceEvent)
259   ::uint32_t cached_has_bits = 0;
260   (void) cached_has_bits;
261 
262   cached_has_bits = _impl_._has_bits_[0];
263   // optional string lwis_name = 1;
264   if (cached_has_bits & 0x00000001u) {
265     target = stream->WriteStringMaybeAliased(
266         1, this->_internal_lwis_name(), target);
267   }
268 
269   // optional uint32 type = 2;
270   if (cached_has_bits & 0x00000004u) {
271     target = stream->EnsureSpace(target);
272     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_type(), target);
273   }
274 
275   // optional int32 pid = 3;
276   if (cached_has_bits & 0x00000008u) {
277     target = stream->EnsureSpace(target);
278     target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_pid(), target);
279   }
280 
281   // optional string func_name = 4;
282   if (cached_has_bits & 0x00000002u) {
283     target = stream->WriteStringMaybeAliased(
284         4, this->_internal_func_name(), target);
285   }
286 
287   // optional int64 value = 5;
288   if (cached_has_bits & 0x00000010u) {
289     target = stream->EnsureSpace(target);
290     target = ::_pbi::WireFormatLite::WriteInt64ToArray(5, this->_internal_value(), target);
291   }
292 
293   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
294     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
295         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
296   }
297   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.LwisTracingMarkWriteFtraceEvent)
298   return target;
299 }
300 
ByteSizeLong() const301 size_t LwisTracingMarkWriteFtraceEvent::ByteSizeLong() const {
302 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.LwisTracingMarkWriteFtraceEvent)
303   size_t total_size = 0;
304 
305   ::uint32_t cached_has_bits = 0;
306   // Prevent compiler warnings about cached_has_bits being unused
307   (void) cached_has_bits;
308 
309   cached_has_bits = _impl_._has_bits_[0];
310   if (cached_has_bits & 0x0000001fu) {
311     // optional string lwis_name = 1;
312     if (cached_has_bits & 0x00000001u) {
313       total_size += 1 +
314         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
315           this->_internal_lwis_name());
316     }
317 
318     // optional string func_name = 4;
319     if (cached_has_bits & 0x00000002u) {
320       total_size += 1 +
321         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
322           this->_internal_func_name());
323     }
324 
325     // optional uint32 type = 2;
326     if (cached_has_bits & 0x00000004u) {
327       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_type());
328     }
329 
330     // optional int32 pid = 3;
331     if (cached_has_bits & 0x00000008u) {
332       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_pid());
333     }
334 
335     // optional int64 value = 5;
336     if (cached_has_bits & 0x00000010u) {
337       total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_value());
338     }
339 
340   }
341   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
342     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
343   }
344   int cached_size = ::_pbi::ToCachedSize(total_size);
345   SetCachedSize(cached_size);
346   return total_size;
347 }
348 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)349 void LwisTracingMarkWriteFtraceEvent::CheckTypeAndMergeFrom(
350     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
351   MergeFrom(*::_pbi::DownCast<const LwisTracingMarkWriteFtraceEvent*>(
352       &from));
353 }
354 
MergeFrom(const LwisTracingMarkWriteFtraceEvent & from)355 void LwisTracingMarkWriteFtraceEvent::MergeFrom(const LwisTracingMarkWriteFtraceEvent& from) {
356   LwisTracingMarkWriteFtraceEvent* const _this = this;
357   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.LwisTracingMarkWriteFtraceEvent)
358   GOOGLE_DCHECK_NE(&from, _this);
359   ::uint32_t cached_has_bits = 0;
360   (void) cached_has_bits;
361 
362   cached_has_bits = from._impl_._has_bits_[0];
363   if (cached_has_bits & 0x0000001fu) {
364     if (cached_has_bits & 0x00000001u) {
365       _this->_internal_set_lwis_name(from._internal_lwis_name());
366     }
367     if (cached_has_bits & 0x00000002u) {
368       _this->_internal_set_func_name(from._internal_func_name());
369     }
370     if (cached_has_bits & 0x00000004u) {
371       _this->_impl_.type_ = from._impl_.type_;
372     }
373     if (cached_has_bits & 0x00000008u) {
374       _this->_impl_.pid_ = from._impl_.pid_;
375     }
376     if (cached_has_bits & 0x00000010u) {
377       _this->_impl_.value_ = from._impl_.value_;
378     }
379     _this->_impl_._has_bits_[0] |= cached_has_bits;
380   }
381   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
382 }
383 
CopyFrom(const LwisTracingMarkWriteFtraceEvent & from)384 void LwisTracingMarkWriteFtraceEvent::CopyFrom(const LwisTracingMarkWriteFtraceEvent& from) {
385 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.LwisTracingMarkWriteFtraceEvent)
386   if (&from == this) return;
387   Clear();
388   MergeFrom(from);
389 }
390 
IsInitialized() const391 bool LwisTracingMarkWriteFtraceEvent::IsInitialized() const {
392   return true;
393 }
394 
InternalSwap(LwisTracingMarkWriteFtraceEvent * other)395 void LwisTracingMarkWriteFtraceEvent::InternalSwap(LwisTracingMarkWriteFtraceEvent* other) {
396   using std::swap;
397   auto* lhs_arena = GetArenaForAllocation();
398   auto* rhs_arena = other->GetArenaForAllocation();
399   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
400   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
401   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
402       &_impl_.lwis_name_, lhs_arena,
403       &other->_impl_.lwis_name_, rhs_arena
404   );
405   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
406       &_impl_.func_name_, lhs_arena,
407       &other->_impl_.func_name_, rhs_arena
408   );
409   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
410       PROTOBUF_FIELD_OFFSET(LwisTracingMarkWriteFtraceEvent, _impl_.value_)
411       + sizeof(LwisTracingMarkWriteFtraceEvent::_impl_.value_)  // NOLINT
412       - PROTOBUF_FIELD_OFFSET(LwisTracingMarkWriteFtraceEvent, _impl_.type_)>(
413           reinterpret_cast<char*>(&_impl_.type_),
414           reinterpret_cast<char*>(&other->_impl_.type_));
415 }
416 
GetTypeName() const417 std::string LwisTracingMarkWriteFtraceEvent::GetTypeName() const {
418   return "perfetto.protos.LwisTracingMarkWriteFtraceEvent";
419 }
420 
421 
422 // @@protoc_insertion_point(namespace_scope)
423 }  // namespace protos
424 }  // namespace perfetto
425 PROTOBUF_NAMESPACE_OPEN
426 template<> PROTOBUF_NOINLINE ::perfetto::protos::LwisTracingMarkWriteFtraceEvent*
CreateMaybeMessage(Arena * arena)427 Arena::CreateMaybeMessage< ::perfetto::protos::LwisTracingMarkWriteFtraceEvent >(Arena* arena) {
428   return Arena::CreateMessageInternal< ::perfetto::protos::LwisTracingMarkWriteFtraceEvent >(arena);
429 }
430 PROTOBUF_NAMESPACE_CLOSE
431 
432 // @@protoc_insertion_point(global_scope)
433 #include <google/protobuf/port_undef.inc>
434