1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/config/profiling/perf_event_config.proto
3 
4 #include "protos/perfetto/config/profiling/perf_event_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 {
PerfEventConfig_CallstackSampling(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR PerfEventConfig_CallstackSampling::PerfEventConfig_CallstackSampling(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.scope_)*/nullptr
28   , /*decltype(_impl_.kernel_frames_)*/false
29   , /*decltype(_impl_.user_frames_)*/0} {}
30 struct PerfEventConfig_CallstackSamplingDefaultTypeInternal {
PerfEventConfig_CallstackSamplingDefaultTypeInternalperfetto::protos::PerfEventConfig_CallstackSamplingDefaultTypeInternal31   PROTOBUF_CONSTEXPR PerfEventConfig_CallstackSamplingDefaultTypeInternal()
32       : _instance(::_pbi::ConstantInitialized{}) {}
~PerfEventConfig_CallstackSamplingDefaultTypeInternalperfetto::protos::PerfEventConfig_CallstackSamplingDefaultTypeInternal33   ~PerfEventConfig_CallstackSamplingDefaultTypeInternal() {}
34   union {  // NOLINT(misc-non-private-member-variables-in-classes)
35     PerfEventConfig_CallstackSampling _instance;
36   };
37 };
38 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PerfEventConfig_CallstackSamplingDefaultTypeInternal _PerfEventConfig_CallstackSampling_default_instance_;
PerfEventConfig_Scope(::_pbi::ConstantInitialized)39 PROTOBUF_CONSTEXPR PerfEventConfig_Scope::PerfEventConfig_Scope(
40     ::_pbi::ConstantInitialized): _impl_{
41     /*decltype(_impl_._has_bits_)*/{}
42   , /*decltype(_impl_._cached_size_)*/{}
43   , /*decltype(_impl_.target_pid_)*/{}
44   , /*decltype(_impl_.target_cmdline_)*/{}
45   , /*decltype(_impl_.exclude_pid_)*/{}
46   , /*decltype(_impl_.exclude_cmdline_)*/{}
47   , /*decltype(_impl_.additional_cmdline_count_)*/0u
48   , /*decltype(_impl_.process_shard_count_)*/0u} {}
49 struct PerfEventConfig_ScopeDefaultTypeInternal {
PerfEventConfig_ScopeDefaultTypeInternalperfetto::protos::PerfEventConfig_ScopeDefaultTypeInternal50   PROTOBUF_CONSTEXPR PerfEventConfig_ScopeDefaultTypeInternal()
51       : _instance(::_pbi::ConstantInitialized{}) {}
~PerfEventConfig_ScopeDefaultTypeInternalperfetto::protos::PerfEventConfig_ScopeDefaultTypeInternal52   ~PerfEventConfig_ScopeDefaultTypeInternal() {}
53   union {  // NOLINT(misc-non-private-member-variables-in-classes)
54     PerfEventConfig_Scope _instance;
55   };
56 };
57 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PerfEventConfig_ScopeDefaultTypeInternal _PerfEventConfig_Scope_default_instance_;
PerfEventConfig(::_pbi::ConstantInitialized)58 PROTOBUF_CONSTEXPR PerfEventConfig::PerfEventConfig(
59     ::_pbi::ConstantInitialized): _impl_{
60     /*decltype(_impl_._has_bits_)*/{}
61   , /*decltype(_impl_._cached_size_)*/{}
62   , /*decltype(_impl_.target_pid_)*/{}
63   , /*decltype(_impl_.target_cmdline_)*/{}
64   , /*decltype(_impl_.exclude_pid_)*/{}
65   , /*decltype(_impl_.exclude_cmdline_)*/{}
66   , /*decltype(_impl_.target_installed_by_)*/{}
67   , /*decltype(_impl_.followers_)*/{}
68   , /*decltype(_impl_.timebase_)*/nullptr
69   , /*decltype(_impl_.callstack_sampling_)*/nullptr
70   , /*decltype(_impl_.sampling_frequency_)*/0u
71   , /*decltype(_impl_.ring_buffer_pages_)*/0u
72   , /*decltype(_impl_.all_cpus_)*/false
73   , /*decltype(_impl_.kernel_frames_)*/false
74   , /*decltype(_impl_.ring_buffer_read_period_ms_)*/0u
75   , /*decltype(_impl_.remote_descriptor_timeout_ms_)*/0u
76   , /*decltype(_impl_.unwind_state_clear_period_ms_)*/0u
77   , /*decltype(_impl_.additional_cmdline_count_)*/0u
78   , /*decltype(_impl_.max_daemon_memory_kb_)*/0u
79   , /*decltype(_impl_.max_enqueued_footprint_kb_)*/::uint64_t{0u}} {}
80 struct PerfEventConfigDefaultTypeInternal {
PerfEventConfigDefaultTypeInternalperfetto::protos::PerfEventConfigDefaultTypeInternal81   PROTOBUF_CONSTEXPR PerfEventConfigDefaultTypeInternal()
82       : _instance(::_pbi::ConstantInitialized{}) {}
~PerfEventConfigDefaultTypeInternalperfetto::protos::PerfEventConfigDefaultTypeInternal83   ~PerfEventConfigDefaultTypeInternal() {}
84   union {  // NOLINT(misc-non-private-member-variables-in-classes)
85     PerfEventConfig _instance;
86   };
87 };
88 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 PerfEventConfigDefaultTypeInternal _PerfEventConfig_default_instance_;
89 }  // namespace protos
90 }  // namespace perfetto
91 namespace perfetto {
92 namespace protos {
PerfEventConfig_UnwindMode_IsValid(int value)93 bool PerfEventConfig_UnwindMode_IsValid(int value) {
94   switch (value) {
95     case 0:
96     case 1:
97     case 2:
98     case 3:
99       return true;
100     default:
101       return false;
102   }
103 }
104 
105 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> PerfEventConfig_UnwindMode_strings[4] = {};
106 
107 static const char PerfEventConfig_UnwindMode_names[] =
108   "UNWIND_DWARF"
109   "UNWIND_FRAME_POINTER"
110   "UNWIND_SKIP"
111   "UNWIND_UNKNOWN";
112 
113 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry PerfEventConfig_UnwindMode_entries[] = {
114   { {PerfEventConfig_UnwindMode_names + 0, 12}, 2 },
115   { {PerfEventConfig_UnwindMode_names + 12, 20}, 3 },
116   { {PerfEventConfig_UnwindMode_names + 32, 11}, 1 },
117   { {PerfEventConfig_UnwindMode_names + 43, 14}, 0 },
118 };
119 
120 static const int PerfEventConfig_UnwindMode_entries_by_number[] = {
121   3, // 0 -> UNWIND_UNKNOWN
122   2, // 1 -> UNWIND_SKIP
123   0, // 2 -> UNWIND_DWARF
124   1, // 3 -> UNWIND_FRAME_POINTER
125 };
126 
PerfEventConfig_UnwindMode_Name(PerfEventConfig_UnwindMode value)127 const std::string& PerfEventConfig_UnwindMode_Name(
128     PerfEventConfig_UnwindMode value) {
129   static const bool dummy =
130       ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
131           PerfEventConfig_UnwindMode_entries,
132           PerfEventConfig_UnwindMode_entries_by_number,
133           4, PerfEventConfig_UnwindMode_strings);
134   (void) dummy;
135   int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
136       PerfEventConfig_UnwindMode_entries,
137       PerfEventConfig_UnwindMode_entries_by_number,
138       4, value);
139   return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
140                      PerfEventConfig_UnwindMode_strings[idx].get();
141 }
PerfEventConfig_UnwindMode_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,PerfEventConfig_UnwindMode * value)142 bool PerfEventConfig_UnwindMode_Parse(
143     ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, PerfEventConfig_UnwindMode* value) {
144   int int_value;
145   bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
146       PerfEventConfig_UnwindMode_entries, 4, name, &int_value);
147   if (success) {
148     *value = static_cast<PerfEventConfig_UnwindMode>(int_value);
149   }
150   return success;
151 }
152 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
153 constexpr PerfEventConfig_UnwindMode PerfEventConfig::UNWIND_UNKNOWN;
154 constexpr PerfEventConfig_UnwindMode PerfEventConfig::UNWIND_SKIP;
155 constexpr PerfEventConfig_UnwindMode PerfEventConfig::UNWIND_DWARF;
156 constexpr PerfEventConfig_UnwindMode PerfEventConfig::UNWIND_FRAME_POINTER;
157 constexpr PerfEventConfig_UnwindMode PerfEventConfig::UnwindMode_MIN;
158 constexpr PerfEventConfig_UnwindMode PerfEventConfig::UnwindMode_MAX;
159 constexpr int PerfEventConfig::UnwindMode_ARRAYSIZE;
160 #endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
161 
162 // ===================================================================
163 
164 class PerfEventConfig_CallstackSampling::_Internal {
165  public:
166   using HasBits = decltype(std::declval<PerfEventConfig_CallstackSampling>()._impl_._has_bits_);
167   static const ::perfetto::protos::PerfEventConfig_Scope& scope(const PerfEventConfig_CallstackSampling* msg);
set_has_scope(HasBits * has_bits)168   static void set_has_scope(HasBits* has_bits) {
169     (*has_bits)[0] |= 1u;
170   }
set_has_kernel_frames(HasBits * has_bits)171   static void set_has_kernel_frames(HasBits* has_bits) {
172     (*has_bits)[0] |= 2u;
173   }
set_has_user_frames(HasBits * has_bits)174   static void set_has_user_frames(HasBits* has_bits) {
175     (*has_bits)[0] |= 4u;
176   }
177 };
178 
179 const ::perfetto::protos::PerfEventConfig_Scope&
scope(const PerfEventConfig_CallstackSampling * msg)180 PerfEventConfig_CallstackSampling::_Internal::scope(const PerfEventConfig_CallstackSampling* msg) {
181   return *msg->_impl_.scope_;
182 }
PerfEventConfig_CallstackSampling(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)183 PerfEventConfig_CallstackSampling::PerfEventConfig_CallstackSampling(::PROTOBUF_NAMESPACE_ID::Arena* arena,
184                          bool is_message_owned)
185   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
186   SharedCtor(arena, is_message_owned);
187   // @@protoc_insertion_point(arena_constructor:perfetto.protos.PerfEventConfig.CallstackSampling)
188 }
PerfEventConfig_CallstackSampling(const PerfEventConfig_CallstackSampling & from)189 PerfEventConfig_CallstackSampling::PerfEventConfig_CallstackSampling(const PerfEventConfig_CallstackSampling& from)
190   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
191   PerfEventConfig_CallstackSampling* const _this = this; (void)_this;
192   new (&_impl_) Impl_{
193       decltype(_impl_._has_bits_){from._impl_._has_bits_}
194     , /*decltype(_impl_._cached_size_)*/{}
195     , decltype(_impl_.scope_){nullptr}
196     , decltype(_impl_.kernel_frames_){}
197     , decltype(_impl_.user_frames_){}};
198 
199   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
200   if (from._internal_has_scope()) {
201     _this->_impl_.scope_ = new ::perfetto::protos::PerfEventConfig_Scope(*from._impl_.scope_);
202   }
203   ::memcpy(&_impl_.kernel_frames_, &from._impl_.kernel_frames_,
204     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.user_frames_) -
205     reinterpret_cast<char*>(&_impl_.kernel_frames_)) + sizeof(_impl_.user_frames_));
206   // @@protoc_insertion_point(copy_constructor:perfetto.protos.PerfEventConfig.CallstackSampling)
207 }
208 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)209 inline void PerfEventConfig_CallstackSampling::SharedCtor(
210     ::_pb::Arena* arena, bool is_message_owned) {
211   (void)arena;
212   (void)is_message_owned;
213   new (&_impl_) Impl_{
214       decltype(_impl_._has_bits_){}
215     , /*decltype(_impl_._cached_size_)*/{}
216     , decltype(_impl_.scope_){nullptr}
217     , decltype(_impl_.kernel_frames_){false}
218     , decltype(_impl_.user_frames_){0}
219   };
220 }
221 
~PerfEventConfig_CallstackSampling()222 PerfEventConfig_CallstackSampling::~PerfEventConfig_CallstackSampling() {
223   // @@protoc_insertion_point(destructor:perfetto.protos.PerfEventConfig.CallstackSampling)
224   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
225   (void)arena;
226     return;
227   }
228   SharedDtor();
229 }
230 
SharedDtor()231 inline void PerfEventConfig_CallstackSampling::SharedDtor() {
232   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
233   if (this != internal_default_instance()) delete _impl_.scope_;
234 }
235 
SetCachedSize(int size) const236 void PerfEventConfig_CallstackSampling::SetCachedSize(int size) const {
237   _impl_._cached_size_.Set(size);
238 }
239 
Clear()240 void PerfEventConfig_CallstackSampling::Clear() {
241 // @@protoc_insertion_point(message_clear_start:perfetto.protos.PerfEventConfig.CallstackSampling)
242   ::uint32_t cached_has_bits = 0;
243   // Prevent compiler warnings about cached_has_bits being unused
244   (void) cached_has_bits;
245 
246   cached_has_bits = _impl_._has_bits_[0];
247   if (cached_has_bits & 0x00000001u) {
248     GOOGLE_DCHECK(_impl_.scope_ != nullptr);
249     _impl_.scope_->Clear();
250   }
251   if (cached_has_bits & 0x00000006u) {
252     ::memset(&_impl_.kernel_frames_, 0, static_cast<size_t>(
253         reinterpret_cast<char*>(&_impl_.user_frames_) -
254         reinterpret_cast<char*>(&_impl_.kernel_frames_)) + sizeof(_impl_.user_frames_));
255   }
256   _impl_._has_bits_.Clear();
257   _internal_metadata_.Clear<std::string>();
258 }
259 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)260 const char* PerfEventConfig_CallstackSampling::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
261 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
262   _Internal::HasBits has_bits{};
263   while (!ctx->Done(&ptr)) {
264     ::uint32_t tag;
265     ptr = ::_pbi::ReadTag(ptr, &tag);
266     switch (tag >> 3) {
267       // optional .perfetto.protos.PerfEventConfig.Scope scope = 1;
268       case 1:
269         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
270           ptr = ctx->ParseMessage(_internal_mutable_scope(), ptr);
271           CHK_(ptr);
272         } else {
273           goto handle_unusual;
274         }
275         continue;
276       // optional bool kernel_frames = 2;
277       case 2:
278         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
279           _Internal::set_has_kernel_frames(&has_bits);
280           _impl_.kernel_frames_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
281           CHK_(ptr);
282         } else {
283           goto handle_unusual;
284         }
285         continue;
286       // optional .perfetto.protos.PerfEventConfig.UnwindMode user_frames = 3;
287       case 3:
288         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
289           ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
290           CHK_(ptr);
291           if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::PerfEventConfig_UnwindMode_IsValid(val))) {
292             _internal_set_user_frames(static_cast<::perfetto::protos::PerfEventConfig_UnwindMode>(val));
293           } else {
294             ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(3, val, mutable_unknown_fields());
295           }
296         } else {
297           goto handle_unusual;
298         }
299         continue;
300       default:
301         goto handle_unusual;
302     }  // switch
303   handle_unusual:
304     if ((tag == 0) || ((tag & 7) == 4)) {
305       CHK_(ptr);
306       ctx->SetLastTag(tag);
307       goto message_done;
308     }
309     ptr = UnknownFieldParse(
310         tag,
311         _internal_metadata_.mutable_unknown_fields<std::string>(),
312         ptr, ctx);
313     CHK_(ptr != nullptr);
314   }  // while
315 message_done:
316   _impl_._has_bits_.Or(has_bits);
317   return ptr;
318 failure:
319   ptr = nullptr;
320   goto message_done;
321 #undef CHK_
322 }
323 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const324 ::uint8_t* PerfEventConfig_CallstackSampling::_InternalSerialize(
325     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
326   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.PerfEventConfig.CallstackSampling)
327   ::uint32_t cached_has_bits = 0;
328   (void) cached_has_bits;
329 
330   cached_has_bits = _impl_._has_bits_[0];
331   // optional .perfetto.protos.PerfEventConfig.Scope scope = 1;
332   if (cached_has_bits & 0x00000001u) {
333     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
334       InternalWriteMessage(1, _Internal::scope(this),
335         _Internal::scope(this).GetCachedSize(), target, stream);
336   }
337 
338   // optional bool kernel_frames = 2;
339   if (cached_has_bits & 0x00000002u) {
340     target = stream->EnsureSpace(target);
341     target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_kernel_frames(), target);
342   }
343 
344   // optional .perfetto.protos.PerfEventConfig.UnwindMode user_frames = 3;
345   if (cached_has_bits & 0x00000004u) {
346     target = stream->EnsureSpace(target);
347     target = ::_pbi::WireFormatLite::WriteEnumToArray(
348       3, this->_internal_user_frames(), target);
349   }
350 
351   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
352     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
353         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
354   }
355   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.PerfEventConfig.CallstackSampling)
356   return target;
357 }
358 
ByteSizeLong() const359 size_t PerfEventConfig_CallstackSampling::ByteSizeLong() const {
360 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.PerfEventConfig.CallstackSampling)
361   size_t total_size = 0;
362 
363   ::uint32_t cached_has_bits = 0;
364   // Prevent compiler warnings about cached_has_bits being unused
365   (void) cached_has_bits;
366 
367   cached_has_bits = _impl_._has_bits_[0];
368   if (cached_has_bits & 0x00000007u) {
369     // optional .perfetto.protos.PerfEventConfig.Scope scope = 1;
370     if (cached_has_bits & 0x00000001u) {
371       total_size += 1 +
372         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
373           *_impl_.scope_);
374     }
375 
376     // optional bool kernel_frames = 2;
377     if (cached_has_bits & 0x00000002u) {
378       total_size += 1 + 1;
379     }
380 
381     // optional .perfetto.protos.PerfEventConfig.UnwindMode user_frames = 3;
382     if (cached_has_bits & 0x00000004u) {
383       total_size += 1 +
384         ::_pbi::WireFormatLite::EnumSize(this->_internal_user_frames());
385     }
386 
387   }
388   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
389     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
390   }
391   int cached_size = ::_pbi::ToCachedSize(total_size);
392   SetCachedSize(cached_size);
393   return total_size;
394 }
395 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)396 void PerfEventConfig_CallstackSampling::CheckTypeAndMergeFrom(
397     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
398   MergeFrom(*::_pbi::DownCast<const PerfEventConfig_CallstackSampling*>(
399       &from));
400 }
401 
MergeFrom(const PerfEventConfig_CallstackSampling & from)402 void PerfEventConfig_CallstackSampling::MergeFrom(const PerfEventConfig_CallstackSampling& from) {
403   PerfEventConfig_CallstackSampling* const _this = this;
404   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.PerfEventConfig.CallstackSampling)
405   GOOGLE_DCHECK_NE(&from, _this);
406   ::uint32_t cached_has_bits = 0;
407   (void) cached_has_bits;
408 
409   cached_has_bits = from._impl_._has_bits_[0];
410   if (cached_has_bits & 0x00000007u) {
411     if (cached_has_bits & 0x00000001u) {
412       _this->_internal_mutable_scope()->::perfetto::protos::PerfEventConfig_Scope::MergeFrom(
413           from._internal_scope());
414     }
415     if (cached_has_bits & 0x00000002u) {
416       _this->_impl_.kernel_frames_ = from._impl_.kernel_frames_;
417     }
418     if (cached_has_bits & 0x00000004u) {
419       _this->_impl_.user_frames_ = from._impl_.user_frames_;
420     }
421     _this->_impl_._has_bits_[0] |= cached_has_bits;
422   }
423   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
424 }
425 
CopyFrom(const PerfEventConfig_CallstackSampling & from)426 void PerfEventConfig_CallstackSampling::CopyFrom(const PerfEventConfig_CallstackSampling& from) {
427 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.PerfEventConfig.CallstackSampling)
428   if (&from == this) return;
429   Clear();
430   MergeFrom(from);
431 }
432 
IsInitialized() const433 bool PerfEventConfig_CallstackSampling::IsInitialized() const {
434   return true;
435 }
436 
InternalSwap(PerfEventConfig_CallstackSampling * other)437 void PerfEventConfig_CallstackSampling::InternalSwap(PerfEventConfig_CallstackSampling* other) {
438   using std::swap;
439   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
440   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
441   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
442       PROTOBUF_FIELD_OFFSET(PerfEventConfig_CallstackSampling, _impl_.user_frames_)
443       + sizeof(PerfEventConfig_CallstackSampling::_impl_.user_frames_)  // NOLINT
444       - PROTOBUF_FIELD_OFFSET(PerfEventConfig_CallstackSampling, _impl_.scope_)>(
445           reinterpret_cast<char*>(&_impl_.scope_),
446           reinterpret_cast<char*>(&other->_impl_.scope_));
447 }
448 
GetTypeName() const449 std::string PerfEventConfig_CallstackSampling::GetTypeName() const {
450   return "perfetto.protos.PerfEventConfig.CallstackSampling";
451 }
452 
453 
454 // ===================================================================
455 
456 class PerfEventConfig_Scope::_Internal {
457  public:
458   using HasBits = decltype(std::declval<PerfEventConfig_Scope>()._impl_._has_bits_);
set_has_additional_cmdline_count(HasBits * has_bits)459   static void set_has_additional_cmdline_count(HasBits* has_bits) {
460     (*has_bits)[0] |= 1u;
461   }
set_has_process_shard_count(HasBits * has_bits)462   static void set_has_process_shard_count(HasBits* has_bits) {
463     (*has_bits)[0] |= 2u;
464   }
465 };
466 
PerfEventConfig_Scope(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)467 PerfEventConfig_Scope::PerfEventConfig_Scope(::PROTOBUF_NAMESPACE_ID::Arena* arena,
468                          bool is_message_owned)
469   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
470   SharedCtor(arena, is_message_owned);
471   // @@protoc_insertion_point(arena_constructor:perfetto.protos.PerfEventConfig.Scope)
472 }
PerfEventConfig_Scope(const PerfEventConfig_Scope & from)473 PerfEventConfig_Scope::PerfEventConfig_Scope(const PerfEventConfig_Scope& from)
474   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
475   PerfEventConfig_Scope* const _this = this; (void)_this;
476   new (&_impl_) Impl_{
477       decltype(_impl_._has_bits_){from._impl_._has_bits_}
478     , /*decltype(_impl_._cached_size_)*/{}
479     , decltype(_impl_.target_pid_){from._impl_.target_pid_}
480     , decltype(_impl_.target_cmdline_){from._impl_.target_cmdline_}
481     , decltype(_impl_.exclude_pid_){from._impl_.exclude_pid_}
482     , decltype(_impl_.exclude_cmdline_){from._impl_.exclude_cmdline_}
483     , decltype(_impl_.additional_cmdline_count_){}
484     , decltype(_impl_.process_shard_count_){}};
485 
486   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
487   ::memcpy(&_impl_.additional_cmdline_count_, &from._impl_.additional_cmdline_count_,
488     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.process_shard_count_) -
489     reinterpret_cast<char*>(&_impl_.additional_cmdline_count_)) + sizeof(_impl_.process_shard_count_));
490   // @@protoc_insertion_point(copy_constructor:perfetto.protos.PerfEventConfig.Scope)
491 }
492 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)493 inline void PerfEventConfig_Scope::SharedCtor(
494     ::_pb::Arena* arena, bool is_message_owned) {
495   (void)arena;
496   (void)is_message_owned;
497   new (&_impl_) Impl_{
498       decltype(_impl_._has_bits_){}
499     , /*decltype(_impl_._cached_size_)*/{}
500     , decltype(_impl_.target_pid_){arena}
501     , decltype(_impl_.target_cmdline_){arena}
502     , decltype(_impl_.exclude_pid_){arena}
503     , decltype(_impl_.exclude_cmdline_){arena}
504     , decltype(_impl_.additional_cmdline_count_){0u}
505     , decltype(_impl_.process_shard_count_){0u}
506   };
507 }
508 
~PerfEventConfig_Scope()509 PerfEventConfig_Scope::~PerfEventConfig_Scope() {
510   // @@protoc_insertion_point(destructor:perfetto.protos.PerfEventConfig.Scope)
511   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
512   (void)arena;
513     return;
514   }
515   SharedDtor();
516 }
517 
SharedDtor()518 inline void PerfEventConfig_Scope::SharedDtor() {
519   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
520   _impl_.target_pid_.~RepeatedField();
521   _impl_.target_cmdline_.~RepeatedPtrField();
522   _impl_.exclude_pid_.~RepeatedField();
523   _impl_.exclude_cmdline_.~RepeatedPtrField();
524 }
525 
SetCachedSize(int size) const526 void PerfEventConfig_Scope::SetCachedSize(int size) const {
527   _impl_._cached_size_.Set(size);
528 }
529 
Clear()530 void PerfEventConfig_Scope::Clear() {
531 // @@protoc_insertion_point(message_clear_start:perfetto.protos.PerfEventConfig.Scope)
532   ::uint32_t cached_has_bits = 0;
533   // Prevent compiler warnings about cached_has_bits being unused
534   (void) cached_has_bits;
535 
536   _impl_.target_pid_.Clear();
537   _impl_.target_cmdline_.Clear();
538   _impl_.exclude_pid_.Clear();
539   _impl_.exclude_cmdline_.Clear();
540   cached_has_bits = _impl_._has_bits_[0];
541   if (cached_has_bits & 0x00000003u) {
542     ::memset(&_impl_.additional_cmdline_count_, 0, static_cast<size_t>(
543         reinterpret_cast<char*>(&_impl_.process_shard_count_) -
544         reinterpret_cast<char*>(&_impl_.additional_cmdline_count_)) + sizeof(_impl_.process_shard_count_));
545   }
546   _impl_._has_bits_.Clear();
547   _internal_metadata_.Clear<std::string>();
548 }
549 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)550 const char* PerfEventConfig_Scope::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
551 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
552   _Internal::HasBits has_bits{};
553   while (!ctx->Done(&ptr)) {
554     ::uint32_t tag;
555     ptr = ::_pbi::ReadTag(ptr, &tag);
556     switch (tag >> 3) {
557       // repeated int32 target_pid = 1;
558       case 1:
559         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
560           ptr -= 1;
561           do {
562             ptr += 1;
563             _internal_add_target_pid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
564             CHK_(ptr);
565             if (!ctx->DataAvailable(ptr)) break;
566           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<8>(ptr));
567         } else if (static_cast<::uint8_t>(tag) == 10) {
568           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_target_pid(), ptr, ctx);
569           CHK_(ptr);
570         } else {
571           goto handle_unusual;
572         }
573         continue;
574       // repeated string target_cmdline = 2;
575       case 2:
576         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
577           ptr -= 1;
578           do {
579             ptr += 1;
580             auto str = _internal_add_target_cmdline();
581             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
582             CHK_(ptr);
583             if (!ctx->DataAvailable(ptr)) break;
584           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
585         } else {
586           goto handle_unusual;
587         }
588         continue;
589       // repeated int32 exclude_pid = 3;
590       case 3:
591         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
592           ptr -= 1;
593           do {
594             ptr += 1;
595             _internal_add_exclude_pid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
596             CHK_(ptr);
597             if (!ctx->DataAvailable(ptr)) break;
598           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr));
599         } else if (static_cast<::uint8_t>(tag) == 26) {
600           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_exclude_pid(), ptr, ctx);
601           CHK_(ptr);
602         } else {
603           goto handle_unusual;
604         }
605         continue;
606       // repeated string exclude_cmdline = 4;
607       case 4:
608         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
609           ptr -= 1;
610           do {
611             ptr += 1;
612             auto str = _internal_add_exclude_cmdline();
613             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
614             CHK_(ptr);
615             if (!ctx->DataAvailable(ptr)) break;
616           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
617         } else {
618           goto handle_unusual;
619         }
620         continue;
621       // optional uint32 additional_cmdline_count = 5;
622       case 5:
623         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
624           _Internal::set_has_additional_cmdline_count(&has_bits);
625           _impl_.additional_cmdline_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
626           CHK_(ptr);
627         } else {
628           goto handle_unusual;
629         }
630         continue;
631       // optional uint32 process_shard_count = 6;
632       case 6:
633         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
634           _Internal::set_has_process_shard_count(&has_bits);
635           _impl_.process_shard_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
636           CHK_(ptr);
637         } else {
638           goto handle_unusual;
639         }
640         continue;
641       default:
642         goto handle_unusual;
643     }  // switch
644   handle_unusual:
645     if ((tag == 0) || ((tag & 7) == 4)) {
646       CHK_(ptr);
647       ctx->SetLastTag(tag);
648       goto message_done;
649     }
650     ptr = UnknownFieldParse(
651         tag,
652         _internal_metadata_.mutable_unknown_fields<std::string>(),
653         ptr, ctx);
654     CHK_(ptr != nullptr);
655   }  // while
656 message_done:
657   _impl_._has_bits_.Or(has_bits);
658   return ptr;
659 failure:
660   ptr = nullptr;
661   goto message_done;
662 #undef CHK_
663 }
664 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const665 ::uint8_t* PerfEventConfig_Scope::_InternalSerialize(
666     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
667   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.PerfEventConfig.Scope)
668   ::uint32_t cached_has_bits = 0;
669   (void) cached_has_bits;
670 
671   // repeated int32 target_pid = 1;
672   for (int i = 0, n = this->_internal_target_pid_size(); i < n; i++) {
673     target = stream->EnsureSpace(target);
674     target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_target_pid(i), target);
675   }
676 
677   // repeated string target_cmdline = 2;
678   for (int i = 0, n = this->_internal_target_cmdline_size(); i < n; i++) {
679     const auto& s = this->_internal_target_cmdline(i);
680     target = stream->WriteString(2, s, target);
681   }
682 
683   // repeated int32 exclude_pid = 3;
684   for (int i = 0, n = this->_internal_exclude_pid_size(); i < n; i++) {
685     target = stream->EnsureSpace(target);
686     target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_exclude_pid(i), target);
687   }
688 
689   // repeated string exclude_cmdline = 4;
690   for (int i = 0, n = this->_internal_exclude_cmdline_size(); i < n; i++) {
691     const auto& s = this->_internal_exclude_cmdline(i);
692     target = stream->WriteString(4, s, target);
693   }
694 
695   cached_has_bits = _impl_._has_bits_[0];
696   // optional uint32 additional_cmdline_count = 5;
697   if (cached_has_bits & 0x00000001u) {
698     target = stream->EnsureSpace(target);
699     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_additional_cmdline_count(), target);
700   }
701 
702   // optional uint32 process_shard_count = 6;
703   if (cached_has_bits & 0x00000002u) {
704     target = stream->EnsureSpace(target);
705     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_process_shard_count(), target);
706   }
707 
708   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
709     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
710         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
711   }
712   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.PerfEventConfig.Scope)
713   return target;
714 }
715 
ByteSizeLong() const716 size_t PerfEventConfig_Scope::ByteSizeLong() const {
717 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.PerfEventConfig.Scope)
718   size_t total_size = 0;
719 
720   ::uint32_t cached_has_bits = 0;
721   // Prevent compiler warnings about cached_has_bits being unused
722   (void) cached_has_bits;
723 
724   // repeated int32 target_pid = 1;
725   {
726     size_t data_size = ::_pbi::WireFormatLite::
727       Int32Size(this->_impl_.target_pid_);
728     total_size += 1 *
729                   ::_pbi::FromIntSize(this->_internal_target_pid_size());
730     total_size += data_size;
731   }
732 
733   // repeated string target_cmdline = 2;
734   total_size += 1 *
735       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.target_cmdline_.size());
736   for (int i = 0, n = _impl_.target_cmdline_.size(); i < n; i++) {
737     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
738       _impl_.target_cmdline_.Get(i));
739   }
740 
741   // repeated int32 exclude_pid = 3;
742   {
743     size_t data_size = ::_pbi::WireFormatLite::
744       Int32Size(this->_impl_.exclude_pid_);
745     total_size += 1 *
746                   ::_pbi::FromIntSize(this->_internal_exclude_pid_size());
747     total_size += data_size;
748   }
749 
750   // repeated string exclude_cmdline = 4;
751   total_size += 1 *
752       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.exclude_cmdline_.size());
753   for (int i = 0, n = _impl_.exclude_cmdline_.size(); i < n; i++) {
754     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
755       _impl_.exclude_cmdline_.Get(i));
756   }
757 
758   cached_has_bits = _impl_._has_bits_[0];
759   if (cached_has_bits & 0x00000003u) {
760     // optional uint32 additional_cmdline_count = 5;
761     if (cached_has_bits & 0x00000001u) {
762       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_additional_cmdline_count());
763     }
764 
765     // optional uint32 process_shard_count = 6;
766     if (cached_has_bits & 0x00000002u) {
767       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_process_shard_count());
768     }
769 
770   }
771   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
772     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
773   }
774   int cached_size = ::_pbi::ToCachedSize(total_size);
775   SetCachedSize(cached_size);
776   return total_size;
777 }
778 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)779 void PerfEventConfig_Scope::CheckTypeAndMergeFrom(
780     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
781   MergeFrom(*::_pbi::DownCast<const PerfEventConfig_Scope*>(
782       &from));
783 }
784 
MergeFrom(const PerfEventConfig_Scope & from)785 void PerfEventConfig_Scope::MergeFrom(const PerfEventConfig_Scope& from) {
786   PerfEventConfig_Scope* const _this = this;
787   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.PerfEventConfig.Scope)
788   GOOGLE_DCHECK_NE(&from, _this);
789   ::uint32_t cached_has_bits = 0;
790   (void) cached_has_bits;
791 
792   _this->_impl_.target_pid_.MergeFrom(from._impl_.target_pid_);
793   _this->_impl_.target_cmdline_.MergeFrom(from._impl_.target_cmdline_);
794   _this->_impl_.exclude_pid_.MergeFrom(from._impl_.exclude_pid_);
795   _this->_impl_.exclude_cmdline_.MergeFrom(from._impl_.exclude_cmdline_);
796   cached_has_bits = from._impl_._has_bits_[0];
797   if (cached_has_bits & 0x00000003u) {
798     if (cached_has_bits & 0x00000001u) {
799       _this->_impl_.additional_cmdline_count_ = from._impl_.additional_cmdline_count_;
800     }
801     if (cached_has_bits & 0x00000002u) {
802       _this->_impl_.process_shard_count_ = from._impl_.process_shard_count_;
803     }
804     _this->_impl_._has_bits_[0] |= cached_has_bits;
805   }
806   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
807 }
808 
CopyFrom(const PerfEventConfig_Scope & from)809 void PerfEventConfig_Scope::CopyFrom(const PerfEventConfig_Scope& from) {
810 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.PerfEventConfig.Scope)
811   if (&from == this) return;
812   Clear();
813   MergeFrom(from);
814 }
815 
IsInitialized() const816 bool PerfEventConfig_Scope::IsInitialized() const {
817   return true;
818 }
819 
InternalSwap(PerfEventConfig_Scope * other)820 void PerfEventConfig_Scope::InternalSwap(PerfEventConfig_Scope* other) {
821   using std::swap;
822   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
823   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
824   _impl_.target_pid_.InternalSwap(&other->_impl_.target_pid_);
825   _impl_.target_cmdline_.InternalSwap(&other->_impl_.target_cmdline_);
826   _impl_.exclude_pid_.InternalSwap(&other->_impl_.exclude_pid_);
827   _impl_.exclude_cmdline_.InternalSwap(&other->_impl_.exclude_cmdline_);
828   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
829       PROTOBUF_FIELD_OFFSET(PerfEventConfig_Scope, _impl_.process_shard_count_)
830       + sizeof(PerfEventConfig_Scope::_impl_.process_shard_count_)  // NOLINT
831       - PROTOBUF_FIELD_OFFSET(PerfEventConfig_Scope, _impl_.additional_cmdline_count_)>(
832           reinterpret_cast<char*>(&_impl_.additional_cmdline_count_),
833           reinterpret_cast<char*>(&other->_impl_.additional_cmdline_count_));
834 }
835 
GetTypeName() const836 std::string PerfEventConfig_Scope::GetTypeName() const {
837   return "perfetto.protos.PerfEventConfig.Scope";
838 }
839 
840 
841 // ===================================================================
842 
843 class PerfEventConfig::_Internal {
844  public:
845   using HasBits = decltype(std::declval<PerfEventConfig>()._impl_._has_bits_);
846   static const ::perfetto::protos::PerfEvents_Timebase& timebase(const PerfEventConfig* msg);
set_has_timebase(HasBits * has_bits)847   static void set_has_timebase(HasBits* has_bits) {
848     (*has_bits)[0] |= 1u;
849   }
850   static const ::perfetto::protos::PerfEventConfig_CallstackSampling& callstack_sampling(const PerfEventConfig* msg);
set_has_callstack_sampling(HasBits * has_bits)851   static void set_has_callstack_sampling(HasBits* has_bits) {
852     (*has_bits)[0] |= 2u;
853   }
set_has_ring_buffer_read_period_ms(HasBits * has_bits)854   static void set_has_ring_buffer_read_period_ms(HasBits* has_bits) {
855     (*has_bits)[0] |= 64u;
856   }
set_has_ring_buffer_pages(HasBits * has_bits)857   static void set_has_ring_buffer_pages(HasBits* has_bits) {
858     (*has_bits)[0] |= 8u;
859   }
set_has_max_enqueued_footprint_kb(HasBits * has_bits)860   static void set_has_max_enqueued_footprint_kb(HasBits* has_bits) {
861     (*has_bits)[0] |= 2048u;
862   }
set_has_max_daemon_memory_kb(HasBits * has_bits)863   static void set_has_max_daemon_memory_kb(HasBits* has_bits) {
864     (*has_bits)[0] |= 1024u;
865   }
set_has_remote_descriptor_timeout_ms(HasBits * has_bits)866   static void set_has_remote_descriptor_timeout_ms(HasBits* has_bits) {
867     (*has_bits)[0] |= 128u;
868   }
set_has_unwind_state_clear_period_ms(HasBits * has_bits)869   static void set_has_unwind_state_clear_period_ms(HasBits* has_bits) {
870     (*has_bits)[0] |= 256u;
871   }
set_has_all_cpus(HasBits * has_bits)872   static void set_has_all_cpus(HasBits* has_bits) {
873     (*has_bits)[0] |= 16u;
874   }
set_has_sampling_frequency(HasBits * has_bits)875   static void set_has_sampling_frequency(HasBits* has_bits) {
876     (*has_bits)[0] |= 4u;
877   }
set_has_kernel_frames(HasBits * has_bits)878   static void set_has_kernel_frames(HasBits* has_bits) {
879     (*has_bits)[0] |= 32u;
880   }
set_has_additional_cmdline_count(HasBits * has_bits)881   static void set_has_additional_cmdline_count(HasBits* has_bits) {
882     (*has_bits)[0] |= 512u;
883   }
884 };
885 
886 const ::perfetto::protos::PerfEvents_Timebase&
timebase(const PerfEventConfig * msg)887 PerfEventConfig::_Internal::timebase(const PerfEventConfig* msg) {
888   return *msg->_impl_.timebase_;
889 }
890 const ::perfetto::protos::PerfEventConfig_CallstackSampling&
callstack_sampling(const PerfEventConfig * msg)891 PerfEventConfig::_Internal::callstack_sampling(const PerfEventConfig* msg) {
892   return *msg->_impl_.callstack_sampling_;
893 }
clear_timebase()894 void PerfEventConfig::clear_timebase() {
895   if (_impl_.timebase_ != nullptr) _impl_.timebase_->Clear();
896   _impl_._has_bits_[0] &= ~0x00000001u;
897 }
clear_followers()898 void PerfEventConfig::clear_followers() {
899   _impl_.followers_.Clear();
900 }
PerfEventConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)901 PerfEventConfig::PerfEventConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
902                          bool is_message_owned)
903   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
904   SharedCtor(arena, is_message_owned);
905   // @@protoc_insertion_point(arena_constructor:perfetto.protos.PerfEventConfig)
906 }
PerfEventConfig(const PerfEventConfig & from)907 PerfEventConfig::PerfEventConfig(const PerfEventConfig& from)
908   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
909   PerfEventConfig* const _this = this; (void)_this;
910   new (&_impl_) Impl_{
911       decltype(_impl_._has_bits_){from._impl_._has_bits_}
912     , /*decltype(_impl_._cached_size_)*/{}
913     , decltype(_impl_.target_pid_){from._impl_.target_pid_}
914     , decltype(_impl_.target_cmdline_){from._impl_.target_cmdline_}
915     , decltype(_impl_.exclude_pid_){from._impl_.exclude_pid_}
916     , decltype(_impl_.exclude_cmdline_){from._impl_.exclude_cmdline_}
917     , decltype(_impl_.target_installed_by_){from._impl_.target_installed_by_}
918     , decltype(_impl_.followers_){from._impl_.followers_}
919     , decltype(_impl_.timebase_){nullptr}
920     , decltype(_impl_.callstack_sampling_){nullptr}
921     , decltype(_impl_.sampling_frequency_){}
922     , decltype(_impl_.ring_buffer_pages_){}
923     , decltype(_impl_.all_cpus_){}
924     , decltype(_impl_.kernel_frames_){}
925     , decltype(_impl_.ring_buffer_read_period_ms_){}
926     , decltype(_impl_.remote_descriptor_timeout_ms_){}
927     , decltype(_impl_.unwind_state_clear_period_ms_){}
928     , decltype(_impl_.additional_cmdline_count_){}
929     , decltype(_impl_.max_daemon_memory_kb_){}
930     , decltype(_impl_.max_enqueued_footprint_kb_){}};
931 
932   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
933   if (from._internal_has_timebase()) {
934     _this->_impl_.timebase_ = new ::perfetto::protos::PerfEvents_Timebase(*from._impl_.timebase_);
935   }
936   if (from._internal_has_callstack_sampling()) {
937     _this->_impl_.callstack_sampling_ = new ::perfetto::protos::PerfEventConfig_CallstackSampling(*from._impl_.callstack_sampling_);
938   }
939   ::memcpy(&_impl_.sampling_frequency_, &from._impl_.sampling_frequency_,
940     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.max_enqueued_footprint_kb_) -
941     reinterpret_cast<char*>(&_impl_.sampling_frequency_)) + sizeof(_impl_.max_enqueued_footprint_kb_));
942   // @@protoc_insertion_point(copy_constructor:perfetto.protos.PerfEventConfig)
943 }
944 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)945 inline void PerfEventConfig::SharedCtor(
946     ::_pb::Arena* arena, bool is_message_owned) {
947   (void)arena;
948   (void)is_message_owned;
949   new (&_impl_) Impl_{
950       decltype(_impl_._has_bits_){}
951     , /*decltype(_impl_._cached_size_)*/{}
952     , decltype(_impl_.target_pid_){arena}
953     , decltype(_impl_.target_cmdline_){arena}
954     , decltype(_impl_.exclude_pid_){arena}
955     , decltype(_impl_.exclude_cmdline_){arena}
956     , decltype(_impl_.target_installed_by_){arena}
957     , decltype(_impl_.followers_){arena}
958     , decltype(_impl_.timebase_){nullptr}
959     , decltype(_impl_.callstack_sampling_){nullptr}
960     , decltype(_impl_.sampling_frequency_){0u}
961     , decltype(_impl_.ring_buffer_pages_){0u}
962     , decltype(_impl_.all_cpus_){false}
963     , decltype(_impl_.kernel_frames_){false}
964     , decltype(_impl_.ring_buffer_read_period_ms_){0u}
965     , decltype(_impl_.remote_descriptor_timeout_ms_){0u}
966     , decltype(_impl_.unwind_state_clear_period_ms_){0u}
967     , decltype(_impl_.additional_cmdline_count_){0u}
968     , decltype(_impl_.max_daemon_memory_kb_){0u}
969     , decltype(_impl_.max_enqueued_footprint_kb_){::uint64_t{0u}}
970   };
971 }
972 
~PerfEventConfig()973 PerfEventConfig::~PerfEventConfig() {
974   // @@protoc_insertion_point(destructor:perfetto.protos.PerfEventConfig)
975   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
976   (void)arena;
977     return;
978   }
979   SharedDtor();
980 }
981 
SharedDtor()982 inline void PerfEventConfig::SharedDtor() {
983   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
984   _impl_.target_pid_.~RepeatedField();
985   _impl_.target_cmdline_.~RepeatedPtrField();
986   _impl_.exclude_pid_.~RepeatedField();
987   _impl_.exclude_cmdline_.~RepeatedPtrField();
988   _impl_.target_installed_by_.~RepeatedPtrField();
989   _impl_.followers_.~RepeatedPtrField();
990   if (this != internal_default_instance()) delete _impl_.timebase_;
991   if (this != internal_default_instance()) delete _impl_.callstack_sampling_;
992 }
993 
SetCachedSize(int size) const994 void PerfEventConfig::SetCachedSize(int size) const {
995   _impl_._cached_size_.Set(size);
996 }
997 
Clear()998 void PerfEventConfig::Clear() {
999 // @@protoc_insertion_point(message_clear_start:perfetto.protos.PerfEventConfig)
1000   ::uint32_t cached_has_bits = 0;
1001   // Prevent compiler warnings about cached_has_bits being unused
1002   (void) cached_has_bits;
1003 
1004   _impl_.target_pid_.Clear();
1005   _impl_.target_cmdline_.Clear();
1006   _impl_.exclude_pid_.Clear();
1007   _impl_.exclude_cmdline_.Clear();
1008   _impl_.target_installed_by_.Clear();
1009   _impl_.followers_.Clear();
1010   cached_has_bits = _impl_._has_bits_[0];
1011   if (cached_has_bits & 0x00000003u) {
1012     if (cached_has_bits & 0x00000001u) {
1013       GOOGLE_DCHECK(_impl_.timebase_ != nullptr);
1014       _impl_.timebase_->Clear();
1015     }
1016     if (cached_has_bits & 0x00000002u) {
1017       GOOGLE_DCHECK(_impl_.callstack_sampling_ != nullptr);
1018       _impl_.callstack_sampling_->Clear();
1019     }
1020   }
1021   if (cached_has_bits & 0x000000fcu) {
1022     ::memset(&_impl_.sampling_frequency_, 0, static_cast<size_t>(
1023         reinterpret_cast<char*>(&_impl_.remote_descriptor_timeout_ms_) -
1024         reinterpret_cast<char*>(&_impl_.sampling_frequency_)) + sizeof(_impl_.remote_descriptor_timeout_ms_));
1025   }
1026   if (cached_has_bits & 0x00000f00u) {
1027     ::memset(&_impl_.unwind_state_clear_period_ms_, 0, static_cast<size_t>(
1028         reinterpret_cast<char*>(&_impl_.max_enqueued_footprint_kb_) -
1029         reinterpret_cast<char*>(&_impl_.unwind_state_clear_period_ms_)) + sizeof(_impl_.max_enqueued_footprint_kb_));
1030   }
1031   _impl_._has_bits_.Clear();
1032   _internal_metadata_.Clear<std::string>();
1033 }
1034 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1035 const char* PerfEventConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1036 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1037   _Internal::HasBits has_bits{};
1038   while (!ctx->Done(&ptr)) {
1039     ::uint32_t tag;
1040     ptr = ::_pbi::ReadTag(ptr, &tag);
1041     switch (tag >> 3) {
1042       // optional bool all_cpus = 1;
1043       case 1:
1044         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
1045           _Internal::set_has_all_cpus(&has_bits);
1046           _impl_.all_cpus_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1047           CHK_(ptr);
1048         } else {
1049           goto handle_unusual;
1050         }
1051         continue;
1052       // optional uint32 sampling_frequency = 2;
1053       case 2:
1054         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
1055           _Internal::set_has_sampling_frequency(&has_bits);
1056           _impl_.sampling_frequency_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1057           CHK_(ptr);
1058         } else {
1059           goto handle_unusual;
1060         }
1061         continue;
1062       // optional uint32 ring_buffer_pages = 3;
1063       case 3:
1064         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
1065           _Internal::set_has_ring_buffer_pages(&has_bits);
1066           _impl_.ring_buffer_pages_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1067           CHK_(ptr);
1068         } else {
1069           goto handle_unusual;
1070         }
1071         continue;
1072       // repeated int32 target_pid = 4;
1073       case 4:
1074         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
1075           ptr -= 1;
1076           do {
1077             ptr += 1;
1078             _internal_add_target_pid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
1079             CHK_(ptr);
1080             if (!ctx->DataAvailable(ptr)) break;
1081           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<32>(ptr));
1082         } else if (static_cast<::uint8_t>(tag) == 34) {
1083           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_target_pid(), ptr, ctx);
1084           CHK_(ptr);
1085         } else {
1086           goto handle_unusual;
1087         }
1088         continue;
1089       // repeated string target_cmdline = 5;
1090       case 5:
1091         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
1092           ptr -= 1;
1093           do {
1094             ptr += 1;
1095             auto str = _internal_add_target_cmdline();
1096             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
1097             CHK_(ptr);
1098             if (!ctx->DataAvailable(ptr)) break;
1099           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<42>(ptr));
1100         } else {
1101           goto handle_unusual;
1102         }
1103         continue;
1104       // repeated int32 exclude_pid = 6;
1105       case 6:
1106         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
1107           ptr -= 1;
1108           do {
1109             ptr += 1;
1110             _internal_add_exclude_pid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
1111             CHK_(ptr);
1112             if (!ctx->DataAvailable(ptr)) break;
1113           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<48>(ptr));
1114         } else if (static_cast<::uint8_t>(tag) == 50) {
1115           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt32Parser(_internal_mutable_exclude_pid(), ptr, ctx);
1116           CHK_(ptr);
1117         } else {
1118           goto handle_unusual;
1119         }
1120         continue;
1121       // repeated string exclude_cmdline = 7;
1122       case 7:
1123         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
1124           ptr -= 1;
1125           do {
1126             ptr += 1;
1127             auto str = _internal_add_exclude_cmdline();
1128             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
1129             CHK_(ptr);
1130             if (!ctx->DataAvailable(ptr)) break;
1131           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
1132         } else {
1133           goto handle_unusual;
1134         }
1135         continue;
1136       // optional uint32 ring_buffer_read_period_ms = 8;
1137       case 8:
1138         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
1139           _Internal::set_has_ring_buffer_read_period_ms(&has_bits);
1140           _impl_.ring_buffer_read_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1141           CHK_(ptr);
1142         } else {
1143           goto handle_unusual;
1144         }
1145         continue;
1146       // optional uint32 remote_descriptor_timeout_ms = 9;
1147       case 9:
1148         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
1149           _Internal::set_has_remote_descriptor_timeout_ms(&has_bits);
1150           _impl_.remote_descriptor_timeout_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1151           CHK_(ptr);
1152         } else {
1153           goto handle_unusual;
1154         }
1155         continue;
1156       // optional uint32 unwind_state_clear_period_ms = 10;
1157       case 10:
1158         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
1159           _Internal::set_has_unwind_state_clear_period_ms(&has_bits);
1160           _impl_.unwind_state_clear_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1161           CHK_(ptr);
1162         } else {
1163           goto handle_unusual;
1164         }
1165         continue;
1166       // optional uint32 additional_cmdline_count = 11;
1167       case 11:
1168         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
1169           _Internal::set_has_additional_cmdline_count(&has_bits);
1170           _impl_.additional_cmdline_count_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1171           CHK_(ptr);
1172         } else {
1173           goto handle_unusual;
1174         }
1175         continue;
1176       // optional bool kernel_frames = 12;
1177       case 12:
1178         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 96)) {
1179           _Internal::set_has_kernel_frames(&has_bits);
1180           _impl_.kernel_frames_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1181           CHK_(ptr);
1182         } else {
1183           goto handle_unusual;
1184         }
1185         continue;
1186       // optional uint32 max_daemon_memory_kb = 13;
1187       case 13:
1188         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 104)) {
1189           _Internal::set_has_max_daemon_memory_kb(&has_bits);
1190           _impl_.max_daemon_memory_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1191           CHK_(ptr);
1192         } else {
1193           goto handle_unusual;
1194         }
1195         continue;
1196       // optional .perfetto.protos.PerfEvents.Timebase timebase = 15;
1197       case 15:
1198         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 122)) {
1199           ptr = ctx->ParseMessage(_internal_mutable_timebase(), ptr);
1200           CHK_(ptr);
1201         } else {
1202           goto handle_unusual;
1203         }
1204         continue;
1205       // optional .perfetto.protos.PerfEventConfig.CallstackSampling callstack_sampling = 16;
1206       case 16:
1207         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 130)) {
1208           ptr = ctx->ParseMessage(_internal_mutable_callstack_sampling(), ptr);
1209           CHK_(ptr);
1210         } else {
1211           goto handle_unusual;
1212         }
1213         continue;
1214       // optional uint64 max_enqueued_footprint_kb = 17;
1215       case 17:
1216         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 136)) {
1217           _Internal::set_has_max_enqueued_footprint_kb(&has_bits);
1218           _impl_.max_enqueued_footprint_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1219           CHK_(ptr);
1220         } else {
1221           goto handle_unusual;
1222         }
1223         continue;
1224       // repeated string target_installed_by = 18;
1225       case 18:
1226         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 146)) {
1227           ptr -= 2;
1228           do {
1229             ptr += 2;
1230             auto str = _internal_add_target_installed_by();
1231             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
1232             CHK_(ptr);
1233             if (!ctx->DataAvailable(ptr)) break;
1234           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<146>(ptr));
1235         } else {
1236           goto handle_unusual;
1237         }
1238         continue;
1239       // repeated .perfetto.protos.FollowerEvent followers = 19;
1240       case 19:
1241         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 154)) {
1242           ptr -= 2;
1243           do {
1244             ptr += 2;
1245             ptr = ctx->ParseMessage(_internal_add_followers(), ptr);
1246             CHK_(ptr);
1247             if (!ctx->DataAvailable(ptr)) break;
1248           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<154>(ptr));
1249         } else {
1250           goto handle_unusual;
1251         }
1252         continue;
1253       default:
1254         goto handle_unusual;
1255     }  // switch
1256   handle_unusual:
1257     if ((tag == 0) || ((tag & 7) == 4)) {
1258       CHK_(ptr);
1259       ctx->SetLastTag(tag);
1260       goto message_done;
1261     }
1262     ptr = UnknownFieldParse(
1263         tag,
1264         _internal_metadata_.mutable_unknown_fields<std::string>(),
1265         ptr, ctx);
1266     CHK_(ptr != nullptr);
1267   }  // while
1268 message_done:
1269   _impl_._has_bits_.Or(has_bits);
1270   return ptr;
1271 failure:
1272   ptr = nullptr;
1273   goto message_done;
1274 #undef CHK_
1275 }
1276 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1277 ::uint8_t* PerfEventConfig::_InternalSerialize(
1278     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1279   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.PerfEventConfig)
1280   ::uint32_t cached_has_bits = 0;
1281   (void) cached_has_bits;
1282 
1283   cached_has_bits = _impl_._has_bits_[0];
1284   // optional bool all_cpus = 1;
1285   if (cached_has_bits & 0x00000010u) {
1286     target = stream->EnsureSpace(target);
1287     target = ::_pbi::WireFormatLite::WriteBoolToArray(1, this->_internal_all_cpus(), target);
1288   }
1289 
1290   // optional uint32 sampling_frequency = 2;
1291   if (cached_has_bits & 0x00000004u) {
1292     target = stream->EnsureSpace(target);
1293     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_sampling_frequency(), target);
1294   }
1295 
1296   // optional uint32 ring_buffer_pages = 3;
1297   if (cached_has_bits & 0x00000008u) {
1298     target = stream->EnsureSpace(target);
1299     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_ring_buffer_pages(), target);
1300   }
1301 
1302   // repeated int32 target_pid = 4;
1303   for (int i = 0, n = this->_internal_target_pid_size(); i < n; i++) {
1304     target = stream->EnsureSpace(target);
1305     target = ::_pbi::WireFormatLite::WriteInt32ToArray(4, this->_internal_target_pid(i), target);
1306   }
1307 
1308   // repeated string target_cmdline = 5;
1309   for (int i = 0, n = this->_internal_target_cmdline_size(); i < n; i++) {
1310     const auto& s = this->_internal_target_cmdline(i);
1311     target = stream->WriteString(5, s, target);
1312   }
1313 
1314   // repeated int32 exclude_pid = 6;
1315   for (int i = 0, n = this->_internal_exclude_pid_size(); i < n; i++) {
1316     target = stream->EnsureSpace(target);
1317     target = ::_pbi::WireFormatLite::WriteInt32ToArray(6, this->_internal_exclude_pid(i), target);
1318   }
1319 
1320   // repeated string exclude_cmdline = 7;
1321   for (int i = 0, n = this->_internal_exclude_cmdline_size(); i < n; i++) {
1322     const auto& s = this->_internal_exclude_cmdline(i);
1323     target = stream->WriteString(7, s, target);
1324   }
1325 
1326   // optional uint32 ring_buffer_read_period_ms = 8;
1327   if (cached_has_bits & 0x00000040u) {
1328     target = stream->EnsureSpace(target);
1329     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_ring_buffer_read_period_ms(), target);
1330   }
1331 
1332   // optional uint32 remote_descriptor_timeout_ms = 9;
1333   if (cached_has_bits & 0x00000080u) {
1334     target = stream->EnsureSpace(target);
1335     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(9, this->_internal_remote_descriptor_timeout_ms(), target);
1336   }
1337 
1338   // optional uint32 unwind_state_clear_period_ms = 10;
1339   if (cached_has_bits & 0x00000100u) {
1340     target = stream->EnsureSpace(target);
1341     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(10, this->_internal_unwind_state_clear_period_ms(), target);
1342   }
1343 
1344   // optional uint32 additional_cmdline_count = 11;
1345   if (cached_has_bits & 0x00000200u) {
1346     target = stream->EnsureSpace(target);
1347     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(11, this->_internal_additional_cmdline_count(), target);
1348   }
1349 
1350   // optional bool kernel_frames = 12;
1351   if (cached_has_bits & 0x00000020u) {
1352     target = stream->EnsureSpace(target);
1353     target = ::_pbi::WireFormatLite::WriteBoolToArray(12, this->_internal_kernel_frames(), target);
1354   }
1355 
1356   // optional uint32 max_daemon_memory_kb = 13;
1357   if (cached_has_bits & 0x00000400u) {
1358     target = stream->EnsureSpace(target);
1359     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(13, this->_internal_max_daemon_memory_kb(), target);
1360   }
1361 
1362   // optional .perfetto.protos.PerfEvents.Timebase timebase = 15;
1363   if (cached_has_bits & 0x00000001u) {
1364     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1365       InternalWriteMessage(15, _Internal::timebase(this),
1366         _Internal::timebase(this).GetCachedSize(), target, stream);
1367   }
1368 
1369   // optional .perfetto.protos.PerfEventConfig.CallstackSampling callstack_sampling = 16;
1370   if (cached_has_bits & 0x00000002u) {
1371     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1372       InternalWriteMessage(16, _Internal::callstack_sampling(this),
1373         _Internal::callstack_sampling(this).GetCachedSize(), target, stream);
1374   }
1375 
1376   // optional uint64 max_enqueued_footprint_kb = 17;
1377   if (cached_has_bits & 0x00000800u) {
1378     target = stream->EnsureSpace(target);
1379     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(17, this->_internal_max_enqueued_footprint_kb(), target);
1380   }
1381 
1382   // repeated string target_installed_by = 18;
1383   for (int i = 0, n = this->_internal_target_installed_by_size(); i < n; i++) {
1384     const auto& s = this->_internal_target_installed_by(i);
1385     target = stream->WriteString(18, s, target);
1386   }
1387 
1388   // repeated .perfetto.protos.FollowerEvent followers = 19;
1389   for (unsigned i = 0,
1390       n = static_cast<unsigned>(this->_internal_followers_size()); i < n; i++) {
1391     const auto& repfield = this->_internal_followers(i);
1392     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1393         InternalWriteMessage(19, repfield, repfield.GetCachedSize(), target, stream);
1394   }
1395 
1396   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1397     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1398         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1399   }
1400   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.PerfEventConfig)
1401   return target;
1402 }
1403 
ByteSizeLong() const1404 size_t PerfEventConfig::ByteSizeLong() const {
1405 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.PerfEventConfig)
1406   size_t total_size = 0;
1407 
1408   ::uint32_t cached_has_bits = 0;
1409   // Prevent compiler warnings about cached_has_bits being unused
1410   (void) cached_has_bits;
1411 
1412   // repeated int32 target_pid = 4;
1413   {
1414     size_t data_size = ::_pbi::WireFormatLite::
1415       Int32Size(this->_impl_.target_pid_);
1416     total_size += 1 *
1417                   ::_pbi::FromIntSize(this->_internal_target_pid_size());
1418     total_size += data_size;
1419   }
1420 
1421   // repeated string target_cmdline = 5;
1422   total_size += 1 *
1423       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.target_cmdline_.size());
1424   for (int i = 0, n = _impl_.target_cmdline_.size(); i < n; i++) {
1425     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1426       _impl_.target_cmdline_.Get(i));
1427   }
1428 
1429   // repeated int32 exclude_pid = 6;
1430   {
1431     size_t data_size = ::_pbi::WireFormatLite::
1432       Int32Size(this->_impl_.exclude_pid_);
1433     total_size += 1 *
1434                   ::_pbi::FromIntSize(this->_internal_exclude_pid_size());
1435     total_size += data_size;
1436   }
1437 
1438   // repeated string exclude_cmdline = 7;
1439   total_size += 1 *
1440       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.exclude_cmdline_.size());
1441   for (int i = 0, n = _impl_.exclude_cmdline_.size(); i < n; i++) {
1442     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1443       _impl_.exclude_cmdline_.Get(i));
1444   }
1445 
1446   // repeated string target_installed_by = 18;
1447   total_size += 2 *
1448       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.target_installed_by_.size());
1449   for (int i = 0, n = _impl_.target_installed_by_.size(); i < n; i++) {
1450     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1451       _impl_.target_installed_by_.Get(i));
1452   }
1453 
1454   // repeated .perfetto.protos.FollowerEvent followers = 19;
1455   total_size += 2UL * this->_internal_followers_size();
1456   for (const auto& msg : this->_impl_.followers_) {
1457     total_size +=
1458       ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1459   }
1460 
1461   cached_has_bits = _impl_._has_bits_[0];
1462   if (cached_has_bits & 0x000000ffu) {
1463     // optional .perfetto.protos.PerfEvents.Timebase timebase = 15;
1464     if (cached_has_bits & 0x00000001u) {
1465       total_size += 1 +
1466         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1467           *_impl_.timebase_);
1468     }
1469 
1470     // optional .perfetto.protos.PerfEventConfig.CallstackSampling callstack_sampling = 16;
1471     if (cached_has_bits & 0x00000002u) {
1472       total_size += 2 +
1473         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1474           *_impl_.callstack_sampling_);
1475     }
1476 
1477     // optional uint32 sampling_frequency = 2;
1478     if (cached_has_bits & 0x00000004u) {
1479       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_sampling_frequency());
1480     }
1481 
1482     // optional uint32 ring_buffer_pages = 3;
1483     if (cached_has_bits & 0x00000008u) {
1484       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_ring_buffer_pages());
1485     }
1486 
1487     // optional bool all_cpus = 1;
1488     if (cached_has_bits & 0x00000010u) {
1489       total_size += 1 + 1;
1490     }
1491 
1492     // optional bool kernel_frames = 12;
1493     if (cached_has_bits & 0x00000020u) {
1494       total_size += 1 + 1;
1495     }
1496 
1497     // optional uint32 ring_buffer_read_period_ms = 8;
1498     if (cached_has_bits & 0x00000040u) {
1499       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_ring_buffer_read_period_ms());
1500     }
1501 
1502     // optional uint32 remote_descriptor_timeout_ms = 9;
1503     if (cached_has_bits & 0x00000080u) {
1504       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_remote_descriptor_timeout_ms());
1505     }
1506 
1507   }
1508   if (cached_has_bits & 0x00000f00u) {
1509     // optional uint32 unwind_state_clear_period_ms = 10;
1510     if (cached_has_bits & 0x00000100u) {
1511       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_unwind_state_clear_period_ms());
1512     }
1513 
1514     // optional uint32 additional_cmdline_count = 11;
1515     if (cached_has_bits & 0x00000200u) {
1516       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_additional_cmdline_count());
1517     }
1518 
1519     // optional uint32 max_daemon_memory_kb = 13;
1520     if (cached_has_bits & 0x00000400u) {
1521       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_max_daemon_memory_kb());
1522     }
1523 
1524     // optional uint64 max_enqueued_footprint_kb = 17;
1525     if (cached_has_bits & 0x00000800u) {
1526       total_size += 2 +
1527         ::_pbi::WireFormatLite::UInt64Size(
1528           this->_internal_max_enqueued_footprint_kb());
1529     }
1530 
1531   }
1532   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1533     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1534   }
1535   int cached_size = ::_pbi::ToCachedSize(total_size);
1536   SetCachedSize(cached_size);
1537   return total_size;
1538 }
1539 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1540 void PerfEventConfig::CheckTypeAndMergeFrom(
1541     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1542   MergeFrom(*::_pbi::DownCast<const PerfEventConfig*>(
1543       &from));
1544 }
1545 
MergeFrom(const PerfEventConfig & from)1546 void PerfEventConfig::MergeFrom(const PerfEventConfig& from) {
1547   PerfEventConfig* const _this = this;
1548   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.PerfEventConfig)
1549   GOOGLE_DCHECK_NE(&from, _this);
1550   ::uint32_t cached_has_bits = 0;
1551   (void) cached_has_bits;
1552 
1553   _this->_impl_.target_pid_.MergeFrom(from._impl_.target_pid_);
1554   _this->_impl_.target_cmdline_.MergeFrom(from._impl_.target_cmdline_);
1555   _this->_impl_.exclude_pid_.MergeFrom(from._impl_.exclude_pid_);
1556   _this->_impl_.exclude_cmdline_.MergeFrom(from._impl_.exclude_cmdline_);
1557   _this->_impl_.target_installed_by_.MergeFrom(from._impl_.target_installed_by_);
1558   _this->_impl_.followers_.MergeFrom(from._impl_.followers_);
1559   cached_has_bits = from._impl_._has_bits_[0];
1560   if (cached_has_bits & 0x000000ffu) {
1561     if (cached_has_bits & 0x00000001u) {
1562       _this->_internal_mutable_timebase()->::perfetto::protos::PerfEvents_Timebase::MergeFrom(
1563           from._internal_timebase());
1564     }
1565     if (cached_has_bits & 0x00000002u) {
1566       _this->_internal_mutable_callstack_sampling()->::perfetto::protos::PerfEventConfig_CallstackSampling::MergeFrom(
1567           from._internal_callstack_sampling());
1568     }
1569     if (cached_has_bits & 0x00000004u) {
1570       _this->_impl_.sampling_frequency_ = from._impl_.sampling_frequency_;
1571     }
1572     if (cached_has_bits & 0x00000008u) {
1573       _this->_impl_.ring_buffer_pages_ = from._impl_.ring_buffer_pages_;
1574     }
1575     if (cached_has_bits & 0x00000010u) {
1576       _this->_impl_.all_cpus_ = from._impl_.all_cpus_;
1577     }
1578     if (cached_has_bits & 0x00000020u) {
1579       _this->_impl_.kernel_frames_ = from._impl_.kernel_frames_;
1580     }
1581     if (cached_has_bits & 0x00000040u) {
1582       _this->_impl_.ring_buffer_read_period_ms_ = from._impl_.ring_buffer_read_period_ms_;
1583     }
1584     if (cached_has_bits & 0x00000080u) {
1585       _this->_impl_.remote_descriptor_timeout_ms_ = from._impl_.remote_descriptor_timeout_ms_;
1586     }
1587     _this->_impl_._has_bits_[0] |= cached_has_bits;
1588   }
1589   if (cached_has_bits & 0x00000f00u) {
1590     if (cached_has_bits & 0x00000100u) {
1591       _this->_impl_.unwind_state_clear_period_ms_ = from._impl_.unwind_state_clear_period_ms_;
1592     }
1593     if (cached_has_bits & 0x00000200u) {
1594       _this->_impl_.additional_cmdline_count_ = from._impl_.additional_cmdline_count_;
1595     }
1596     if (cached_has_bits & 0x00000400u) {
1597       _this->_impl_.max_daemon_memory_kb_ = from._impl_.max_daemon_memory_kb_;
1598     }
1599     if (cached_has_bits & 0x00000800u) {
1600       _this->_impl_.max_enqueued_footprint_kb_ = from._impl_.max_enqueued_footprint_kb_;
1601     }
1602     _this->_impl_._has_bits_[0] |= cached_has_bits;
1603   }
1604   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1605 }
1606 
CopyFrom(const PerfEventConfig & from)1607 void PerfEventConfig::CopyFrom(const PerfEventConfig& from) {
1608 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.PerfEventConfig)
1609   if (&from == this) return;
1610   Clear();
1611   MergeFrom(from);
1612 }
1613 
IsInitialized() const1614 bool PerfEventConfig::IsInitialized() const {
1615   return true;
1616 }
1617 
InternalSwap(PerfEventConfig * other)1618 void PerfEventConfig::InternalSwap(PerfEventConfig* other) {
1619   using std::swap;
1620   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1621   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1622   _impl_.target_pid_.InternalSwap(&other->_impl_.target_pid_);
1623   _impl_.target_cmdline_.InternalSwap(&other->_impl_.target_cmdline_);
1624   _impl_.exclude_pid_.InternalSwap(&other->_impl_.exclude_pid_);
1625   _impl_.exclude_cmdline_.InternalSwap(&other->_impl_.exclude_cmdline_);
1626   _impl_.target_installed_by_.InternalSwap(&other->_impl_.target_installed_by_);
1627   _impl_.followers_.InternalSwap(&other->_impl_.followers_);
1628   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1629       PROTOBUF_FIELD_OFFSET(PerfEventConfig, _impl_.max_enqueued_footprint_kb_)
1630       + sizeof(PerfEventConfig::_impl_.max_enqueued_footprint_kb_)  // NOLINT
1631       - PROTOBUF_FIELD_OFFSET(PerfEventConfig, _impl_.timebase_)>(
1632           reinterpret_cast<char*>(&_impl_.timebase_),
1633           reinterpret_cast<char*>(&other->_impl_.timebase_));
1634 }
1635 
GetTypeName() const1636 std::string PerfEventConfig::GetTypeName() const {
1637   return "perfetto.protos.PerfEventConfig";
1638 }
1639 
1640 
1641 // @@protoc_insertion_point(namespace_scope)
1642 }  // namespace protos
1643 }  // namespace perfetto
1644 PROTOBUF_NAMESPACE_OPEN
1645 template<> PROTOBUF_NOINLINE ::perfetto::protos::PerfEventConfig_CallstackSampling*
CreateMaybeMessage(Arena * arena)1646 Arena::CreateMaybeMessage< ::perfetto::protos::PerfEventConfig_CallstackSampling >(Arena* arena) {
1647   return Arena::CreateMessageInternal< ::perfetto::protos::PerfEventConfig_CallstackSampling >(arena);
1648 }
1649 template<> PROTOBUF_NOINLINE ::perfetto::protos::PerfEventConfig_Scope*
CreateMaybeMessage(Arena * arena)1650 Arena::CreateMaybeMessage< ::perfetto::protos::PerfEventConfig_Scope >(Arena* arena) {
1651   return Arena::CreateMessageInternal< ::perfetto::protos::PerfEventConfig_Scope >(arena);
1652 }
1653 template<> PROTOBUF_NOINLINE ::perfetto::protos::PerfEventConfig*
CreateMaybeMessage(Arena * arena)1654 Arena::CreateMaybeMessage< ::perfetto::protos::PerfEventConfig >(Arena* arena) {
1655   return Arena::CreateMessageInternal< ::perfetto::protos::PerfEventConfig >(arena);
1656 }
1657 PROTOBUF_NAMESPACE_CLOSE
1658 
1659 // @@protoc_insertion_point(global_scope)
1660 #include <google/protobuf/port_undef.inc>
1661