1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: protos/perfetto/config/profiling/heapprofd_config.proto
3 
4 #include "protos/perfetto/config/profiling/heapprofd_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 {
HeapprofdConfig_ContinuousDumpConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR HeapprofdConfig_ContinuousDumpConfig::HeapprofdConfig_ContinuousDumpConfig(
24     ::_pbi::ConstantInitialized): _impl_{
25     /*decltype(_impl_._has_bits_)*/{}
26   , /*decltype(_impl_._cached_size_)*/{}
27   , /*decltype(_impl_.dump_phase_ms_)*/0u
28   , /*decltype(_impl_.dump_interval_ms_)*/0u} {}
29 struct HeapprofdConfig_ContinuousDumpConfigDefaultTypeInternal {
HeapprofdConfig_ContinuousDumpConfigDefaultTypeInternalperfetto::protos::HeapprofdConfig_ContinuousDumpConfigDefaultTypeInternal30   PROTOBUF_CONSTEXPR HeapprofdConfig_ContinuousDumpConfigDefaultTypeInternal()
31       : _instance(::_pbi::ConstantInitialized{}) {}
~HeapprofdConfig_ContinuousDumpConfigDefaultTypeInternalperfetto::protos::HeapprofdConfig_ContinuousDumpConfigDefaultTypeInternal32   ~HeapprofdConfig_ContinuousDumpConfigDefaultTypeInternal() {}
33   union {  // NOLINT(misc-non-private-member-variables-in-classes)
34     HeapprofdConfig_ContinuousDumpConfig _instance;
35   };
36 };
37 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HeapprofdConfig_ContinuousDumpConfigDefaultTypeInternal _HeapprofdConfig_ContinuousDumpConfig_default_instance_;
HeapprofdConfig(::_pbi::ConstantInitialized)38 PROTOBUF_CONSTEXPR HeapprofdConfig::HeapprofdConfig(
39     ::_pbi::ConstantInitialized): _impl_{
40     /*decltype(_impl_._has_bits_)*/{}
41   , /*decltype(_impl_._cached_size_)*/{}
42   , /*decltype(_impl_.process_cmdline_)*/{}
43   , /*decltype(_impl_.pid_)*/{}
44   , /*decltype(_impl_.skip_symbol_prefix_)*/{}
45   , /*decltype(_impl_.heaps_)*/{}
46   , /*decltype(_impl_.heap_sampling_intervals_)*/{}
47   , /*decltype(_impl_.target_installed_by_)*/{}
48   , /*decltype(_impl_.exclude_heaps_)*/{}
49   , /*decltype(_impl_.continuous_dump_config_)*/nullptr
50   , /*decltype(_impl_.sampling_interval_bytes_)*/::uint64_t{0u}
51   , /*decltype(_impl_.shmem_size_bytes_)*/::uint64_t{0u}
52   , /*decltype(_impl_.no_startup_)*/false
53   , /*decltype(_impl_.no_running_)*/false
54   , /*decltype(_impl_.dump_at_max_)*/false
55   , /*decltype(_impl_.disable_fork_teardown_)*/false
56   , /*decltype(_impl_.block_client_timeout_us_)*/0u
57   , /*decltype(_impl_.stream_allocations_)*/false
58   , /*decltype(_impl_.all_heaps_)*/false
59   , /*decltype(_impl_.all_)*/false
60   , /*decltype(_impl_.block_client_)*/false
61   , /*decltype(_impl_.min_anonymous_memory_kb_)*/0u
62   , /*decltype(_impl_.max_heapprofd_cpu_secs_)*/::uint64_t{0u}
63   , /*decltype(_impl_.max_heapprofd_memory_kb_)*/0u
64   , /*decltype(_impl_.disable_vfork_detection_)*/false
65   , /*decltype(_impl_.adaptive_sampling_shmem_threshold_)*/::uint64_t{0u}
66   , /*decltype(_impl_.adaptive_sampling_max_sampling_interval_bytes_)*/::uint64_t{0u}} {}
67 struct HeapprofdConfigDefaultTypeInternal {
HeapprofdConfigDefaultTypeInternalperfetto::protos::HeapprofdConfigDefaultTypeInternal68   PROTOBUF_CONSTEXPR HeapprofdConfigDefaultTypeInternal()
69       : _instance(::_pbi::ConstantInitialized{}) {}
~HeapprofdConfigDefaultTypeInternalperfetto::protos::HeapprofdConfigDefaultTypeInternal70   ~HeapprofdConfigDefaultTypeInternal() {}
71   union {  // NOLINT(misc-non-private-member-variables-in-classes)
72     HeapprofdConfig _instance;
73   };
74 };
75 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 HeapprofdConfigDefaultTypeInternal _HeapprofdConfig_default_instance_;
76 }  // namespace protos
77 }  // namespace perfetto
78 namespace perfetto {
79 namespace protos {
80 
81 // ===================================================================
82 
83 class HeapprofdConfig_ContinuousDumpConfig::_Internal {
84  public:
85   using HasBits = decltype(std::declval<HeapprofdConfig_ContinuousDumpConfig>()._impl_._has_bits_);
set_has_dump_phase_ms(HasBits * has_bits)86   static void set_has_dump_phase_ms(HasBits* has_bits) {
87     (*has_bits)[0] |= 1u;
88   }
set_has_dump_interval_ms(HasBits * has_bits)89   static void set_has_dump_interval_ms(HasBits* has_bits) {
90     (*has_bits)[0] |= 2u;
91   }
92 };
93 
HeapprofdConfig_ContinuousDumpConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)94 HeapprofdConfig_ContinuousDumpConfig::HeapprofdConfig_ContinuousDumpConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
95                          bool is_message_owned)
96   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
97   SharedCtor(arena, is_message_owned);
98   // @@protoc_insertion_point(arena_constructor:perfetto.protos.HeapprofdConfig.ContinuousDumpConfig)
99 }
HeapprofdConfig_ContinuousDumpConfig(const HeapprofdConfig_ContinuousDumpConfig & from)100 HeapprofdConfig_ContinuousDumpConfig::HeapprofdConfig_ContinuousDumpConfig(const HeapprofdConfig_ContinuousDumpConfig& from)
101   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
102   HeapprofdConfig_ContinuousDumpConfig* const _this = this; (void)_this;
103   new (&_impl_) Impl_{
104       decltype(_impl_._has_bits_){from._impl_._has_bits_}
105     , /*decltype(_impl_._cached_size_)*/{}
106     , decltype(_impl_.dump_phase_ms_){}
107     , decltype(_impl_.dump_interval_ms_){}};
108 
109   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
110   ::memcpy(&_impl_.dump_phase_ms_, &from._impl_.dump_phase_ms_,
111     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.dump_interval_ms_) -
112     reinterpret_cast<char*>(&_impl_.dump_phase_ms_)) + sizeof(_impl_.dump_interval_ms_));
113   // @@protoc_insertion_point(copy_constructor:perfetto.protos.HeapprofdConfig.ContinuousDumpConfig)
114 }
115 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)116 inline void HeapprofdConfig_ContinuousDumpConfig::SharedCtor(
117     ::_pb::Arena* arena, bool is_message_owned) {
118   (void)arena;
119   (void)is_message_owned;
120   new (&_impl_) Impl_{
121       decltype(_impl_._has_bits_){}
122     , /*decltype(_impl_._cached_size_)*/{}
123     , decltype(_impl_.dump_phase_ms_){0u}
124     , decltype(_impl_.dump_interval_ms_){0u}
125   };
126 }
127 
~HeapprofdConfig_ContinuousDumpConfig()128 HeapprofdConfig_ContinuousDumpConfig::~HeapprofdConfig_ContinuousDumpConfig() {
129   // @@protoc_insertion_point(destructor:perfetto.protos.HeapprofdConfig.ContinuousDumpConfig)
130   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
131   (void)arena;
132     return;
133   }
134   SharedDtor();
135 }
136 
SharedDtor()137 inline void HeapprofdConfig_ContinuousDumpConfig::SharedDtor() {
138   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
139 }
140 
SetCachedSize(int size) const141 void HeapprofdConfig_ContinuousDumpConfig::SetCachedSize(int size) const {
142   _impl_._cached_size_.Set(size);
143 }
144 
Clear()145 void HeapprofdConfig_ContinuousDumpConfig::Clear() {
146 // @@protoc_insertion_point(message_clear_start:perfetto.protos.HeapprofdConfig.ContinuousDumpConfig)
147   ::uint32_t cached_has_bits = 0;
148   // Prevent compiler warnings about cached_has_bits being unused
149   (void) cached_has_bits;
150 
151   cached_has_bits = _impl_._has_bits_[0];
152   if (cached_has_bits & 0x00000003u) {
153     ::memset(&_impl_.dump_phase_ms_, 0, static_cast<size_t>(
154         reinterpret_cast<char*>(&_impl_.dump_interval_ms_) -
155         reinterpret_cast<char*>(&_impl_.dump_phase_ms_)) + sizeof(_impl_.dump_interval_ms_));
156   }
157   _impl_._has_bits_.Clear();
158   _internal_metadata_.Clear<std::string>();
159 }
160 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)161 const char* HeapprofdConfig_ContinuousDumpConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
162 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
163   _Internal::HasBits has_bits{};
164   while (!ctx->Done(&ptr)) {
165     ::uint32_t tag;
166     ptr = ::_pbi::ReadTag(ptr, &tag);
167     switch (tag >> 3) {
168       // optional uint32 dump_phase_ms = 5;
169       case 5:
170         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
171           _Internal::set_has_dump_phase_ms(&has_bits);
172           _impl_.dump_phase_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
173           CHK_(ptr);
174         } else {
175           goto handle_unusual;
176         }
177         continue;
178       // optional uint32 dump_interval_ms = 6;
179       case 6:
180         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
181           _Internal::set_has_dump_interval_ms(&has_bits);
182           _impl_.dump_interval_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
183           CHK_(ptr);
184         } else {
185           goto handle_unusual;
186         }
187         continue;
188       default:
189         goto handle_unusual;
190     }  // switch
191   handle_unusual:
192     if ((tag == 0) || ((tag & 7) == 4)) {
193       CHK_(ptr);
194       ctx->SetLastTag(tag);
195       goto message_done;
196     }
197     ptr = UnknownFieldParse(
198         tag,
199         _internal_metadata_.mutable_unknown_fields<std::string>(),
200         ptr, ctx);
201     CHK_(ptr != nullptr);
202   }  // while
203 message_done:
204   _impl_._has_bits_.Or(has_bits);
205   return ptr;
206 failure:
207   ptr = nullptr;
208   goto message_done;
209 #undef CHK_
210 }
211 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const212 ::uint8_t* HeapprofdConfig_ContinuousDumpConfig::_InternalSerialize(
213     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
214   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.HeapprofdConfig.ContinuousDumpConfig)
215   ::uint32_t cached_has_bits = 0;
216   (void) cached_has_bits;
217 
218   cached_has_bits = _impl_._has_bits_[0];
219   // optional uint32 dump_phase_ms = 5;
220   if (cached_has_bits & 0x00000001u) {
221     target = stream->EnsureSpace(target);
222     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_dump_phase_ms(), target);
223   }
224 
225   // optional uint32 dump_interval_ms = 6;
226   if (cached_has_bits & 0x00000002u) {
227     target = stream->EnsureSpace(target);
228     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_dump_interval_ms(), target);
229   }
230 
231   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
232     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
233         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
234   }
235   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.HeapprofdConfig.ContinuousDumpConfig)
236   return target;
237 }
238 
ByteSizeLong() const239 size_t HeapprofdConfig_ContinuousDumpConfig::ByteSizeLong() const {
240 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.HeapprofdConfig.ContinuousDumpConfig)
241   size_t total_size = 0;
242 
243   ::uint32_t cached_has_bits = 0;
244   // Prevent compiler warnings about cached_has_bits being unused
245   (void) cached_has_bits;
246 
247   cached_has_bits = _impl_._has_bits_[0];
248   if (cached_has_bits & 0x00000003u) {
249     // optional uint32 dump_phase_ms = 5;
250     if (cached_has_bits & 0x00000001u) {
251       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_dump_phase_ms());
252     }
253 
254     // optional uint32 dump_interval_ms = 6;
255     if (cached_has_bits & 0x00000002u) {
256       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_dump_interval_ms());
257     }
258 
259   }
260   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
261     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
262   }
263   int cached_size = ::_pbi::ToCachedSize(total_size);
264   SetCachedSize(cached_size);
265   return total_size;
266 }
267 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)268 void HeapprofdConfig_ContinuousDumpConfig::CheckTypeAndMergeFrom(
269     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
270   MergeFrom(*::_pbi::DownCast<const HeapprofdConfig_ContinuousDumpConfig*>(
271       &from));
272 }
273 
MergeFrom(const HeapprofdConfig_ContinuousDumpConfig & from)274 void HeapprofdConfig_ContinuousDumpConfig::MergeFrom(const HeapprofdConfig_ContinuousDumpConfig& from) {
275   HeapprofdConfig_ContinuousDumpConfig* const _this = this;
276   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.HeapprofdConfig.ContinuousDumpConfig)
277   GOOGLE_DCHECK_NE(&from, _this);
278   ::uint32_t cached_has_bits = 0;
279   (void) cached_has_bits;
280 
281   cached_has_bits = from._impl_._has_bits_[0];
282   if (cached_has_bits & 0x00000003u) {
283     if (cached_has_bits & 0x00000001u) {
284       _this->_impl_.dump_phase_ms_ = from._impl_.dump_phase_ms_;
285     }
286     if (cached_has_bits & 0x00000002u) {
287       _this->_impl_.dump_interval_ms_ = from._impl_.dump_interval_ms_;
288     }
289     _this->_impl_._has_bits_[0] |= cached_has_bits;
290   }
291   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
292 }
293 
CopyFrom(const HeapprofdConfig_ContinuousDumpConfig & from)294 void HeapprofdConfig_ContinuousDumpConfig::CopyFrom(const HeapprofdConfig_ContinuousDumpConfig& from) {
295 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.HeapprofdConfig.ContinuousDumpConfig)
296   if (&from == this) return;
297   Clear();
298   MergeFrom(from);
299 }
300 
IsInitialized() const301 bool HeapprofdConfig_ContinuousDumpConfig::IsInitialized() const {
302   return true;
303 }
304 
InternalSwap(HeapprofdConfig_ContinuousDumpConfig * other)305 void HeapprofdConfig_ContinuousDumpConfig::InternalSwap(HeapprofdConfig_ContinuousDumpConfig* other) {
306   using std::swap;
307   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
308   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
309   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
310       PROTOBUF_FIELD_OFFSET(HeapprofdConfig_ContinuousDumpConfig, _impl_.dump_interval_ms_)
311       + sizeof(HeapprofdConfig_ContinuousDumpConfig::_impl_.dump_interval_ms_)  // NOLINT
312       - PROTOBUF_FIELD_OFFSET(HeapprofdConfig_ContinuousDumpConfig, _impl_.dump_phase_ms_)>(
313           reinterpret_cast<char*>(&_impl_.dump_phase_ms_),
314           reinterpret_cast<char*>(&other->_impl_.dump_phase_ms_));
315 }
316 
GetTypeName() const317 std::string HeapprofdConfig_ContinuousDumpConfig::GetTypeName() const {
318   return "perfetto.protos.HeapprofdConfig.ContinuousDumpConfig";
319 }
320 
321 
322 // ===================================================================
323 
324 class HeapprofdConfig::_Internal {
325  public:
326   using HasBits = decltype(std::declval<HeapprofdConfig>()._impl_._has_bits_);
set_has_sampling_interval_bytes(HasBits * has_bits)327   static void set_has_sampling_interval_bytes(HasBits* has_bits) {
328     (*has_bits)[0] |= 2u;
329   }
set_has_adaptive_sampling_shmem_threshold(HasBits * has_bits)330   static void set_has_adaptive_sampling_shmem_threshold(HasBits* has_bits) {
331     (*has_bits)[0] |= 65536u;
332   }
set_has_adaptive_sampling_max_sampling_interval_bytes(HasBits * has_bits)333   static void set_has_adaptive_sampling_max_sampling_interval_bytes(HasBits* has_bits) {
334     (*has_bits)[0] |= 131072u;
335   }
set_has_stream_allocations(HasBits * has_bits)336   static void set_has_stream_allocations(HasBits* has_bits) {
337     (*has_bits)[0] |= 256u;
338   }
set_has_all_heaps(HasBits * has_bits)339   static void set_has_all_heaps(HasBits* has_bits) {
340     (*has_bits)[0] |= 512u;
341   }
set_has_all(HasBits * has_bits)342   static void set_has_all(HasBits* has_bits) {
343     (*has_bits)[0] |= 1024u;
344   }
set_has_min_anonymous_memory_kb(HasBits * has_bits)345   static void set_has_min_anonymous_memory_kb(HasBits* has_bits) {
346     (*has_bits)[0] |= 4096u;
347   }
set_has_max_heapprofd_memory_kb(HasBits * has_bits)348   static void set_has_max_heapprofd_memory_kb(HasBits* has_bits) {
349     (*has_bits)[0] |= 16384u;
350   }
set_has_max_heapprofd_cpu_secs(HasBits * has_bits)351   static void set_has_max_heapprofd_cpu_secs(HasBits* has_bits) {
352     (*has_bits)[0] |= 8192u;
353   }
354   static const ::perfetto::protos::HeapprofdConfig_ContinuousDumpConfig& continuous_dump_config(const HeapprofdConfig* msg);
set_has_continuous_dump_config(HasBits * has_bits)355   static void set_has_continuous_dump_config(HasBits* has_bits) {
356     (*has_bits)[0] |= 1u;
357   }
set_has_shmem_size_bytes(HasBits * has_bits)358   static void set_has_shmem_size_bytes(HasBits* has_bits) {
359     (*has_bits)[0] |= 4u;
360   }
set_has_block_client(HasBits * has_bits)361   static void set_has_block_client(HasBits* has_bits) {
362     (*has_bits)[0] |= 2048u;
363   }
set_has_block_client_timeout_us(HasBits * has_bits)364   static void set_has_block_client_timeout_us(HasBits* has_bits) {
365     (*has_bits)[0] |= 128u;
366   }
set_has_no_startup(HasBits * has_bits)367   static void set_has_no_startup(HasBits* has_bits) {
368     (*has_bits)[0] |= 8u;
369   }
set_has_no_running(HasBits * has_bits)370   static void set_has_no_running(HasBits* has_bits) {
371     (*has_bits)[0] |= 16u;
372   }
set_has_dump_at_max(HasBits * has_bits)373   static void set_has_dump_at_max(HasBits* has_bits) {
374     (*has_bits)[0] |= 32u;
375   }
set_has_disable_fork_teardown(HasBits * has_bits)376   static void set_has_disable_fork_teardown(HasBits* has_bits) {
377     (*has_bits)[0] |= 64u;
378   }
set_has_disable_vfork_detection(HasBits * has_bits)379   static void set_has_disable_vfork_detection(HasBits* has_bits) {
380     (*has_bits)[0] |= 32768u;
381   }
382 };
383 
384 const ::perfetto::protos::HeapprofdConfig_ContinuousDumpConfig&
continuous_dump_config(const HeapprofdConfig * msg)385 HeapprofdConfig::_Internal::continuous_dump_config(const HeapprofdConfig* msg) {
386   return *msg->_impl_.continuous_dump_config_;
387 }
HeapprofdConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)388 HeapprofdConfig::HeapprofdConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
389                          bool is_message_owned)
390   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
391   SharedCtor(arena, is_message_owned);
392   // @@protoc_insertion_point(arena_constructor:perfetto.protos.HeapprofdConfig)
393 }
HeapprofdConfig(const HeapprofdConfig & from)394 HeapprofdConfig::HeapprofdConfig(const HeapprofdConfig& from)
395   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
396   HeapprofdConfig* const _this = this; (void)_this;
397   new (&_impl_) Impl_{
398       decltype(_impl_._has_bits_){from._impl_._has_bits_}
399     , /*decltype(_impl_._cached_size_)*/{}
400     , decltype(_impl_.process_cmdline_){from._impl_.process_cmdline_}
401     , decltype(_impl_.pid_){from._impl_.pid_}
402     , decltype(_impl_.skip_symbol_prefix_){from._impl_.skip_symbol_prefix_}
403     , decltype(_impl_.heaps_){from._impl_.heaps_}
404     , decltype(_impl_.heap_sampling_intervals_){from._impl_.heap_sampling_intervals_}
405     , decltype(_impl_.target_installed_by_){from._impl_.target_installed_by_}
406     , decltype(_impl_.exclude_heaps_){from._impl_.exclude_heaps_}
407     , decltype(_impl_.continuous_dump_config_){nullptr}
408     , decltype(_impl_.sampling_interval_bytes_){}
409     , decltype(_impl_.shmem_size_bytes_){}
410     , decltype(_impl_.no_startup_){}
411     , decltype(_impl_.no_running_){}
412     , decltype(_impl_.dump_at_max_){}
413     , decltype(_impl_.disable_fork_teardown_){}
414     , decltype(_impl_.block_client_timeout_us_){}
415     , decltype(_impl_.stream_allocations_){}
416     , decltype(_impl_.all_heaps_){}
417     , decltype(_impl_.all_){}
418     , decltype(_impl_.block_client_){}
419     , decltype(_impl_.min_anonymous_memory_kb_){}
420     , decltype(_impl_.max_heapprofd_cpu_secs_){}
421     , decltype(_impl_.max_heapprofd_memory_kb_){}
422     , decltype(_impl_.disable_vfork_detection_){}
423     , decltype(_impl_.adaptive_sampling_shmem_threshold_){}
424     , decltype(_impl_.adaptive_sampling_max_sampling_interval_bytes_){}};
425 
426   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
427   if (from._internal_has_continuous_dump_config()) {
428     _this->_impl_.continuous_dump_config_ = new ::perfetto::protos::HeapprofdConfig_ContinuousDumpConfig(*from._impl_.continuous_dump_config_);
429   }
430   ::memcpy(&_impl_.sampling_interval_bytes_, &from._impl_.sampling_interval_bytes_,
431     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.adaptive_sampling_max_sampling_interval_bytes_) -
432     reinterpret_cast<char*>(&_impl_.sampling_interval_bytes_)) + sizeof(_impl_.adaptive_sampling_max_sampling_interval_bytes_));
433   // @@protoc_insertion_point(copy_constructor:perfetto.protos.HeapprofdConfig)
434 }
435 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)436 inline void HeapprofdConfig::SharedCtor(
437     ::_pb::Arena* arena, bool is_message_owned) {
438   (void)arena;
439   (void)is_message_owned;
440   new (&_impl_) Impl_{
441       decltype(_impl_._has_bits_){}
442     , /*decltype(_impl_._cached_size_)*/{}
443     , decltype(_impl_.process_cmdline_){arena}
444     , decltype(_impl_.pid_){arena}
445     , decltype(_impl_.skip_symbol_prefix_){arena}
446     , decltype(_impl_.heaps_){arena}
447     , decltype(_impl_.heap_sampling_intervals_){arena}
448     , decltype(_impl_.target_installed_by_){arena}
449     , decltype(_impl_.exclude_heaps_){arena}
450     , decltype(_impl_.continuous_dump_config_){nullptr}
451     , decltype(_impl_.sampling_interval_bytes_){::uint64_t{0u}}
452     , decltype(_impl_.shmem_size_bytes_){::uint64_t{0u}}
453     , decltype(_impl_.no_startup_){false}
454     , decltype(_impl_.no_running_){false}
455     , decltype(_impl_.dump_at_max_){false}
456     , decltype(_impl_.disable_fork_teardown_){false}
457     , decltype(_impl_.block_client_timeout_us_){0u}
458     , decltype(_impl_.stream_allocations_){false}
459     , decltype(_impl_.all_heaps_){false}
460     , decltype(_impl_.all_){false}
461     , decltype(_impl_.block_client_){false}
462     , decltype(_impl_.min_anonymous_memory_kb_){0u}
463     , decltype(_impl_.max_heapprofd_cpu_secs_){::uint64_t{0u}}
464     , decltype(_impl_.max_heapprofd_memory_kb_){0u}
465     , decltype(_impl_.disable_vfork_detection_){false}
466     , decltype(_impl_.adaptive_sampling_shmem_threshold_){::uint64_t{0u}}
467     , decltype(_impl_.adaptive_sampling_max_sampling_interval_bytes_){::uint64_t{0u}}
468   };
469 }
470 
~HeapprofdConfig()471 HeapprofdConfig::~HeapprofdConfig() {
472   // @@protoc_insertion_point(destructor:perfetto.protos.HeapprofdConfig)
473   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
474   (void)arena;
475     return;
476   }
477   SharedDtor();
478 }
479 
SharedDtor()480 inline void HeapprofdConfig::SharedDtor() {
481   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
482   _impl_.process_cmdline_.~RepeatedPtrField();
483   _impl_.pid_.~RepeatedField();
484   _impl_.skip_symbol_prefix_.~RepeatedPtrField();
485   _impl_.heaps_.~RepeatedPtrField();
486   _impl_.heap_sampling_intervals_.~RepeatedField();
487   _impl_.target_installed_by_.~RepeatedPtrField();
488   _impl_.exclude_heaps_.~RepeatedPtrField();
489   if (this != internal_default_instance()) delete _impl_.continuous_dump_config_;
490 }
491 
SetCachedSize(int size) const492 void HeapprofdConfig::SetCachedSize(int size) const {
493   _impl_._cached_size_.Set(size);
494 }
495 
Clear()496 void HeapprofdConfig::Clear() {
497 // @@protoc_insertion_point(message_clear_start:perfetto.protos.HeapprofdConfig)
498   ::uint32_t cached_has_bits = 0;
499   // Prevent compiler warnings about cached_has_bits being unused
500   (void) cached_has_bits;
501 
502   _impl_.process_cmdline_.Clear();
503   _impl_.pid_.Clear();
504   _impl_.skip_symbol_prefix_.Clear();
505   _impl_.heaps_.Clear();
506   _impl_.heap_sampling_intervals_.Clear();
507   _impl_.target_installed_by_.Clear();
508   _impl_.exclude_heaps_.Clear();
509   cached_has_bits = _impl_._has_bits_[0];
510   if (cached_has_bits & 0x00000001u) {
511     GOOGLE_DCHECK(_impl_.continuous_dump_config_ != nullptr);
512     _impl_.continuous_dump_config_->Clear();
513   }
514   if (cached_has_bits & 0x000000feu) {
515     ::memset(&_impl_.sampling_interval_bytes_, 0, static_cast<size_t>(
516         reinterpret_cast<char*>(&_impl_.block_client_timeout_us_) -
517         reinterpret_cast<char*>(&_impl_.sampling_interval_bytes_)) + sizeof(_impl_.block_client_timeout_us_));
518   }
519   if (cached_has_bits & 0x0000ff00u) {
520     ::memset(&_impl_.stream_allocations_, 0, static_cast<size_t>(
521         reinterpret_cast<char*>(&_impl_.disable_vfork_detection_) -
522         reinterpret_cast<char*>(&_impl_.stream_allocations_)) + sizeof(_impl_.disable_vfork_detection_));
523   }
524   if (cached_has_bits & 0x00030000u) {
525     ::memset(&_impl_.adaptive_sampling_shmem_threshold_, 0, static_cast<size_t>(
526         reinterpret_cast<char*>(&_impl_.adaptive_sampling_max_sampling_interval_bytes_) -
527         reinterpret_cast<char*>(&_impl_.adaptive_sampling_shmem_threshold_)) + sizeof(_impl_.adaptive_sampling_max_sampling_interval_bytes_));
528   }
529   _impl_._has_bits_.Clear();
530   _internal_metadata_.Clear<std::string>();
531 }
532 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)533 const char* HeapprofdConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
534 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
535   _Internal::HasBits has_bits{};
536   while (!ctx->Done(&ptr)) {
537     ::uint32_t tag;
538     ptr = ::_pbi::ReadTag(ptr, &tag);
539     switch (tag >> 3) {
540       // optional uint64 sampling_interval_bytes = 1;
541       case 1:
542         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
543           _Internal::set_has_sampling_interval_bytes(&has_bits);
544           _impl_.sampling_interval_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
545           CHK_(ptr);
546         } else {
547           goto handle_unusual;
548         }
549         continue;
550       // repeated string process_cmdline = 2;
551       case 2:
552         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
553           ptr -= 1;
554           do {
555             ptr += 1;
556             auto str = _internal_add_process_cmdline();
557             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
558             CHK_(ptr);
559             if (!ctx->DataAvailable(ptr)) break;
560           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
561         } else {
562           goto handle_unusual;
563         }
564         continue;
565       // repeated uint64 pid = 4;
566       case 4:
567         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
568           ptr -= 1;
569           do {
570             ptr += 1;
571             _internal_add_pid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
572             CHK_(ptr);
573             if (!ctx->DataAvailable(ptr)) break;
574           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<32>(ptr));
575         } else if (static_cast<::uint8_t>(tag) == 34) {
576           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_pid(), ptr, ctx);
577           CHK_(ptr);
578         } else {
579           goto handle_unusual;
580         }
581         continue;
582       // optional bool all = 5;
583       case 5:
584         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
585           _Internal::set_has_all(&has_bits);
586           _impl_.all_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
587           CHK_(ptr);
588         } else {
589           goto handle_unusual;
590         }
591         continue;
592       // optional .perfetto.protos.HeapprofdConfig.ContinuousDumpConfig continuous_dump_config = 6;
593       case 6:
594         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
595           ptr = ctx->ParseMessage(_internal_mutable_continuous_dump_config(), ptr);
596           CHK_(ptr);
597         } else {
598           goto handle_unusual;
599         }
600         continue;
601       // repeated string skip_symbol_prefix = 7;
602       case 7:
603         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
604           ptr -= 1;
605           do {
606             ptr += 1;
607             auto str = _internal_add_skip_symbol_prefix();
608             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
609             CHK_(ptr);
610             if (!ctx->DataAvailable(ptr)) break;
611           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<58>(ptr));
612         } else {
613           goto handle_unusual;
614         }
615         continue;
616       // optional uint64 shmem_size_bytes = 8;
617       case 8:
618         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
619           _Internal::set_has_shmem_size_bytes(&has_bits);
620           _impl_.shmem_size_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
621           CHK_(ptr);
622         } else {
623           goto handle_unusual;
624         }
625         continue;
626       // optional bool block_client = 9;
627       case 9:
628         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
629           _Internal::set_has_block_client(&has_bits);
630           _impl_.block_client_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
631           CHK_(ptr);
632         } else {
633           goto handle_unusual;
634         }
635         continue;
636       // optional bool no_startup = 10;
637       case 10:
638         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
639           _Internal::set_has_no_startup(&has_bits);
640           _impl_.no_startup_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
641           CHK_(ptr);
642         } else {
643           goto handle_unusual;
644         }
645         continue;
646       // optional bool no_running = 11;
647       case 11:
648         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
649           _Internal::set_has_no_running(&has_bits);
650           _impl_.no_running_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
651           CHK_(ptr);
652         } else {
653           goto handle_unusual;
654         }
655         continue;
656       // optional bool dump_at_max = 13;
657       case 13:
658         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 104)) {
659           _Internal::set_has_dump_at_max(&has_bits);
660           _impl_.dump_at_max_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
661           CHK_(ptr);
662         } else {
663           goto handle_unusual;
664         }
665         continue;
666       // optional uint32 block_client_timeout_us = 14;
667       case 14:
668         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 112)) {
669           _Internal::set_has_block_client_timeout_us(&has_bits);
670           _impl_.block_client_timeout_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
671           CHK_(ptr);
672         } else {
673           goto handle_unusual;
674         }
675         continue;
676       // optional uint32 min_anonymous_memory_kb = 15;
677       case 15:
678         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 120)) {
679           _Internal::set_has_min_anonymous_memory_kb(&has_bits);
680           _impl_.min_anonymous_memory_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
681           CHK_(ptr);
682         } else {
683           goto handle_unusual;
684         }
685         continue;
686       // optional uint32 max_heapprofd_memory_kb = 16;
687       case 16:
688         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 128)) {
689           _Internal::set_has_max_heapprofd_memory_kb(&has_bits);
690           _impl_.max_heapprofd_memory_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
691           CHK_(ptr);
692         } else {
693           goto handle_unusual;
694         }
695         continue;
696       // optional uint64 max_heapprofd_cpu_secs = 17;
697       case 17:
698         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 136)) {
699           _Internal::set_has_max_heapprofd_cpu_secs(&has_bits);
700           _impl_.max_heapprofd_cpu_secs_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
701           CHK_(ptr);
702         } else {
703           goto handle_unusual;
704         }
705         continue;
706       // optional bool disable_fork_teardown = 18;
707       case 18:
708         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 144)) {
709           _Internal::set_has_disable_fork_teardown(&has_bits);
710           _impl_.disable_fork_teardown_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
711           CHK_(ptr);
712         } else {
713           goto handle_unusual;
714         }
715         continue;
716       // optional bool disable_vfork_detection = 19;
717       case 19:
718         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 152)) {
719           _Internal::set_has_disable_vfork_detection(&has_bits);
720           _impl_.disable_vfork_detection_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
721           CHK_(ptr);
722         } else {
723           goto handle_unusual;
724         }
725         continue;
726       // repeated string heaps = 20;
727       case 20:
728         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 162)) {
729           ptr -= 2;
730           do {
731             ptr += 2;
732             auto str = _internal_add_heaps();
733             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
734             CHK_(ptr);
735             if (!ctx->DataAvailable(ptr)) break;
736           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<162>(ptr));
737         } else {
738           goto handle_unusual;
739         }
740         continue;
741       // optional bool all_heaps = 21;
742       case 21:
743         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 168)) {
744           _Internal::set_has_all_heaps(&has_bits);
745           _impl_.all_heaps_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
746           CHK_(ptr);
747         } else {
748           goto handle_unusual;
749         }
750         continue;
751       // repeated uint64 heap_sampling_intervals = 22;
752       case 22:
753         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 176)) {
754           ptr -= 2;
755           do {
756             ptr += 2;
757             _internal_add_heap_sampling_intervals(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
758             CHK_(ptr);
759             if (!ctx->DataAvailable(ptr)) break;
760           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<176>(ptr));
761         } else if (static_cast<::uint8_t>(tag) == 178) {
762           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_heap_sampling_intervals(), ptr, ctx);
763           CHK_(ptr);
764         } else {
765           goto handle_unusual;
766         }
767         continue;
768       // optional bool stream_allocations = 23;
769       case 23:
770         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 184)) {
771           _Internal::set_has_stream_allocations(&has_bits);
772           _impl_.stream_allocations_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
773           CHK_(ptr);
774         } else {
775           goto handle_unusual;
776         }
777         continue;
778       // optional uint64 adaptive_sampling_shmem_threshold = 24;
779       case 24:
780         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 192)) {
781           _Internal::set_has_adaptive_sampling_shmem_threshold(&has_bits);
782           _impl_.adaptive_sampling_shmem_threshold_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
783           CHK_(ptr);
784         } else {
785           goto handle_unusual;
786         }
787         continue;
788       // optional uint64 adaptive_sampling_max_sampling_interval_bytes = 25;
789       case 25:
790         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 200)) {
791           _Internal::set_has_adaptive_sampling_max_sampling_interval_bytes(&has_bits);
792           _impl_.adaptive_sampling_max_sampling_interval_bytes_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
793           CHK_(ptr);
794         } else {
795           goto handle_unusual;
796         }
797         continue;
798       // repeated string target_installed_by = 26;
799       case 26:
800         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 210)) {
801           ptr -= 2;
802           do {
803             ptr += 2;
804             auto str = _internal_add_target_installed_by();
805             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
806             CHK_(ptr);
807             if (!ctx->DataAvailable(ptr)) break;
808           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<210>(ptr));
809         } else {
810           goto handle_unusual;
811         }
812         continue;
813       // repeated string exclude_heaps = 27;
814       case 27:
815         if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 218)) {
816           ptr -= 2;
817           do {
818             ptr += 2;
819             auto str = _internal_add_exclude_heaps();
820             ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
821             CHK_(ptr);
822             if (!ctx->DataAvailable(ptr)) break;
823           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<218>(ptr));
824         } else {
825           goto handle_unusual;
826         }
827         continue;
828       default:
829         goto handle_unusual;
830     }  // switch
831   handle_unusual:
832     if ((tag == 0) || ((tag & 7) == 4)) {
833       CHK_(ptr);
834       ctx->SetLastTag(tag);
835       goto message_done;
836     }
837     ptr = UnknownFieldParse(
838         tag,
839         _internal_metadata_.mutable_unknown_fields<std::string>(),
840         ptr, ctx);
841     CHK_(ptr != nullptr);
842   }  // while
843 message_done:
844   _impl_._has_bits_.Or(has_bits);
845   return ptr;
846 failure:
847   ptr = nullptr;
848   goto message_done;
849 #undef CHK_
850 }
851 
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const852 ::uint8_t* HeapprofdConfig::_InternalSerialize(
853     ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
854   // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.HeapprofdConfig)
855   ::uint32_t cached_has_bits = 0;
856   (void) cached_has_bits;
857 
858   cached_has_bits = _impl_._has_bits_[0];
859   // optional uint64 sampling_interval_bytes = 1;
860   if (cached_has_bits & 0x00000002u) {
861     target = stream->EnsureSpace(target);
862     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_sampling_interval_bytes(), target);
863   }
864 
865   // repeated string process_cmdline = 2;
866   for (int i = 0, n = this->_internal_process_cmdline_size(); i < n; i++) {
867     const auto& s = this->_internal_process_cmdline(i);
868     target = stream->WriteString(2, s, target);
869   }
870 
871   // repeated uint64 pid = 4;
872   for (int i = 0, n = this->_internal_pid_size(); i < n; i++) {
873     target = stream->EnsureSpace(target);
874     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_pid(i), target);
875   }
876 
877   // optional bool all = 5;
878   if (cached_has_bits & 0x00000400u) {
879     target = stream->EnsureSpace(target);
880     target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_all(), target);
881   }
882 
883   // optional .perfetto.protos.HeapprofdConfig.ContinuousDumpConfig continuous_dump_config = 6;
884   if (cached_has_bits & 0x00000001u) {
885     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
886       InternalWriteMessage(6, _Internal::continuous_dump_config(this),
887         _Internal::continuous_dump_config(this).GetCachedSize(), target, stream);
888   }
889 
890   // repeated string skip_symbol_prefix = 7;
891   for (int i = 0, n = this->_internal_skip_symbol_prefix_size(); i < n; i++) {
892     const auto& s = this->_internal_skip_symbol_prefix(i);
893     target = stream->WriteString(7, s, target);
894   }
895 
896   // optional uint64 shmem_size_bytes = 8;
897   if (cached_has_bits & 0x00000004u) {
898     target = stream->EnsureSpace(target);
899     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(8, this->_internal_shmem_size_bytes(), target);
900   }
901 
902   // optional bool block_client = 9;
903   if (cached_has_bits & 0x00000800u) {
904     target = stream->EnsureSpace(target);
905     target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_block_client(), target);
906   }
907 
908   // optional bool no_startup = 10;
909   if (cached_has_bits & 0x00000008u) {
910     target = stream->EnsureSpace(target);
911     target = ::_pbi::WireFormatLite::WriteBoolToArray(10, this->_internal_no_startup(), target);
912   }
913 
914   // optional bool no_running = 11;
915   if (cached_has_bits & 0x00000010u) {
916     target = stream->EnsureSpace(target);
917     target = ::_pbi::WireFormatLite::WriteBoolToArray(11, this->_internal_no_running(), target);
918   }
919 
920   // optional bool dump_at_max = 13;
921   if (cached_has_bits & 0x00000020u) {
922     target = stream->EnsureSpace(target);
923     target = ::_pbi::WireFormatLite::WriteBoolToArray(13, this->_internal_dump_at_max(), target);
924   }
925 
926   // optional uint32 block_client_timeout_us = 14;
927   if (cached_has_bits & 0x00000080u) {
928     target = stream->EnsureSpace(target);
929     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(14, this->_internal_block_client_timeout_us(), target);
930   }
931 
932   // optional uint32 min_anonymous_memory_kb = 15;
933   if (cached_has_bits & 0x00001000u) {
934     target = stream->EnsureSpace(target);
935     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(15, this->_internal_min_anonymous_memory_kb(), target);
936   }
937 
938   // optional uint32 max_heapprofd_memory_kb = 16;
939   if (cached_has_bits & 0x00004000u) {
940     target = stream->EnsureSpace(target);
941     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(16, this->_internal_max_heapprofd_memory_kb(), target);
942   }
943 
944   // optional uint64 max_heapprofd_cpu_secs = 17;
945   if (cached_has_bits & 0x00002000u) {
946     target = stream->EnsureSpace(target);
947     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(17, this->_internal_max_heapprofd_cpu_secs(), target);
948   }
949 
950   // optional bool disable_fork_teardown = 18;
951   if (cached_has_bits & 0x00000040u) {
952     target = stream->EnsureSpace(target);
953     target = ::_pbi::WireFormatLite::WriteBoolToArray(18, this->_internal_disable_fork_teardown(), target);
954   }
955 
956   // optional bool disable_vfork_detection = 19;
957   if (cached_has_bits & 0x00008000u) {
958     target = stream->EnsureSpace(target);
959     target = ::_pbi::WireFormatLite::WriteBoolToArray(19, this->_internal_disable_vfork_detection(), target);
960   }
961 
962   // repeated string heaps = 20;
963   for (int i = 0, n = this->_internal_heaps_size(); i < n; i++) {
964     const auto& s = this->_internal_heaps(i);
965     target = stream->WriteString(20, s, target);
966   }
967 
968   // optional bool all_heaps = 21;
969   if (cached_has_bits & 0x00000200u) {
970     target = stream->EnsureSpace(target);
971     target = ::_pbi::WireFormatLite::WriteBoolToArray(21, this->_internal_all_heaps(), target);
972   }
973 
974   // repeated uint64 heap_sampling_intervals = 22;
975   for (int i = 0, n = this->_internal_heap_sampling_intervals_size(); i < n; i++) {
976     target = stream->EnsureSpace(target);
977     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(22, this->_internal_heap_sampling_intervals(i), target);
978   }
979 
980   // optional bool stream_allocations = 23;
981   if (cached_has_bits & 0x00000100u) {
982     target = stream->EnsureSpace(target);
983     target = ::_pbi::WireFormatLite::WriteBoolToArray(23, this->_internal_stream_allocations(), target);
984   }
985 
986   // optional uint64 adaptive_sampling_shmem_threshold = 24;
987   if (cached_has_bits & 0x00010000u) {
988     target = stream->EnsureSpace(target);
989     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(24, this->_internal_adaptive_sampling_shmem_threshold(), target);
990   }
991 
992   // optional uint64 adaptive_sampling_max_sampling_interval_bytes = 25;
993   if (cached_has_bits & 0x00020000u) {
994     target = stream->EnsureSpace(target);
995     target = ::_pbi::WireFormatLite::WriteUInt64ToArray(25, this->_internal_adaptive_sampling_max_sampling_interval_bytes(), target);
996   }
997 
998   // repeated string target_installed_by = 26;
999   for (int i = 0, n = this->_internal_target_installed_by_size(); i < n; i++) {
1000     const auto& s = this->_internal_target_installed_by(i);
1001     target = stream->WriteString(26, s, target);
1002   }
1003 
1004   // repeated string exclude_heaps = 27;
1005   for (int i = 0, n = this->_internal_exclude_heaps_size(); i < n; i++) {
1006     const auto& s = this->_internal_exclude_heaps(i);
1007     target = stream->WriteString(27, s, target);
1008   }
1009 
1010   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1011     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1012         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1013   }
1014   // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.HeapprofdConfig)
1015   return target;
1016 }
1017 
ByteSizeLong() const1018 size_t HeapprofdConfig::ByteSizeLong() const {
1019 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.HeapprofdConfig)
1020   size_t total_size = 0;
1021 
1022   ::uint32_t cached_has_bits = 0;
1023   // Prevent compiler warnings about cached_has_bits being unused
1024   (void) cached_has_bits;
1025 
1026   // repeated string process_cmdline = 2;
1027   total_size += 1 *
1028       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.process_cmdline_.size());
1029   for (int i = 0, n = _impl_.process_cmdline_.size(); i < n; i++) {
1030     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1031       _impl_.process_cmdline_.Get(i));
1032   }
1033 
1034   // repeated uint64 pid = 4;
1035   {
1036     size_t data_size = ::_pbi::WireFormatLite::
1037       UInt64Size(this->_impl_.pid_);
1038     total_size += 1 *
1039                   ::_pbi::FromIntSize(this->_internal_pid_size());
1040     total_size += data_size;
1041   }
1042 
1043   // repeated string skip_symbol_prefix = 7;
1044   total_size += 1 *
1045       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.skip_symbol_prefix_.size());
1046   for (int i = 0, n = _impl_.skip_symbol_prefix_.size(); i < n; i++) {
1047     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1048       _impl_.skip_symbol_prefix_.Get(i));
1049   }
1050 
1051   // repeated string heaps = 20;
1052   total_size += 2 *
1053       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.heaps_.size());
1054   for (int i = 0, n = _impl_.heaps_.size(); i < n; i++) {
1055     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1056       _impl_.heaps_.Get(i));
1057   }
1058 
1059   // repeated uint64 heap_sampling_intervals = 22;
1060   {
1061     size_t data_size = ::_pbi::WireFormatLite::
1062       UInt64Size(this->_impl_.heap_sampling_intervals_);
1063     total_size += 2 *
1064                   ::_pbi::FromIntSize(this->_internal_heap_sampling_intervals_size());
1065     total_size += data_size;
1066   }
1067 
1068   // repeated string target_installed_by = 26;
1069   total_size += 2 *
1070       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.target_installed_by_.size());
1071   for (int i = 0, n = _impl_.target_installed_by_.size(); i < n; i++) {
1072     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1073       _impl_.target_installed_by_.Get(i));
1074   }
1075 
1076   // repeated string exclude_heaps = 27;
1077   total_size += 2 *
1078       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.exclude_heaps_.size());
1079   for (int i = 0, n = _impl_.exclude_heaps_.size(); i < n; i++) {
1080     total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1081       _impl_.exclude_heaps_.Get(i));
1082   }
1083 
1084   cached_has_bits = _impl_._has_bits_[0];
1085   if (cached_has_bits & 0x000000ffu) {
1086     // optional .perfetto.protos.HeapprofdConfig.ContinuousDumpConfig continuous_dump_config = 6;
1087     if (cached_has_bits & 0x00000001u) {
1088       total_size += 1 +
1089         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1090           *_impl_.continuous_dump_config_);
1091     }
1092 
1093     // optional uint64 sampling_interval_bytes = 1;
1094     if (cached_has_bits & 0x00000002u) {
1095       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_sampling_interval_bytes());
1096     }
1097 
1098     // optional uint64 shmem_size_bytes = 8;
1099     if (cached_has_bits & 0x00000004u) {
1100       total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_shmem_size_bytes());
1101     }
1102 
1103     // optional bool no_startup = 10;
1104     if (cached_has_bits & 0x00000008u) {
1105       total_size += 1 + 1;
1106     }
1107 
1108     // optional bool no_running = 11;
1109     if (cached_has_bits & 0x00000010u) {
1110       total_size += 1 + 1;
1111     }
1112 
1113     // optional bool dump_at_max = 13;
1114     if (cached_has_bits & 0x00000020u) {
1115       total_size += 1 + 1;
1116     }
1117 
1118     // optional bool disable_fork_teardown = 18;
1119     if (cached_has_bits & 0x00000040u) {
1120       total_size += 2 + 1;
1121     }
1122 
1123     // optional uint32 block_client_timeout_us = 14;
1124     if (cached_has_bits & 0x00000080u) {
1125       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_block_client_timeout_us());
1126     }
1127 
1128   }
1129   if (cached_has_bits & 0x0000ff00u) {
1130     // optional bool stream_allocations = 23;
1131     if (cached_has_bits & 0x00000100u) {
1132       total_size += 2 + 1;
1133     }
1134 
1135     // optional bool all_heaps = 21;
1136     if (cached_has_bits & 0x00000200u) {
1137       total_size += 2 + 1;
1138     }
1139 
1140     // optional bool all = 5;
1141     if (cached_has_bits & 0x00000400u) {
1142       total_size += 1 + 1;
1143     }
1144 
1145     // optional bool block_client = 9;
1146     if (cached_has_bits & 0x00000800u) {
1147       total_size += 1 + 1;
1148     }
1149 
1150     // optional uint32 min_anonymous_memory_kb = 15;
1151     if (cached_has_bits & 0x00001000u) {
1152       total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_min_anonymous_memory_kb());
1153     }
1154 
1155     // optional uint64 max_heapprofd_cpu_secs = 17;
1156     if (cached_has_bits & 0x00002000u) {
1157       total_size += 2 +
1158         ::_pbi::WireFormatLite::UInt64Size(
1159           this->_internal_max_heapprofd_cpu_secs());
1160     }
1161 
1162     // optional uint32 max_heapprofd_memory_kb = 16;
1163     if (cached_has_bits & 0x00004000u) {
1164       total_size += 2 +
1165         ::_pbi::WireFormatLite::UInt32Size(
1166           this->_internal_max_heapprofd_memory_kb());
1167     }
1168 
1169     // optional bool disable_vfork_detection = 19;
1170     if (cached_has_bits & 0x00008000u) {
1171       total_size += 2 + 1;
1172     }
1173 
1174   }
1175   if (cached_has_bits & 0x00030000u) {
1176     // optional uint64 adaptive_sampling_shmem_threshold = 24;
1177     if (cached_has_bits & 0x00010000u) {
1178       total_size += 2 +
1179         ::_pbi::WireFormatLite::UInt64Size(
1180           this->_internal_adaptive_sampling_shmem_threshold());
1181     }
1182 
1183     // optional uint64 adaptive_sampling_max_sampling_interval_bytes = 25;
1184     if (cached_has_bits & 0x00020000u) {
1185       total_size += 2 +
1186         ::_pbi::WireFormatLite::UInt64Size(
1187           this->_internal_adaptive_sampling_max_sampling_interval_bytes());
1188     }
1189 
1190   }
1191   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1192     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1193   }
1194   int cached_size = ::_pbi::ToCachedSize(total_size);
1195   SetCachedSize(cached_size);
1196   return total_size;
1197 }
1198 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1199 void HeapprofdConfig::CheckTypeAndMergeFrom(
1200     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1201   MergeFrom(*::_pbi::DownCast<const HeapprofdConfig*>(
1202       &from));
1203 }
1204 
MergeFrom(const HeapprofdConfig & from)1205 void HeapprofdConfig::MergeFrom(const HeapprofdConfig& from) {
1206   HeapprofdConfig* const _this = this;
1207   // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.HeapprofdConfig)
1208   GOOGLE_DCHECK_NE(&from, _this);
1209   ::uint32_t cached_has_bits = 0;
1210   (void) cached_has_bits;
1211 
1212   _this->_impl_.process_cmdline_.MergeFrom(from._impl_.process_cmdline_);
1213   _this->_impl_.pid_.MergeFrom(from._impl_.pid_);
1214   _this->_impl_.skip_symbol_prefix_.MergeFrom(from._impl_.skip_symbol_prefix_);
1215   _this->_impl_.heaps_.MergeFrom(from._impl_.heaps_);
1216   _this->_impl_.heap_sampling_intervals_.MergeFrom(from._impl_.heap_sampling_intervals_);
1217   _this->_impl_.target_installed_by_.MergeFrom(from._impl_.target_installed_by_);
1218   _this->_impl_.exclude_heaps_.MergeFrom(from._impl_.exclude_heaps_);
1219   cached_has_bits = from._impl_._has_bits_[0];
1220   if (cached_has_bits & 0x000000ffu) {
1221     if (cached_has_bits & 0x00000001u) {
1222       _this->_internal_mutable_continuous_dump_config()->::perfetto::protos::HeapprofdConfig_ContinuousDumpConfig::MergeFrom(
1223           from._internal_continuous_dump_config());
1224     }
1225     if (cached_has_bits & 0x00000002u) {
1226       _this->_impl_.sampling_interval_bytes_ = from._impl_.sampling_interval_bytes_;
1227     }
1228     if (cached_has_bits & 0x00000004u) {
1229       _this->_impl_.shmem_size_bytes_ = from._impl_.shmem_size_bytes_;
1230     }
1231     if (cached_has_bits & 0x00000008u) {
1232       _this->_impl_.no_startup_ = from._impl_.no_startup_;
1233     }
1234     if (cached_has_bits & 0x00000010u) {
1235       _this->_impl_.no_running_ = from._impl_.no_running_;
1236     }
1237     if (cached_has_bits & 0x00000020u) {
1238       _this->_impl_.dump_at_max_ = from._impl_.dump_at_max_;
1239     }
1240     if (cached_has_bits & 0x00000040u) {
1241       _this->_impl_.disable_fork_teardown_ = from._impl_.disable_fork_teardown_;
1242     }
1243     if (cached_has_bits & 0x00000080u) {
1244       _this->_impl_.block_client_timeout_us_ = from._impl_.block_client_timeout_us_;
1245     }
1246     _this->_impl_._has_bits_[0] |= cached_has_bits;
1247   }
1248   if (cached_has_bits & 0x0000ff00u) {
1249     if (cached_has_bits & 0x00000100u) {
1250       _this->_impl_.stream_allocations_ = from._impl_.stream_allocations_;
1251     }
1252     if (cached_has_bits & 0x00000200u) {
1253       _this->_impl_.all_heaps_ = from._impl_.all_heaps_;
1254     }
1255     if (cached_has_bits & 0x00000400u) {
1256       _this->_impl_.all_ = from._impl_.all_;
1257     }
1258     if (cached_has_bits & 0x00000800u) {
1259       _this->_impl_.block_client_ = from._impl_.block_client_;
1260     }
1261     if (cached_has_bits & 0x00001000u) {
1262       _this->_impl_.min_anonymous_memory_kb_ = from._impl_.min_anonymous_memory_kb_;
1263     }
1264     if (cached_has_bits & 0x00002000u) {
1265       _this->_impl_.max_heapprofd_cpu_secs_ = from._impl_.max_heapprofd_cpu_secs_;
1266     }
1267     if (cached_has_bits & 0x00004000u) {
1268       _this->_impl_.max_heapprofd_memory_kb_ = from._impl_.max_heapprofd_memory_kb_;
1269     }
1270     if (cached_has_bits & 0x00008000u) {
1271       _this->_impl_.disable_vfork_detection_ = from._impl_.disable_vfork_detection_;
1272     }
1273     _this->_impl_._has_bits_[0] |= cached_has_bits;
1274   }
1275   if (cached_has_bits & 0x00030000u) {
1276     if (cached_has_bits & 0x00010000u) {
1277       _this->_impl_.adaptive_sampling_shmem_threshold_ = from._impl_.adaptive_sampling_shmem_threshold_;
1278     }
1279     if (cached_has_bits & 0x00020000u) {
1280       _this->_impl_.adaptive_sampling_max_sampling_interval_bytes_ = from._impl_.adaptive_sampling_max_sampling_interval_bytes_;
1281     }
1282     _this->_impl_._has_bits_[0] |= cached_has_bits;
1283   }
1284   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1285 }
1286 
CopyFrom(const HeapprofdConfig & from)1287 void HeapprofdConfig::CopyFrom(const HeapprofdConfig& from) {
1288 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.HeapprofdConfig)
1289   if (&from == this) return;
1290   Clear();
1291   MergeFrom(from);
1292 }
1293 
IsInitialized() const1294 bool HeapprofdConfig::IsInitialized() const {
1295   return true;
1296 }
1297 
InternalSwap(HeapprofdConfig * other)1298 void HeapprofdConfig::InternalSwap(HeapprofdConfig* other) {
1299   using std::swap;
1300   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1301   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1302   _impl_.process_cmdline_.InternalSwap(&other->_impl_.process_cmdline_);
1303   _impl_.pid_.InternalSwap(&other->_impl_.pid_);
1304   _impl_.skip_symbol_prefix_.InternalSwap(&other->_impl_.skip_symbol_prefix_);
1305   _impl_.heaps_.InternalSwap(&other->_impl_.heaps_);
1306   _impl_.heap_sampling_intervals_.InternalSwap(&other->_impl_.heap_sampling_intervals_);
1307   _impl_.target_installed_by_.InternalSwap(&other->_impl_.target_installed_by_);
1308   _impl_.exclude_heaps_.InternalSwap(&other->_impl_.exclude_heaps_);
1309   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1310       PROTOBUF_FIELD_OFFSET(HeapprofdConfig, _impl_.adaptive_sampling_max_sampling_interval_bytes_)
1311       + sizeof(HeapprofdConfig::_impl_.adaptive_sampling_max_sampling_interval_bytes_)  // NOLINT
1312       - PROTOBUF_FIELD_OFFSET(HeapprofdConfig, _impl_.continuous_dump_config_)>(
1313           reinterpret_cast<char*>(&_impl_.continuous_dump_config_),
1314           reinterpret_cast<char*>(&other->_impl_.continuous_dump_config_));
1315 }
1316 
GetTypeName() const1317 std::string HeapprofdConfig::GetTypeName() const {
1318   return "perfetto.protos.HeapprofdConfig";
1319 }
1320 
1321 
1322 // @@protoc_insertion_point(namespace_scope)
1323 }  // namespace protos
1324 }  // namespace perfetto
1325 PROTOBUF_NAMESPACE_OPEN
1326 template<> PROTOBUF_NOINLINE ::perfetto::protos::HeapprofdConfig_ContinuousDumpConfig*
CreateMaybeMessage(Arena * arena)1327 Arena::CreateMaybeMessage< ::perfetto::protos::HeapprofdConfig_ContinuousDumpConfig >(Arena* arena) {
1328   return Arena::CreateMessageInternal< ::perfetto::protos::HeapprofdConfig_ContinuousDumpConfig >(arena);
1329 }
1330 template<> PROTOBUF_NOINLINE ::perfetto::protos::HeapprofdConfig*
CreateMaybeMessage(Arena * arena)1331 Arena::CreateMaybeMessage< ::perfetto::protos::HeapprofdConfig >(Arena* arena) {
1332   return Arena::CreateMessageInternal< ::perfetto::protos::HeapprofdConfig >(arena);
1333 }
1334 PROTOBUF_NAMESPACE_CLOSE
1335 
1336 // @@protoc_insertion_point(global_scope)
1337 #include <google/protobuf/port_undef.inc>
1338