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