1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/trace/ftrace/devfreq.proto
3 
4 #include "protos/perfetto/trace/ftrace/devfreq.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 {
DevfreqFrequencyFtraceEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR DevfreqFrequencyFtraceEvent::DevfreqFrequencyFtraceEvent(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.dev_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28   , /*decltype(_impl_.freq_)*/::uint64_t{0u}
29   , /*decltype(_impl_.prev_freq_)*/::uint64_t{0u}
30   , /*decltype(_impl_.busy_time_)*/::uint64_t{0u}
31   , /*decltype(_impl_.total_time_)*/::uint64_t{0u}} {}
32 struct DevfreqFrequencyFtraceEventDefaultTypeInternal {
DevfreqFrequencyFtraceEventDefaultTypeInternalperfetto::protos::DevfreqFrequencyFtraceEventDefaultTypeInternal33   PROTOBUF_CONSTEXPR DevfreqFrequencyFtraceEventDefaultTypeInternal()
34       : _instance(::_pbi::ConstantInitialized{}) {}
~DevfreqFrequencyFtraceEventDefaultTypeInternalperfetto::protos::DevfreqFrequencyFtraceEventDefaultTypeInternal35   ~DevfreqFrequencyFtraceEventDefaultTypeInternal() {}
36   union {  // NOLINT(misc-non-private-member-variables-in-classes)
37     DevfreqFrequencyFtraceEvent _instance;
38   };
39 };
40 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 DevfreqFrequencyFtraceEventDefaultTypeInternal _DevfreqFrequencyFtraceEvent_default_instance_;
41 }  // namespace protos
42 }  // namespace perfetto
43 namespace perfetto {
44 namespace protos {
45 
46 // ===================================================================
47 
48 class DevfreqFrequencyFtraceEvent::_Internal {
49  public:
50   using HasBits = decltype(std::declval<DevfreqFrequencyFtraceEvent>()._impl_._has_bits_);
set_has_dev_name(HasBits * has_bits)51   static void set_has_dev_name(HasBits* has_bits) {
52     (*has_bits)[0] |= 1u;
53   }
set_has_freq(HasBits * has_bits)54   static void set_has_freq(HasBits* has_bits) {
55     (*has_bits)[0] |= 2u;
56   }
set_has_prev_freq(HasBits * has_bits)57   static void set_has_prev_freq(HasBits* has_bits) {
58     (*has_bits)[0] |= 4u;
59   }
set_has_busy_time(HasBits * has_bits)60   static void set_has_busy_time(HasBits* has_bits) {
61     (*has_bits)[0] |= 8u;
62   }
set_has_total_time(HasBits * has_bits)63   static void set_has_total_time(HasBits* has_bits) {
64     (*has_bits)[0] |= 16u;
65   }
66 };
67 
DevfreqFrequencyFtraceEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)68 DevfreqFrequencyFtraceEvent::DevfreqFrequencyFtraceEvent(::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.DevfreqFrequencyFtraceEvent)
73 }
DevfreqFrequencyFtraceEvent(const DevfreqFrequencyFtraceEvent & from)74 DevfreqFrequencyFtraceEvent::DevfreqFrequencyFtraceEvent(const DevfreqFrequencyFtraceEvent& from)
75   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
76   DevfreqFrequencyFtraceEvent* 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_.dev_name_){}
81     , decltype(_impl_.freq_){}
82     , decltype(_impl_.prev_freq_){}
83     , decltype(_impl_.busy_time_){}
84     , decltype(_impl_.total_time_){}};
85 
86   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
87   _impl_.dev_name_.InitDefault();
88   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
89     _impl_.dev_name_.Set("", GetArenaForAllocation());
90   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
91   if (from._internal_has_dev_name()) {
92     _this->_impl_.dev_name_.Set(from._internal_dev_name(),
93       _this->GetArenaForAllocation());
94   }
95   ::memcpy(&_impl_.freq_, &from._impl_.freq_,
96     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.total_time_) -
97     reinterpret_cast<char*>(&_impl_.freq_)) + sizeof(_impl_.total_time_));
98   // @@protoc_insertion_point(copy_constructor:perfetto.protos.DevfreqFrequencyFtraceEvent)
99 }
100 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)101 inline void DevfreqFrequencyFtraceEvent::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_.dev_name_){}
109     , decltype(_impl_.freq_){::uint64_t{0u}}
110     , decltype(_impl_.prev_freq_){::uint64_t{0u}}
111     , decltype(_impl_.busy_time_){::uint64_t{0u}}
112     , decltype(_impl_.total_time_){::uint64_t{0u}}
113   };
114   _impl_.dev_name_.InitDefault();
115   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
116     _impl_.dev_name_.Set("", GetArenaForAllocation());
117   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
118 }
119 
~DevfreqFrequencyFtraceEvent()120 DevfreqFrequencyFtraceEvent::~DevfreqFrequencyFtraceEvent() {
121   // @@protoc_insertion_point(destructor:perfetto.protos.DevfreqFrequencyFtraceEvent)
122   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
123   (void)arena;
124     return;
125   }
126   SharedDtor();
127 }
128 
SharedDtor()129 inline void DevfreqFrequencyFtraceEvent::SharedDtor() {
130   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
131   _impl_.dev_name_.Destroy();
132 }
133 
SetCachedSize(int size) const134 void DevfreqFrequencyFtraceEvent::SetCachedSize(int size) const {
135   _impl_._cached_size_.Set(size);
136 }
137 
Clear()138 void DevfreqFrequencyFtraceEvent::Clear() {
139 // @@protoc_insertion_point(message_clear_start:perfetto.protos.DevfreqFrequencyFtraceEvent)
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_.dev_name_.ClearNonDefaultToEmpty();
147   }
148   if (cached_has_bits & 0x0000001eu) {
149     ::memset(&_impl_.freq_, 0, static_cast<size_t>(
150         reinterpret_cast<char*>(&_impl_.total_time_) -
151         reinterpret_cast<char*>(&_impl_.freq_)) + sizeof(_impl_.total_time_));
152   }
153   _impl_._has_bits_.Clear();
154   _internal_metadata_.Clear<std::string>();
155 }
156 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)157 const char* DevfreqFrequencyFtraceEvent::_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 dev_name = 1;
165       case 1:
166         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
167           auto str = _internal_mutable_dev_name();
168           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
169           CHK_(ptr);
170         } else {
171           goto handle_unusual;
172         }
173         continue;
174       // optional uint64 freq = 2;
175       case 2:
176         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
177           _Internal::set_has_freq(&has_bits);
178           _impl_.freq_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
179           CHK_(ptr);
180         } else {
181           goto handle_unusual;
182         }
183         continue;
184       // optional uint64 prev_freq = 3;
185       case 3:
186         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
187           _Internal::set_has_prev_freq(&has_bits);
188           _impl_.prev_freq_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
189           CHK_(ptr);
190         } else {
191           goto handle_unusual;
192         }
193         continue;
194       // optional uint64 busy_time = 4;
195       case 4:
196         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
197           _Internal::set_has_busy_time(&has_bits);
198           _impl_.busy_time_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
199           CHK_(ptr);
200         } else {
201           goto handle_unusual;
202         }
203         continue;
204       // optional uint64 total_time = 5;
205       case 5:
206         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
207           _Internal::set_has_total_time(&has_bits);
208           _impl_.total_time_ = ::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* DevfreqFrequencyFtraceEvent::_InternalSerialize(
239     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
240   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.DevfreqFrequencyFtraceEvent)
241   ::uint32_t cached_has_bits = 0;
242   (void) cached_has_bits;
243 
244   cached_has_bits = _impl_._has_bits_[0];
245   // optional string dev_name = 1;
246   if (cached_has_bits & 0x00000001u) {
247     target = stream->WriteStringMaybeAliased(
248         1, this->_internal_dev_name(), target);
249   }
250 
251   // optional uint64 freq = 2;
252   if (cached_has_bits & 0x00000002u) {
253     target = stream->EnsureSpace(target);
254     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_freq(), target);
255   }
256 
257   // optional uint64 prev_freq = 3;
258   if (cached_has_bits & 0x00000004u) {
259     target = stream->EnsureSpace(target);
260     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_prev_freq(), target);
261   }
262 
263   // optional uint64 busy_time = 4;
264   if (cached_has_bits & 0x00000008u) {
265     target = stream->EnsureSpace(target);
266     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_busy_time(), target);
267   }
268 
269   // optional uint64 total_time = 5;
270   if (cached_has_bits & 0x00000010u) {
271     target = stream->EnsureSpace(target);
272     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_total_time(), 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.DevfreqFrequencyFtraceEvent)
280   return target;
281 }
282 
ByteSizeLong() const283 size_t DevfreqFrequencyFtraceEvent::ByteSizeLong() const {
284 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.DevfreqFrequencyFtraceEvent)
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 dev_name = 1;
294     if (cached_has_bits & 0x00000001u) {
295       total_size += 1 +
296         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
297           this->_internal_dev_name());
298     }
299 
300     // optional uint64 freq = 2;
301     if (cached_has_bits & 0x00000002u) {
302       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_freq());
303     }
304 
305     // optional uint64 prev_freq = 3;
306     if (cached_has_bits & 0x00000004u) {
307       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_prev_freq());
308     }
309 
310     // optional uint64 busy_time = 4;
311     if (cached_has_bits & 0x00000008u) {
312       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_busy_time());
313     }
314 
315     // optional uint64 total_time = 5;
316     if (cached_has_bits & 0x00000010u) {
317       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_total_time());
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 DevfreqFrequencyFtraceEvent::CheckTypeAndMergeFrom(
330     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
331   MergeFrom(*::_pbi::DownCast<const DevfreqFrequencyFtraceEvent*>(
332       &from));
333 }
334 
MergeFrom(const DevfreqFrequencyFtraceEvent & from)335 void DevfreqFrequencyFtraceEvent::MergeFrom(const DevfreqFrequencyFtraceEvent& from) {
336   DevfreqFrequencyFtraceEvent* const _this = this;
337   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.DevfreqFrequencyFtraceEvent)
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_dev_name(from._internal_dev_name());
346     }
347     if (cached_has_bits & 0x00000002u) {
348       _this->_impl_.freq_ = from._impl_.freq_;
349     }
350     if (cached_has_bits & 0x00000004u) {
351       _this->_impl_.prev_freq_ = from._impl_.prev_freq_;
352     }
353     if (cached_has_bits & 0x00000008u) {
354       _this->_impl_.busy_time_ = from._impl_.busy_time_;
355     }
356     if (cached_has_bits & 0x00000010u) {
357       _this->_impl_.total_time_ = from._impl_.total_time_;
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 DevfreqFrequencyFtraceEvent & from)364 void DevfreqFrequencyFtraceEvent::CopyFrom(const DevfreqFrequencyFtraceEvent& from) {
365 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.DevfreqFrequencyFtraceEvent)
366   if (&from == this) return;
367   Clear();
368   MergeFrom(from);
369 }
370 
IsInitialized() const371 bool DevfreqFrequencyFtraceEvent::IsInitialized() const {
372   return true;
373 }
374 
InternalSwap(DevfreqFrequencyFtraceEvent * other)375 void DevfreqFrequencyFtraceEvent::InternalSwap(DevfreqFrequencyFtraceEvent* 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_.dev_name_, lhs_arena,
383       &other->_impl_.dev_name_, rhs_arena
384   );
385   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
386       PROTOBUF_FIELD_OFFSET(DevfreqFrequencyFtraceEvent, _impl_.total_time_)
387       + sizeof(DevfreqFrequencyFtraceEvent::_impl_.total_time_)  // NOLINT
388       - PROTOBUF_FIELD_OFFSET(DevfreqFrequencyFtraceEvent, _impl_.freq_)>(
389           reinterpret_cast<char*>(&_impl_.freq_),
390           reinterpret_cast<char*>(&other->_impl_.freq_));
391 }
392 
GetTypeName() const393 std::string DevfreqFrequencyFtraceEvent::GetTypeName() const {
394   return "perfetto.protos.DevfreqFrequencyFtraceEvent";
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::DevfreqFrequencyFtraceEvent*
CreateMaybeMessage(Arena * arena)403 Arena::CreateMaybeMessage< ::perfetto::protos::DevfreqFrequencyFtraceEvent >(Arena* arena) {
404   return Arena::CreateMessageInternal< ::perfetto::protos::DevfreqFrequencyFtraceEvent >(arena);
405 }
406 PROTOBUF_NAMESPACE_CLOSE
407 
408 // @@protoc_insertion_point(global_scope)
409 #include <google/protobuf/port_undef.inc>
410