1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/trace/ftrace/mm_event.proto
3 
4 #include "protos/perfetto/trace/ftrace/mm_event.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 {
MmEventRecordFtraceEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR MmEventRecordFtraceEvent::MmEventRecordFtraceEvent(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.avg_lat_)*/0u
28   , /*decltype(_impl_.count_)*/0u
29   , /*decltype(_impl_.max_lat_)*/0u
30   , /*decltype(_impl_.type_)*/0u} {}
31 struct MmEventRecordFtraceEventDefaultTypeInternal {
MmEventRecordFtraceEventDefaultTypeInternalperfetto::protos::MmEventRecordFtraceEventDefaultTypeInternal32   PROTOBUF_CONSTEXPR MmEventRecordFtraceEventDefaultTypeInternal()
33       : _instance(::_pbi::ConstantInitialized{}) {}
~MmEventRecordFtraceEventDefaultTypeInternalperfetto::protos::MmEventRecordFtraceEventDefaultTypeInternal34   ~MmEventRecordFtraceEventDefaultTypeInternal() {}
35   union {  // NOLINT(misc-non-private-member-variables-in-classes)
36     MmEventRecordFtraceEvent _instance;
37   };
38 };
39 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 MmEventRecordFtraceEventDefaultTypeInternal _MmEventRecordFtraceEvent_default_instance_;
40 }  // namespace protos
41 }  // namespace perfetto
42 namespace perfetto {
43 namespace protos {
44 
45 // ===================================================================
46 
47 class MmEventRecordFtraceEvent::_Internal {
48  public:
49   using HasBits = decltype(std::declval<MmEventRecordFtraceEvent>()._impl_._has_bits_);
set_has_avg_lat(HasBits * has_bits)50   static void set_has_avg_lat(HasBits* has_bits) {
51     (*has_bits)[0] |= 1u;
52   }
set_has_count(HasBits * has_bits)53   static void set_has_count(HasBits* has_bits) {
54     (*has_bits)[0] |= 2u;
55   }
set_has_max_lat(HasBits * has_bits)56   static void set_has_max_lat(HasBits* has_bits) {
57     (*has_bits)[0] |= 4u;
58   }
set_has_type(HasBits * has_bits)59   static void set_has_type(HasBits* has_bits) {
60     (*has_bits)[0] |= 8u;
61   }
62 };
63 
MmEventRecordFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)64 MmEventRecordFtraceEvent::MmEventRecordFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
65                          bool is_message_owned)
66   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
67   SharedCtor(arena, is_message_owned);
68   // @@protoc_insertion_point(arena_constructor:perfetto.protos.MmEventRecordFtraceEvent)
69 }
MmEventRecordFtraceEvent(const MmEventRecordFtraceEvent & from)70 MmEventRecordFtraceEvent::MmEventRecordFtraceEvent(const MmEventRecordFtraceEvent& from)
71   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
72   MmEventRecordFtraceEvent* const _this = this; (void)_this;
73   new (&_impl_) Impl_{
74       decltype(_impl_._has_bits_){from._impl_._has_bits_}
75     , /*decltype(_impl_._cached_size_)*/{}
76     , decltype(_impl_.avg_lat_){}
77     , decltype(_impl_.count_){}
78     , decltype(_impl_.max_lat_){}
79     , decltype(_impl_.type_){}};
80 
81   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
82   ::memcpy(&_impl_.avg_lat_, &from._impl_.avg_lat_,
83     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.type_) -
84     reinterpret_cast<char*>(&_impl_.avg_lat_)) + sizeof(_impl_.type_));
85   // @@protoc_insertion_point(copy_constructor:perfetto.protos.MmEventRecordFtraceEvent)
86 }
87 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)88 inline void MmEventRecordFtraceEvent::SharedCtor(
89     ::_pb::Arena* arena, bool is_message_owned) {
90   (void)arena;
91   (void)is_message_owned;
92   new (&_impl_) Impl_{
93       decltype(_impl_._has_bits_){}
94     , /*decltype(_impl_._cached_size_)*/{}
95     , decltype(_impl_.avg_lat_){0u}
96     , decltype(_impl_.count_){0u}
97     , decltype(_impl_.max_lat_){0u}
98     , decltype(_impl_.type_){0u}
99   };
100 }
101 
~MmEventRecordFtraceEvent()102 MmEventRecordFtraceEvent::~MmEventRecordFtraceEvent() {
103   // @@protoc_insertion_point(destructor:perfetto.protos.MmEventRecordFtraceEvent)
104   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
105   (void)arena;
106     return;
107   }
108   SharedDtor();
109 }
110 
SharedDtor()111 inline void MmEventRecordFtraceEvent::SharedDtor() {
112   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
113 }
114 
SetCachedSize(int size) const115 void MmEventRecordFtraceEvent::SetCachedSize(int size) const {
116   _impl_._cached_size_.Set(size);
117 }
118 
Clear()119 void MmEventRecordFtraceEvent::Clear() {
120 // @@protoc_insertion_point(message_clear_start:perfetto.protos.MmEventRecordFtraceEvent)
121   ::uint32_t cached_has_bits = 0;
122   // Prevent compiler warnings about cached_has_bits being unused
123   (void) cached_has_bits;
124 
125   cached_has_bits = _impl_._has_bits_[0];
126   if (cached_has_bits & 0x0000000fu) {
127     ::memset(&_impl_.avg_lat_, 0, static_cast<size_t>(
128         reinterpret_cast<char*>(&_impl_.type_) -
129         reinterpret_cast<char*>(&_impl_.avg_lat_)) + sizeof(_impl_.type_));
130   }
131   _impl_._has_bits_.Clear();
132   _internal_metadata_.Clear<std::string>();
133 }
134 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)135 const char* MmEventRecordFtraceEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
136 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
137   _Internal::HasBits has_bits{};
138   while (!ctx->Done(&ptr)) {
139     ::uint32_t tag;
140     ptr = ::_pbi::ReadTag(ptr, &tag);
141     switch (tag >> 3) {
142       // optional uint32 avg_lat = 1;
143       case 1:
144         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
145           _Internal::set_has_avg_lat(&has_bits);
146           _impl_.avg_lat_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
147           CHK_(ptr);
148         } else {
149           goto handle_unusual;
150         }
151         continue;
152       // optional uint32 count = 2;
153       case 2:
154         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
155           _Internal::set_has_count(&has_bits);
156           _impl_.count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
157           CHK_(ptr);
158         } else {
159           goto handle_unusual;
160         }
161         continue;
162       // optional uint32 max_lat = 3;
163       case 3:
164         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
165           _Internal::set_has_max_lat(&has_bits);
166           _impl_.max_lat_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
167           CHK_(ptr);
168         } else {
169           goto handle_unusual;
170         }
171         continue;
172       // optional uint32 type = 4;
173       case 4:
174         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
175           _Internal::set_has_type(&has_bits);
176           _impl_.type_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
177           CHK_(ptr);
178         } else {
179           goto handle_unusual;
180         }
181         continue;
182       default:
183         goto handle_unusual;
184     }  // switch
185   handle_unusual:
186     if ((tag == 0) || ((tag & 7) == 4)) {
187       CHK_(ptr);
188       ctx->SetLastTag(tag);
189       goto message_done;
190     }
191     ptr = UnknownFieldParse(
192         tag,
193         _internal_metadata_.mutable_unknown_fields<std::string>(),
194         ptr, ctx);
195     CHK_(ptr != nullptr);
196   }  // while
197 message_done:
198   _impl_._has_bits_.Or(has_bits);
199   return ptr;
200 failure:
201   ptr = nullptr;
202   goto message_done;
203 #undef CHK_
204 }
205 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const206 ::uint8_t* MmEventRecordFtraceEvent::_InternalSerialize(
207     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
208   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.MmEventRecordFtraceEvent)
209   ::uint32_t cached_has_bits = 0;
210   (void) cached_has_bits;
211 
212   cached_has_bits = _impl_._has_bits_[0];
213   // optional uint32 avg_lat = 1;
214   if (cached_has_bits & 0x00000001u) {
215     target = stream->EnsureSpace(target);
216     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_avg_lat(), target);
217   }
218 
219   // optional uint32 count = 2;
220   if (cached_has_bits & 0x00000002u) {
221     target = stream->EnsureSpace(target);
222     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_count(), target);
223   }
224 
225   // optional uint32 max_lat = 3;
226   if (cached_has_bits & 0x00000004u) {
227     target = stream->EnsureSpace(target);
228     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_max_lat(), target);
229   }
230 
231   // optional uint32 type = 4;
232   if (cached_has_bits & 0x00000008u) {
233     target = stream->EnsureSpace(target);
234     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_type(), target);
235   }
236 
237   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
238     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
239         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
240   }
241   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.MmEventRecordFtraceEvent)
242   return target;
243 }
244 
ByteSizeLong() const245 size_t MmEventRecordFtraceEvent::ByteSizeLong() const {
246 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.MmEventRecordFtraceEvent)
247   size_t total_size = 0;
248 
249   ::uint32_t cached_has_bits = 0;
250   // Prevent compiler warnings about cached_has_bits being unused
251   (void) cached_has_bits;
252 
253   cached_has_bits = _impl_._has_bits_[0];
254   if (cached_has_bits & 0x0000000fu) {
255     // optional uint32 avg_lat = 1;
256     if (cached_has_bits & 0x00000001u) {
257       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_avg_lat());
258     }
259 
260     // optional uint32 count = 2;
261     if (cached_has_bits & 0x00000002u) {
262       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_count());
263     }
264 
265     // optional uint32 max_lat = 3;
266     if (cached_has_bits & 0x00000004u) {
267       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_max_lat());
268     }
269 
270     // optional uint32 type = 4;
271     if (cached_has_bits & 0x00000008u) {
272       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_type());
273     }
274 
275   }
276   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
277     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
278   }
279   int cached_size = ::_pbi::ToCachedSize(total_size);
280   SetCachedSize(cached_size);
281   return total_size;
282 }
283 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)284 void MmEventRecordFtraceEvent::CheckTypeAndMergeFrom(
285     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
286   MergeFrom(*::_pbi::DownCast<const MmEventRecordFtraceEvent*>(
287       &from));
288 }
289 
MergeFrom(const MmEventRecordFtraceEvent & from)290 void MmEventRecordFtraceEvent::MergeFrom(const MmEventRecordFtraceEvent& from) {
291   MmEventRecordFtraceEvent* const _this = this;
292   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.MmEventRecordFtraceEvent)
293   GOOGLE_DCHECK_NE(&from, _this);
294   ::uint32_t cached_has_bits = 0;
295   (void) cached_has_bits;
296 
297   cached_has_bits = from._impl_._has_bits_[0];
298   if (cached_has_bits & 0x0000000fu) {
299     if (cached_has_bits & 0x00000001u) {
300       _this->_impl_.avg_lat_ = from._impl_.avg_lat_;
301     }
302     if (cached_has_bits & 0x00000002u) {
303       _this->_impl_.count_ = from._impl_.count_;
304     }
305     if (cached_has_bits & 0x00000004u) {
306       _this->_impl_.max_lat_ = from._impl_.max_lat_;
307     }
308     if (cached_has_bits & 0x00000008u) {
309       _this->_impl_.type_ = from._impl_.type_;
310     }
311     _this->_impl_._has_bits_[0] |= cached_has_bits;
312   }
313   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
314 }
315 
CopyFrom(const MmEventRecordFtraceEvent & from)316 void MmEventRecordFtraceEvent::CopyFrom(const MmEventRecordFtraceEvent& from) {
317 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.MmEventRecordFtraceEvent)
318   if (&from == this) return;
319   Clear();
320   MergeFrom(from);
321 }
322 
IsInitialized() const323 bool MmEventRecordFtraceEvent::IsInitialized() const {
324   return true;
325 }
326 
InternalSwap(MmEventRecordFtraceEvent * other)327 void MmEventRecordFtraceEvent::InternalSwap(MmEventRecordFtraceEvent* other) {
328   using std::swap;
329   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
330   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
331   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
332       PROTOBUF_FIELD_OFFSET(MmEventRecordFtraceEvent, _impl_.type_)
333       + sizeof(MmEventRecordFtraceEvent::_impl_.type_)  // NOLINT
334       - PROTOBUF_FIELD_OFFSET(MmEventRecordFtraceEvent, _impl_.avg_lat_)>(
335           reinterpret_cast<char*>(&_impl_.avg_lat_),
336           reinterpret_cast<char*>(&other->_impl_.avg_lat_));
337 }
338 
GetTypeName() const339 std::string MmEventRecordFtraceEvent::GetTypeName() const {
340   return "perfetto.protos.MmEventRecordFtraceEvent";
341 }
342 
343 
344 // @@protoc_insertion_point(namespace_scope)
345 }  // namespace protos
346 }  // namespace perfetto
347 PROTOBUF_NAMESPACE_OPEN
348 template<> PROTOBUF_NOINLINE ::perfetto::protos::MmEventRecordFtraceEvent*
CreateMaybeMessage(Arena * arena)349 Arena::CreateMaybeMessage< ::perfetto::protos::MmEventRecordFtraceEvent >(Arena* arena) {
350   return Arena::CreateMessageInternal< ::perfetto::protos::MmEventRecordFtraceEvent >(arena);
351 }
352 PROTOBUF_NAMESPACE_CLOSE
353 
354 // @@protoc_insertion_point(global_scope)
355 #include <google/protobuf/port_undef.inc>
356