1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/config/process_stats/process_stats_config.proto
3
4 #include "protos/perfetto/config/process_stats/process_stats_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 {
ProcessStatsConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ProcessStatsConfig::ProcessStatsConfig(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.quirks_)*/{}
28 , /*decltype(_impl_.proc_stats_poll_ms_)*/0u
29 , /*decltype(_impl_.proc_stats_cache_ttl_ms_)*/0u
30 , /*decltype(_impl_.scan_all_processes_on_start_)*/false
31 , /*decltype(_impl_.record_thread_names_)*/false
32 , /*decltype(_impl_.resolve_process_fds_)*/false
33 , /*decltype(_impl_.scan_smaps_rollup_)*/false
34 , /*decltype(_impl_.record_process_age_)*/false
35 , /*decltype(_impl_.record_process_runtime_)*/false} {}
36 struct ProcessStatsConfigDefaultTypeInternal {
ProcessStatsConfigDefaultTypeInternalperfetto::protos::ProcessStatsConfigDefaultTypeInternal37 PROTOBUF_CONSTEXPR ProcessStatsConfigDefaultTypeInternal()
38 : _instance(::_pbi::ConstantInitialized{}) {}
~ProcessStatsConfigDefaultTypeInternalperfetto::protos::ProcessStatsConfigDefaultTypeInternal39 ~ProcessStatsConfigDefaultTypeInternal() {}
40 union { // NOLINT(misc-non-private-member-variables-in-classes)
41 ProcessStatsConfig _instance;
42 };
43 };
44 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProcessStatsConfigDefaultTypeInternal _ProcessStatsConfig_default_instance_;
45 } // namespace protos
46 } // namespace perfetto
47 namespace perfetto {
48 namespace protos {
ProcessStatsConfig_Quirks_IsValid(int value)49 bool ProcessStatsConfig_Quirks_IsValid(int value) {
50 switch (value) {
51 case 0:
52 case 1:
53 case 2:
54 return true;
55 default:
56 return false;
57 }
58 }
59
60 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ProcessStatsConfig_Quirks_strings[3] = {};
61
62 static const char ProcessStatsConfig_Quirks_names[] =
63 "DISABLE_INITIAL_DUMP"
64 "DISABLE_ON_DEMAND"
65 "QUIRKS_UNSPECIFIED";
66
67 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ProcessStatsConfig_Quirks_entries[] = {
68 { {ProcessStatsConfig_Quirks_names + 0, 20}, 1 },
69 { {ProcessStatsConfig_Quirks_names + 20, 17}, 2 },
70 { {ProcessStatsConfig_Quirks_names + 37, 18}, 0 },
71 };
72
73 static const int ProcessStatsConfig_Quirks_entries_by_number[] = {
74 2, // 0 -> QUIRKS_UNSPECIFIED
75 0, // 1 -> DISABLE_INITIAL_DUMP
76 1, // 2 -> DISABLE_ON_DEMAND
77 };
78
ProcessStatsConfig_Quirks_Name(ProcessStatsConfig_Quirks value)79 const std::string& ProcessStatsConfig_Quirks_Name(
80 ProcessStatsConfig_Quirks value) {
81 static const bool dummy =
82 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
83 ProcessStatsConfig_Quirks_entries,
84 ProcessStatsConfig_Quirks_entries_by_number,
85 3, ProcessStatsConfig_Quirks_strings);
86 (void) dummy;
87 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
88 ProcessStatsConfig_Quirks_entries,
89 ProcessStatsConfig_Quirks_entries_by_number,
90 3, value);
91 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
92 ProcessStatsConfig_Quirks_strings[idx].get();
93 }
ProcessStatsConfig_Quirks_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,ProcessStatsConfig_Quirks * value)94 bool ProcessStatsConfig_Quirks_Parse(
95 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ProcessStatsConfig_Quirks* value) {
96 int int_value;
97 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
98 ProcessStatsConfig_Quirks_entries, 3, name, &int_value);
99 if (success) {
100 *value = static_cast<ProcessStatsConfig_Quirks>(int_value);
101 }
102 return success;
103 }
104 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
105 constexpr ProcessStatsConfig_Quirks ProcessStatsConfig::QUIRKS_UNSPECIFIED;
106 constexpr ProcessStatsConfig_Quirks ProcessStatsConfig::DISABLE_INITIAL_DUMP;
107 constexpr ProcessStatsConfig_Quirks ProcessStatsConfig::DISABLE_ON_DEMAND;
108 constexpr ProcessStatsConfig_Quirks ProcessStatsConfig::Quirks_MIN;
109 constexpr ProcessStatsConfig_Quirks ProcessStatsConfig::Quirks_MAX;
110 constexpr int ProcessStatsConfig::Quirks_ARRAYSIZE;
111 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
112
113 // ===================================================================
114
115 class ProcessStatsConfig::_Internal {
116 public:
117 using HasBits = decltype(std::declval<ProcessStatsConfig>()._impl_._has_bits_);
set_has_scan_all_processes_on_start(HasBits * has_bits)118 static void set_has_scan_all_processes_on_start(HasBits* has_bits) {
119 (*has_bits)[0] |= 4u;
120 }
set_has_record_thread_names(HasBits * has_bits)121 static void set_has_record_thread_names(HasBits* has_bits) {
122 (*has_bits)[0] |= 8u;
123 }
set_has_proc_stats_poll_ms(HasBits * has_bits)124 static void set_has_proc_stats_poll_ms(HasBits* has_bits) {
125 (*has_bits)[0] |= 1u;
126 }
set_has_proc_stats_cache_ttl_ms(HasBits * has_bits)127 static void set_has_proc_stats_cache_ttl_ms(HasBits* has_bits) {
128 (*has_bits)[0] |= 2u;
129 }
set_has_resolve_process_fds(HasBits * has_bits)130 static void set_has_resolve_process_fds(HasBits* has_bits) {
131 (*has_bits)[0] |= 16u;
132 }
set_has_scan_smaps_rollup(HasBits * has_bits)133 static void set_has_scan_smaps_rollup(HasBits* has_bits) {
134 (*has_bits)[0] |= 32u;
135 }
set_has_record_process_age(HasBits * has_bits)136 static void set_has_record_process_age(HasBits* has_bits) {
137 (*has_bits)[0] |= 64u;
138 }
set_has_record_process_runtime(HasBits * has_bits)139 static void set_has_record_process_runtime(HasBits* has_bits) {
140 (*has_bits)[0] |= 128u;
141 }
142 };
143
ProcessStatsConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)144 ProcessStatsConfig::ProcessStatsConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
145 bool is_message_owned)
146 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
147 SharedCtor(arena, is_message_owned);
148 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ProcessStatsConfig)
149 }
ProcessStatsConfig(const ProcessStatsConfig & from)150 ProcessStatsConfig::ProcessStatsConfig(const ProcessStatsConfig& from)
151 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
152 ProcessStatsConfig* const _this = this; (void)_this;
153 new (&_impl_) Impl_{
154 decltype(_impl_._has_bits_){from._impl_._has_bits_}
155 , /*decltype(_impl_._cached_size_)*/{}
156 , decltype(_impl_.quirks_){from._impl_.quirks_}
157 , decltype(_impl_.proc_stats_poll_ms_){}
158 , decltype(_impl_.proc_stats_cache_ttl_ms_){}
159 , decltype(_impl_.scan_all_processes_on_start_){}
160 , decltype(_impl_.record_thread_names_){}
161 , decltype(_impl_.resolve_process_fds_){}
162 , decltype(_impl_.scan_smaps_rollup_){}
163 , decltype(_impl_.record_process_age_){}
164 , decltype(_impl_.record_process_runtime_){}};
165
166 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
167 ::memcpy(&_impl_.proc_stats_poll_ms_, &from._impl_.proc_stats_poll_ms_,
168 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.record_process_runtime_) -
169 reinterpret_cast<char*>(&_impl_.proc_stats_poll_ms_)) + sizeof(_impl_.record_process_runtime_));
170 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ProcessStatsConfig)
171 }
172
SharedCtor(::_pb::Arena * arena,bool is_message_owned)173 inline void ProcessStatsConfig::SharedCtor(
174 ::_pb::Arena* arena, bool is_message_owned) {
175 (void)arena;
176 (void)is_message_owned;
177 new (&_impl_) Impl_{
178 decltype(_impl_._has_bits_){}
179 , /*decltype(_impl_._cached_size_)*/{}
180 , decltype(_impl_.quirks_){arena}
181 , decltype(_impl_.proc_stats_poll_ms_){0u}
182 , decltype(_impl_.proc_stats_cache_ttl_ms_){0u}
183 , decltype(_impl_.scan_all_processes_on_start_){false}
184 , decltype(_impl_.record_thread_names_){false}
185 , decltype(_impl_.resolve_process_fds_){false}
186 , decltype(_impl_.scan_smaps_rollup_){false}
187 , decltype(_impl_.record_process_age_){false}
188 , decltype(_impl_.record_process_runtime_){false}
189 };
190 }
191
~ProcessStatsConfig()192 ProcessStatsConfig::~ProcessStatsConfig() {
193 // @@protoc_insertion_point(destructor:perfetto.protos.ProcessStatsConfig)
194 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
195 (void)arena;
196 return;
197 }
198 SharedDtor();
199 }
200
SharedDtor()201 inline void ProcessStatsConfig::SharedDtor() {
202 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
203 _impl_.quirks_.~RepeatedField();
204 }
205
SetCachedSize(int size) const206 void ProcessStatsConfig::SetCachedSize(int size) const {
207 _impl_._cached_size_.Set(size);
208 }
209
Clear()210 void ProcessStatsConfig::Clear() {
211 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ProcessStatsConfig)
212 ::uint32_t cached_has_bits = 0;
213 // Prevent compiler warnings about cached_has_bits being unused
214 (void) cached_has_bits;
215
216 _impl_.quirks_.Clear();
217 cached_has_bits = _impl_._has_bits_[0];
218 if (cached_has_bits & 0x000000ffu) {
219 ::memset(&_impl_.proc_stats_poll_ms_, 0, static_cast<size_t>(
220 reinterpret_cast<char*>(&_impl_.record_process_runtime_) -
221 reinterpret_cast<char*>(&_impl_.proc_stats_poll_ms_)) + sizeof(_impl_.record_process_runtime_));
222 }
223 _impl_._has_bits_.Clear();
224 _internal_metadata_.Clear<std::string>();
225 }
226
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)227 const char* ProcessStatsConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
228 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
229 _Internal::HasBits has_bits{};
230 while (!ctx->Done(&ptr)) {
231 ::uint32_t tag;
232 ptr = ::_pbi::ReadTag(ptr, &tag);
233 switch (tag >> 3) {
234 // repeated .perfetto.protos.ProcessStatsConfig.Quirks quirks = 1;
235 case 1:
236 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
237 ptr -= 1;
238 do {
239 ptr += 1;
240 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
241 CHK_(ptr);
242 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::ProcessStatsConfig_Quirks_IsValid(val))) {
243 _internal_add_quirks(static_cast<::perfetto::protos::ProcessStatsConfig_Quirks>(val));
244 } else {
245 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
246 }
247 if (!ctx->DataAvailable(ptr)) break;
248 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<8>(ptr));
249 } else if (static_cast<::uint8_t>(tag) == 10) {
250 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_quirks(), ptr, ctx, ::perfetto::protos::ProcessStatsConfig_Quirks_IsValid, &_internal_metadata_, 1);
251 CHK_(ptr);
252 } else {
253 goto handle_unusual;
254 }
255 continue;
256 // optional bool scan_all_processes_on_start = 2;
257 case 2:
258 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
259 _Internal::set_has_scan_all_processes_on_start(&has_bits);
260 _impl_.scan_all_processes_on_start_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
261 CHK_(ptr);
262 } else {
263 goto handle_unusual;
264 }
265 continue;
266 // optional bool record_thread_names = 3;
267 case 3:
268 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
269 _Internal::set_has_record_thread_names(&has_bits);
270 _impl_.record_thread_names_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
271 CHK_(ptr);
272 } else {
273 goto handle_unusual;
274 }
275 continue;
276 // optional uint32 proc_stats_poll_ms = 4;
277 case 4:
278 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
279 _Internal::set_has_proc_stats_poll_ms(&has_bits);
280 _impl_.proc_stats_poll_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
281 CHK_(ptr);
282 } else {
283 goto handle_unusual;
284 }
285 continue;
286 // optional uint32 proc_stats_cache_ttl_ms = 6;
287 case 6:
288 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
289 _Internal::set_has_proc_stats_cache_ttl_ms(&has_bits);
290 _impl_.proc_stats_cache_ttl_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
291 CHK_(ptr);
292 } else {
293 goto handle_unusual;
294 }
295 continue;
296 // optional bool resolve_process_fds = 9;
297 case 9:
298 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
299 _Internal::set_has_resolve_process_fds(&has_bits);
300 _impl_.resolve_process_fds_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
301 CHK_(ptr);
302 } else {
303 goto handle_unusual;
304 }
305 continue;
306 // optional bool scan_smaps_rollup = 10;
307 case 10:
308 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
309 _Internal::set_has_scan_smaps_rollup(&has_bits);
310 _impl_.scan_smaps_rollup_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
311 CHK_(ptr);
312 } else {
313 goto handle_unusual;
314 }
315 continue;
316 // optional bool record_process_age = 11;
317 case 11:
318 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
319 _Internal::set_has_record_process_age(&has_bits);
320 _impl_.record_process_age_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
321 CHK_(ptr);
322 } else {
323 goto handle_unusual;
324 }
325 continue;
326 // optional bool record_process_runtime = 12;
327 case 12:
328 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 96)) {
329 _Internal::set_has_record_process_runtime(&has_bits);
330 _impl_.record_process_runtime_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
331 CHK_(ptr);
332 } else {
333 goto handle_unusual;
334 }
335 continue;
336 default:
337 goto handle_unusual;
338 } // switch
339 handle_unusual:
340 if ((tag == 0) || ((tag & 7) == 4)) {
341 CHK_(ptr);
342 ctx->SetLastTag(tag);
343 goto message_done;
344 }
345 ptr = UnknownFieldParse(
346 tag,
347 _internal_metadata_.mutable_unknown_fields<std::string>(),
348 ptr, ctx);
349 CHK_(ptr != nullptr);
350 } // while
351 message_done:
352 _impl_._has_bits_.Or(has_bits);
353 return ptr;
354 failure:
355 ptr = nullptr;
356 goto message_done;
357 #undef CHK_
358 }
359
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const360 ::uint8_t* ProcessStatsConfig::_InternalSerialize(
361 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
362 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ProcessStatsConfig)
363 ::uint32_t cached_has_bits = 0;
364 (void) cached_has_bits;
365
366 // repeated .perfetto.protos.ProcessStatsConfig.Quirks quirks = 1;
367 for (int i = 0, n = this->_internal_quirks_size(); i < n; i++) {
368 target = stream->EnsureSpace(target);
369 target = ::_pbi::WireFormatLite::WriteEnumToArray(
370 1, this->_internal_quirks(i), target);
371 }
372
373 cached_has_bits = _impl_._has_bits_[0];
374 // optional bool scan_all_processes_on_start = 2;
375 if (cached_has_bits & 0x00000004u) {
376 target = stream->EnsureSpace(target);
377 target = ::_pbi::WireFormatLite::WriteBoolToArray(2, this->_internal_scan_all_processes_on_start(), target);
378 }
379
380 // optional bool record_thread_names = 3;
381 if (cached_has_bits & 0x00000008u) {
382 target = stream->EnsureSpace(target);
383 target = ::_pbi::WireFormatLite::WriteBoolToArray(3, this->_internal_record_thread_names(), target);
384 }
385
386 // optional uint32 proc_stats_poll_ms = 4;
387 if (cached_has_bits & 0x00000001u) {
388 target = stream->EnsureSpace(target);
389 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(4, this->_internal_proc_stats_poll_ms(), target);
390 }
391
392 // optional uint32 proc_stats_cache_ttl_ms = 6;
393 if (cached_has_bits & 0x00000002u) {
394 target = stream->EnsureSpace(target);
395 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_proc_stats_cache_ttl_ms(), target);
396 }
397
398 // optional bool resolve_process_fds = 9;
399 if (cached_has_bits & 0x00000010u) {
400 target = stream->EnsureSpace(target);
401 target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_resolve_process_fds(), target);
402 }
403
404 // optional bool scan_smaps_rollup = 10;
405 if (cached_has_bits & 0x00000020u) {
406 target = stream->EnsureSpace(target);
407 target = ::_pbi::WireFormatLite::WriteBoolToArray(10, this->_internal_scan_smaps_rollup(), target);
408 }
409
410 // optional bool record_process_age = 11;
411 if (cached_has_bits & 0x00000040u) {
412 target = stream->EnsureSpace(target);
413 target = ::_pbi::WireFormatLite::WriteBoolToArray(11, this->_internal_record_process_age(), target);
414 }
415
416 // optional bool record_process_runtime = 12;
417 if (cached_has_bits & 0x00000080u) {
418 target = stream->EnsureSpace(target);
419 target = ::_pbi::WireFormatLite::WriteBoolToArray(12, this->_internal_record_process_runtime(), target);
420 }
421
422 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
423 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
424 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
425 }
426 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ProcessStatsConfig)
427 return target;
428 }
429
ByteSizeLong() const430 size_t ProcessStatsConfig::ByteSizeLong() const {
431 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ProcessStatsConfig)
432 size_t total_size = 0;
433
434 ::uint32_t cached_has_bits = 0;
435 // Prevent compiler warnings about cached_has_bits being unused
436 (void) cached_has_bits;
437
438 // repeated .perfetto.protos.ProcessStatsConfig.Quirks quirks = 1;
439 {
440 size_t data_size = 0;
441 unsigned int count = static_cast<unsigned int>(this->_internal_quirks_size());for (unsigned int i = 0; i < count; i++) {
442 data_size += ::_pbi::WireFormatLite::EnumSize(
443 this->_internal_quirks(static_cast<int>(i)));
444 }
445 total_size += (1UL * count) + data_size;
446 }
447
448 cached_has_bits = _impl_._has_bits_[0];
449 if (cached_has_bits & 0x000000ffu) {
450 // optional uint32 proc_stats_poll_ms = 4;
451 if (cached_has_bits & 0x00000001u) {
452 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_proc_stats_poll_ms());
453 }
454
455 // optional uint32 proc_stats_cache_ttl_ms = 6;
456 if (cached_has_bits & 0x00000002u) {
457 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_proc_stats_cache_ttl_ms());
458 }
459
460 // optional bool scan_all_processes_on_start = 2;
461 if (cached_has_bits & 0x00000004u) {
462 total_size += 1 + 1;
463 }
464
465 // optional bool record_thread_names = 3;
466 if (cached_has_bits & 0x00000008u) {
467 total_size += 1 + 1;
468 }
469
470 // optional bool resolve_process_fds = 9;
471 if (cached_has_bits & 0x00000010u) {
472 total_size += 1 + 1;
473 }
474
475 // optional bool scan_smaps_rollup = 10;
476 if (cached_has_bits & 0x00000020u) {
477 total_size += 1 + 1;
478 }
479
480 // optional bool record_process_age = 11;
481 if (cached_has_bits & 0x00000040u) {
482 total_size += 1 + 1;
483 }
484
485 // optional bool record_process_runtime = 12;
486 if (cached_has_bits & 0x00000080u) {
487 total_size += 1 + 1;
488 }
489
490 }
491 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
492 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
493 }
494 int cached_size = ::_pbi::ToCachedSize(total_size);
495 SetCachedSize(cached_size);
496 return total_size;
497 }
498
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)499 void ProcessStatsConfig::CheckTypeAndMergeFrom(
500 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
501 MergeFrom(*::_pbi::DownCast<const ProcessStatsConfig*>(
502 &from));
503 }
504
MergeFrom(const ProcessStatsConfig & from)505 void ProcessStatsConfig::MergeFrom(const ProcessStatsConfig& from) {
506 ProcessStatsConfig* const _this = this;
507 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ProcessStatsConfig)
508 GOOGLE_DCHECK_NE(&from, _this);
509 ::uint32_t cached_has_bits = 0;
510 (void) cached_has_bits;
511
512 _this->_impl_.quirks_.MergeFrom(from._impl_.quirks_);
513 cached_has_bits = from._impl_._has_bits_[0];
514 if (cached_has_bits & 0x000000ffu) {
515 if (cached_has_bits & 0x00000001u) {
516 _this->_impl_.proc_stats_poll_ms_ = from._impl_.proc_stats_poll_ms_;
517 }
518 if (cached_has_bits & 0x00000002u) {
519 _this->_impl_.proc_stats_cache_ttl_ms_ = from._impl_.proc_stats_cache_ttl_ms_;
520 }
521 if (cached_has_bits & 0x00000004u) {
522 _this->_impl_.scan_all_processes_on_start_ = from._impl_.scan_all_processes_on_start_;
523 }
524 if (cached_has_bits & 0x00000008u) {
525 _this->_impl_.record_thread_names_ = from._impl_.record_thread_names_;
526 }
527 if (cached_has_bits & 0x00000010u) {
528 _this->_impl_.resolve_process_fds_ = from._impl_.resolve_process_fds_;
529 }
530 if (cached_has_bits & 0x00000020u) {
531 _this->_impl_.scan_smaps_rollup_ = from._impl_.scan_smaps_rollup_;
532 }
533 if (cached_has_bits & 0x00000040u) {
534 _this->_impl_.record_process_age_ = from._impl_.record_process_age_;
535 }
536 if (cached_has_bits & 0x00000080u) {
537 _this->_impl_.record_process_runtime_ = from._impl_.record_process_runtime_;
538 }
539 _this->_impl_._has_bits_[0] |= cached_has_bits;
540 }
541 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
542 }
543
CopyFrom(const ProcessStatsConfig & from)544 void ProcessStatsConfig::CopyFrom(const ProcessStatsConfig& from) {
545 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ProcessStatsConfig)
546 if (&from == this) return;
547 Clear();
548 MergeFrom(from);
549 }
550
IsInitialized() const551 bool ProcessStatsConfig::IsInitialized() const {
552 return true;
553 }
554
InternalSwap(ProcessStatsConfig * other)555 void ProcessStatsConfig::InternalSwap(ProcessStatsConfig* other) {
556 using std::swap;
557 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
558 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
559 _impl_.quirks_.InternalSwap(&other->_impl_.quirks_);
560 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
561 PROTOBUF_FIELD_OFFSET(ProcessStatsConfig, _impl_.record_process_runtime_)
562 + sizeof(ProcessStatsConfig::_impl_.record_process_runtime_) // NOLINT
563 - PROTOBUF_FIELD_OFFSET(ProcessStatsConfig, _impl_.proc_stats_poll_ms_)>(
564 reinterpret_cast<char*>(&_impl_.proc_stats_poll_ms_),
565 reinterpret_cast<char*>(&other->_impl_.proc_stats_poll_ms_));
566 }
567
GetTypeName() const568 std::string ProcessStatsConfig::GetTypeName() const {
569 return "perfetto.protos.ProcessStatsConfig";
570 }
571
572
573 // @@protoc_insertion_point(namespace_scope)
574 } // namespace protos
575 } // namespace perfetto
576 PROTOBUF_NAMESPACE_OPEN
577 template<> PROTOBUF_NOINLINE ::perfetto::protos::ProcessStatsConfig*
CreateMaybeMessage(Arena * arena)578 Arena::CreateMaybeMessage< ::perfetto::protos::ProcessStatsConfig >(Arena* arena) {
579 return Arena::CreateMessageInternal< ::perfetto::protos::ProcessStatsConfig >(arena);
580 }
581 PROTOBUF_NAMESPACE_CLOSE
582
583 // @@protoc_insertion_point(global_scope)
584 #include <google/protobuf/port_undef.inc>
585