1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/ps/process_stats.proto
3
4 #include "protos/perfetto/trace/ps/process_stats.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 {
ProcessStats_Thread(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ProcessStats_Thread::ProcessStats_Thread(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.tid_)*/0} {}
28 struct ProcessStats_ThreadDefaultTypeInternal {
ProcessStats_ThreadDefaultTypeInternalperfetto::protos::ProcessStats_ThreadDefaultTypeInternal29 PROTOBUF_CONSTEXPR ProcessStats_ThreadDefaultTypeInternal()
30 : _instance(::_pbi::ConstantInitialized{}) {}
~ProcessStats_ThreadDefaultTypeInternalperfetto::protos::ProcessStats_ThreadDefaultTypeInternal31 ~ProcessStats_ThreadDefaultTypeInternal() {}
32 union { // NOLINT(misc-non-private-member-variables-in-classes)
33 ProcessStats_Thread _instance;
34 };
35 };
36 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProcessStats_ThreadDefaultTypeInternal _ProcessStats_Thread_default_instance_;
ProcessStats_FDInfo(::_pbi::ConstantInitialized)37 PROTOBUF_CONSTEXPR ProcessStats_FDInfo::ProcessStats_FDInfo(
38 ::_pbi::ConstantInitialized): _impl_{
39 /*decltype(_impl_._has_bits_)*/{}
40 , /*decltype(_impl_._cached_size_)*/{}
41 , /*decltype(_impl_.path_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
42 , /*decltype(_impl_.fd_)*/::uint64_t{0u}} {}
43 struct ProcessStats_FDInfoDefaultTypeInternal {
ProcessStats_FDInfoDefaultTypeInternalperfetto::protos::ProcessStats_FDInfoDefaultTypeInternal44 PROTOBUF_CONSTEXPR ProcessStats_FDInfoDefaultTypeInternal()
45 : _instance(::_pbi::ConstantInitialized{}) {}
~ProcessStats_FDInfoDefaultTypeInternalperfetto::protos::ProcessStats_FDInfoDefaultTypeInternal46 ~ProcessStats_FDInfoDefaultTypeInternal() {}
47 union { // NOLINT(misc-non-private-member-variables-in-classes)
48 ProcessStats_FDInfo _instance;
49 };
50 };
51 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProcessStats_FDInfoDefaultTypeInternal _ProcessStats_FDInfo_default_instance_;
ProcessStats_Process(::_pbi::ConstantInitialized)52 PROTOBUF_CONSTEXPR ProcessStats_Process::ProcessStats_Process(
53 ::_pbi::ConstantInitialized): _impl_{
54 /*decltype(_impl_._has_bits_)*/{}
55 , /*decltype(_impl_._cached_size_)*/{}
56 , /*decltype(_impl_.threads_)*/{}
57 , /*decltype(_impl_.fds_)*/{}
58 , /*decltype(_impl_.vm_size_kb_)*/::uint64_t{0u}
59 , /*decltype(_impl_.vm_rss_kb_)*/::uint64_t{0u}
60 , /*decltype(_impl_.rss_anon_kb_)*/::uint64_t{0u}
61 , /*decltype(_impl_.rss_file_kb_)*/::uint64_t{0u}
62 , /*decltype(_impl_.rss_shmem_kb_)*/::uint64_t{0u}
63 , /*decltype(_impl_.pid_)*/0
64 , /*decltype(_impl_.is_peak_rss_resettable_)*/false
65 , /*decltype(_impl_.vm_swap_kb_)*/::uint64_t{0u}
66 , /*decltype(_impl_.vm_locked_kb_)*/::uint64_t{0u}
67 , /*decltype(_impl_.vm_hwm_kb_)*/::uint64_t{0u}
68 , /*decltype(_impl_.oom_score_adj_)*/::int64_t{0}
69 , /*decltype(_impl_.chrome_private_footprint_kb_)*/0u
70 , /*decltype(_impl_.chrome_peak_resident_set_kb_)*/0u
71 , /*decltype(_impl_.smr_rss_kb_)*/::uint64_t{0u}
72 , /*decltype(_impl_.smr_pss_kb_)*/::uint64_t{0u}
73 , /*decltype(_impl_.smr_pss_anon_kb_)*/::uint64_t{0u}
74 , /*decltype(_impl_.smr_pss_file_kb_)*/::uint64_t{0u}
75 , /*decltype(_impl_.smr_pss_shmem_kb_)*/::uint64_t{0u}
76 , /*decltype(_impl_.runtime_user_mode_)*/::uint64_t{0u}
77 , /*decltype(_impl_.runtime_kernel_mode_)*/::uint64_t{0u}
78 , /*decltype(_impl_.smr_swap_pss_kb_)*/::uint64_t{0u}} {}
79 struct ProcessStats_ProcessDefaultTypeInternal {
ProcessStats_ProcessDefaultTypeInternalperfetto::protos::ProcessStats_ProcessDefaultTypeInternal80 PROTOBUF_CONSTEXPR ProcessStats_ProcessDefaultTypeInternal()
81 : _instance(::_pbi::ConstantInitialized{}) {}
~ProcessStats_ProcessDefaultTypeInternalperfetto::protos::ProcessStats_ProcessDefaultTypeInternal82 ~ProcessStats_ProcessDefaultTypeInternal() {}
83 union { // NOLINT(misc-non-private-member-variables-in-classes)
84 ProcessStats_Process _instance;
85 };
86 };
87 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProcessStats_ProcessDefaultTypeInternal _ProcessStats_Process_default_instance_;
ProcessStats(::_pbi::ConstantInitialized)88 PROTOBUF_CONSTEXPR ProcessStats::ProcessStats(
89 ::_pbi::ConstantInitialized): _impl_{
90 /*decltype(_impl_._has_bits_)*/{}
91 , /*decltype(_impl_._cached_size_)*/{}
92 , /*decltype(_impl_.processes_)*/{}
93 , /*decltype(_impl_.collection_end_timestamp_)*/::uint64_t{0u}} {}
94 struct ProcessStatsDefaultTypeInternal {
ProcessStatsDefaultTypeInternalperfetto::protos::ProcessStatsDefaultTypeInternal95 PROTOBUF_CONSTEXPR ProcessStatsDefaultTypeInternal()
96 : _instance(::_pbi::ConstantInitialized{}) {}
~ProcessStatsDefaultTypeInternalperfetto::protos::ProcessStatsDefaultTypeInternal97 ~ProcessStatsDefaultTypeInternal() {}
98 union { // NOLINT(misc-non-private-member-variables-in-classes)
99 ProcessStats _instance;
100 };
101 };
102 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProcessStatsDefaultTypeInternal _ProcessStats_default_instance_;
103 } // namespace protos
104 } // namespace perfetto
105 namespace perfetto {
106 namespace protos {
107
108 // ===================================================================
109
110 class ProcessStats_Thread::_Internal {
111 public:
112 using HasBits = decltype(std::declval<ProcessStats_Thread>()._impl_._has_bits_);
set_has_tid(HasBits * has_bits)113 static void set_has_tid(HasBits* has_bits) {
114 (*has_bits)[0] |= 1u;
115 }
116 };
117
ProcessStats_Thread(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)118 ProcessStats_Thread::ProcessStats_Thread(::PROTOBUF_NAMESPACE_ID::Arena* arena,
119 bool is_message_owned)
120 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
121 SharedCtor(arena, is_message_owned);
122 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ProcessStats.Thread)
123 }
ProcessStats_Thread(const ProcessStats_Thread & from)124 ProcessStats_Thread::ProcessStats_Thread(const ProcessStats_Thread& from)
125 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
126 ProcessStats_Thread* const _this = this; (void)_this;
127 new (&_impl_) Impl_{
128 decltype(_impl_._has_bits_){from._impl_._has_bits_}
129 , /*decltype(_impl_._cached_size_)*/{}
130 , decltype(_impl_.tid_){}};
131
132 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
133 _this->_impl_.tid_ = from._impl_.tid_;
134 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ProcessStats.Thread)
135 }
136
SharedCtor(::_pb::Arena * arena,bool is_message_owned)137 inline void ProcessStats_Thread::SharedCtor(
138 ::_pb::Arena* arena, bool is_message_owned) {
139 (void)arena;
140 (void)is_message_owned;
141 new (&_impl_) Impl_{
142 decltype(_impl_._has_bits_){}
143 , /*decltype(_impl_._cached_size_)*/{}
144 , decltype(_impl_.tid_){0}
145 };
146 }
147
~ProcessStats_Thread()148 ProcessStats_Thread::~ProcessStats_Thread() {
149 // @@protoc_insertion_point(destructor:perfetto.protos.ProcessStats.Thread)
150 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
151 (void)arena;
152 return;
153 }
154 SharedDtor();
155 }
156
SharedDtor()157 inline void ProcessStats_Thread::SharedDtor() {
158 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
159 }
160
SetCachedSize(int size) const161 void ProcessStats_Thread::SetCachedSize(int size) const {
162 _impl_._cached_size_.Set(size);
163 }
164
Clear()165 void ProcessStats_Thread::Clear() {
166 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ProcessStats.Thread)
167 ::uint32_t cached_has_bits = 0;
168 // Prevent compiler warnings about cached_has_bits being unused
169 (void) cached_has_bits;
170
171 _impl_.tid_ = 0;
172 _impl_._has_bits_.Clear();
173 _internal_metadata_.Clear<std::string>();
174 }
175
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)176 const char* ProcessStats_Thread::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
177 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
178 _Internal::HasBits has_bits{};
179 while (!ctx->Done(&ptr)) {
180 ::uint32_t tag;
181 ptr = ::_pbi::ReadTag(ptr, &tag);
182 switch (tag >> 3) {
183 // optional int32 tid = 1;
184 case 1:
185 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
186 _Internal::set_has_tid(&has_bits);
187 _impl_.tid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
188 CHK_(ptr);
189 } else {
190 goto handle_unusual;
191 }
192 continue;
193 default:
194 goto handle_unusual;
195 } // switch
196 handle_unusual:
197 if ((tag == 0) || ((tag & 7) == 4)) {
198 CHK_(ptr);
199 ctx->SetLastTag(tag);
200 goto message_done;
201 }
202 ptr = UnknownFieldParse(
203 tag,
204 _internal_metadata_.mutable_unknown_fields<std::string>(),
205 ptr, ctx);
206 CHK_(ptr != nullptr);
207 } // while
208 message_done:
209 _impl_._has_bits_.Or(has_bits);
210 return ptr;
211 failure:
212 ptr = nullptr;
213 goto message_done;
214 #undef CHK_
215 }
216
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const217 ::uint8_t* ProcessStats_Thread::_InternalSerialize(
218 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
219 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ProcessStats.Thread)
220 ::uint32_t cached_has_bits = 0;
221 (void) cached_has_bits;
222
223 cached_has_bits = _impl_._has_bits_[0];
224 // optional int32 tid = 1;
225 if (cached_has_bits & 0x00000001u) {
226 target = stream->EnsureSpace(target);
227 target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_tid(), target);
228 }
229
230 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
231 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
232 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
233 }
234 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ProcessStats.Thread)
235 return target;
236 }
237
ByteSizeLong() const238 size_t ProcessStats_Thread::ByteSizeLong() const {
239 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ProcessStats.Thread)
240 size_t total_size = 0;
241
242 ::uint32_t cached_has_bits = 0;
243 // Prevent compiler warnings about cached_has_bits being unused
244 (void) cached_has_bits;
245
246 // optional int32 tid = 1;
247 cached_has_bits = _impl_._has_bits_[0];
248 if (cached_has_bits & 0x00000001u) {
249 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_tid());
250 }
251
252 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
253 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
254 }
255 int cached_size = ::_pbi::ToCachedSize(total_size);
256 SetCachedSize(cached_size);
257 return total_size;
258 }
259
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)260 void ProcessStats_Thread::CheckTypeAndMergeFrom(
261 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
262 MergeFrom(*::_pbi::DownCast<const ProcessStats_Thread*>(
263 &from));
264 }
265
MergeFrom(const ProcessStats_Thread & from)266 void ProcessStats_Thread::MergeFrom(const ProcessStats_Thread& from) {
267 ProcessStats_Thread* const _this = this;
268 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ProcessStats.Thread)
269 GOOGLE_DCHECK_NE(&from, _this);
270 ::uint32_t cached_has_bits = 0;
271 (void) cached_has_bits;
272
273 if (from._internal_has_tid()) {
274 _this->_internal_set_tid(from._internal_tid());
275 }
276 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
277 }
278
CopyFrom(const ProcessStats_Thread & from)279 void ProcessStats_Thread::CopyFrom(const ProcessStats_Thread& from) {
280 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ProcessStats.Thread)
281 if (&from == this) return;
282 Clear();
283 MergeFrom(from);
284 }
285
IsInitialized() const286 bool ProcessStats_Thread::IsInitialized() const {
287 return true;
288 }
289
InternalSwap(ProcessStats_Thread * other)290 void ProcessStats_Thread::InternalSwap(ProcessStats_Thread* other) {
291 using std::swap;
292 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
293 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
294 swap(_impl_.tid_, other->_impl_.tid_);
295 }
296
GetTypeName() const297 std::string ProcessStats_Thread::GetTypeName() const {
298 return "perfetto.protos.ProcessStats.Thread";
299 }
300
301
302 // ===================================================================
303
304 class ProcessStats_FDInfo::_Internal {
305 public:
306 using HasBits = decltype(std::declval<ProcessStats_FDInfo>()._impl_._has_bits_);
set_has_fd(HasBits * has_bits)307 static void set_has_fd(HasBits* has_bits) {
308 (*has_bits)[0] |= 2u;
309 }
set_has_path(HasBits * has_bits)310 static void set_has_path(HasBits* has_bits) {
311 (*has_bits)[0] |= 1u;
312 }
313 };
314
ProcessStats_FDInfo(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)315 ProcessStats_FDInfo::ProcessStats_FDInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena,
316 bool is_message_owned)
317 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
318 SharedCtor(arena, is_message_owned);
319 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ProcessStats.FDInfo)
320 }
ProcessStats_FDInfo(const ProcessStats_FDInfo & from)321 ProcessStats_FDInfo::ProcessStats_FDInfo(const ProcessStats_FDInfo& from)
322 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
323 ProcessStats_FDInfo* const _this = this; (void)_this;
324 new (&_impl_) Impl_{
325 decltype(_impl_._has_bits_){from._impl_._has_bits_}
326 , /*decltype(_impl_._cached_size_)*/{}
327 , decltype(_impl_.path_){}
328 , decltype(_impl_.fd_){}};
329
330 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
331 _impl_.path_.InitDefault();
332 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
333 _impl_.path_.Set("", GetArenaForAllocation());
334 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
335 if (from._internal_has_path()) {
336 _this->_impl_.path_.Set(from._internal_path(),
337 _this->GetArenaForAllocation());
338 }
339 _this->_impl_.fd_ = from._impl_.fd_;
340 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ProcessStats.FDInfo)
341 }
342
SharedCtor(::_pb::Arena * arena,bool is_message_owned)343 inline void ProcessStats_FDInfo::SharedCtor(
344 ::_pb::Arena* arena, bool is_message_owned) {
345 (void)arena;
346 (void)is_message_owned;
347 new (&_impl_) Impl_{
348 decltype(_impl_._has_bits_){}
349 , /*decltype(_impl_._cached_size_)*/{}
350 , decltype(_impl_.path_){}
351 , decltype(_impl_.fd_){::uint64_t{0u}}
352 };
353 _impl_.path_.InitDefault();
354 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
355 _impl_.path_.Set("", GetArenaForAllocation());
356 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
357 }
358
~ProcessStats_FDInfo()359 ProcessStats_FDInfo::~ProcessStats_FDInfo() {
360 // @@protoc_insertion_point(destructor:perfetto.protos.ProcessStats.FDInfo)
361 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
362 (void)arena;
363 return;
364 }
365 SharedDtor();
366 }
367
SharedDtor()368 inline void ProcessStats_FDInfo::SharedDtor() {
369 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
370 _impl_.path_.Destroy();
371 }
372
SetCachedSize(int size) const373 void ProcessStats_FDInfo::SetCachedSize(int size) const {
374 _impl_._cached_size_.Set(size);
375 }
376
Clear()377 void ProcessStats_FDInfo::Clear() {
378 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ProcessStats.FDInfo)
379 ::uint32_t cached_has_bits = 0;
380 // Prevent compiler warnings about cached_has_bits being unused
381 (void) cached_has_bits;
382
383 cached_has_bits = _impl_._has_bits_[0];
384 if (cached_has_bits & 0x00000001u) {
385 _impl_.path_.ClearNonDefaultToEmpty();
386 }
387 _impl_.fd_ = ::uint64_t{0u};
388 _impl_._has_bits_.Clear();
389 _internal_metadata_.Clear<std::string>();
390 }
391
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)392 const char* ProcessStats_FDInfo::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
393 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
394 _Internal::HasBits has_bits{};
395 while (!ctx->Done(&ptr)) {
396 ::uint32_t tag;
397 ptr = ::_pbi::ReadTag(ptr, &tag);
398 switch (tag >> 3) {
399 // optional uint64 fd = 1;
400 case 1:
401 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
402 _Internal::set_has_fd(&has_bits);
403 _impl_.fd_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
404 CHK_(ptr);
405 } else {
406 goto handle_unusual;
407 }
408 continue;
409 // optional string path = 2;
410 case 2:
411 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
412 auto str = _internal_mutable_path();
413 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
414 CHK_(ptr);
415 } else {
416 goto handle_unusual;
417 }
418 continue;
419 default:
420 goto handle_unusual;
421 } // switch
422 handle_unusual:
423 if ((tag == 0) || ((tag & 7) == 4)) {
424 CHK_(ptr);
425 ctx->SetLastTag(tag);
426 goto message_done;
427 }
428 ptr = UnknownFieldParse(
429 tag,
430 _internal_metadata_.mutable_unknown_fields<std::string>(),
431 ptr, ctx);
432 CHK_(ptr != nullptr);
433 } // while
434 message_done:
435 _impl_._has_bits_.Or(has_bits);
436 return ptr;
437 failure:
438 ptr = nullptr;
439 goto message_done;
440 #undef CHK_
441 }
442
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const443 ::uint8_t* ProcessStats_FDInfo::_InternalSerialize(
444 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
445 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ProcessStats.FDInfo)
446 ::uint32_t cached_has_bits = 0;
447 (void) cached_has_bits;
448
449 cached_has_bits = _impl_._has_bits_[0];
450 // optional uint64 fd = 1;
451 if (cached_has_bits & 0x00000002u) {
452 target = stream->EnsureSpace(target);
453 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_fd(), target);
454 }
455
456 // optional string path = 2;
457 if (cached_has_bits & 0x00000001u) {
458 target = stream->WriteStringMaybeAliased(
459 2, this->_internal_path(), target);
460 }
461
462 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
463 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
464 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
465 }
466 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ProcessStats.FDInfo)
467 return target;
468 }
469
ByteSizeLong() const470 size_t ProcessStats_FDInfo::ByteSizeLong() const {
471 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ProcessStats.FDInfo)
472 size_t total_size = 0;
473
474 ::uint32_t cached_has_bits = 0;
475 // Prevent compiler warnings about cached_has_bits being unused
476 (void) cached_has_bits;
477
478 cached_has_bits = _impl_._has_bits_[0];
479 if (cached_has_bits & 0x00000003u) {
480 // optional string path = 2;
481 if (cached_has_bits & 0x00000001u) {
482 total_size += 1 +
483 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
484 this->_internal_path());
485 }
486
487 // optional uint64 fd = 1;
488 if (cached_has_bits & 0x00000002u) {
489 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_fd());
490 }
491
492 }
493 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
494 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
495 }
496 int cached_size = ::_pbi::ToCachedSize(total_size);
497 SetCachedSize(cached_size);
498 return total_size;
499 }
500
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)501 void ProcessStats_FDInfo::CheckTypeAndMergeFrom(
502 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
503 MergeFrom(*::_pbi::DownCast<const ProcessStats_FDInfo*>(
504 &from));
505 }
506
MergeFrom(const ProcessStats_FDInfo & from)507 void ProcessStats_FDInfo::MergeFrom(const ProcessStats_FDInfo& from) {
508 ProcessStats_FDInfo* const _this = this;
509 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ProcessStats.FDInfo)
510 GOOGLE_DCHECK_NE(&from, _this);
511 ::uint32_t cached_has_bits = 0;
512 (void) cached_has_bits;
513
514 cached_has_bits = from._impl_._has_bits_[0];
515 if (cached_has_bits & 0x00000003u) {
516 if (cached_has_bits & 0x00000001u) {
517 _this->_internal_set_path(from._internal_path());
518 }
519 if (cached_has_bits & 0x00000002u) {
520 _this->_impl_.fd_ = from._impl_.fd_;
521 }
522 _this->_impl_._has_bits_[0] |= cached_has_bits;
523 }
524 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
525 }
526
CopyFrom(const ProcessStats_FDInfo & from)527 void ProcessStats_FDInfo::CopyFrom(const ProcessStats_FDInfo& from) {
528 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ProcessStats.FDInfo)
529 if (&from == this) return;
530 Clear();
531 MergeFrom(from);
532 }
533
IsInitialized() const534 bool ProcessStats_FDInfo::IsInitialized() const {
535 return true;
536 }
537
InternalSwap(ProcessStats_FDInfo * other)538 void ProcessStats_FDInfo::InternalSwap(ProcessStats_FDInfo* other) {
539 using std::swap;
540 auto* lhs_arena = GetArenaForAllocation();
541 auto* rhs_arena = other->GetArenaForAllocation();
542 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
543 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
544 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
545 &_impl_.path_, lhs_arena,
546 &other->_impl_.path_, rhs_arena
547 );
548 swap(_impl_.fd_, other->_impl_.fd_);
549 }
550
GetTypeName() const551 std::string ProcessStats_FDInfo::GetTypeName() const {
552 return "perfetto.protos.ProcessStats.FDInfo";
553 }
554
555
556 // ===================================================================
557
558 class ProcessStats_Process::_Internal {
559 public:
560 using HasBits = decltype(std::declval<ProcessStats_Process>()._impl_._has_bits_);
set_has_pid(HasBits * has_bits)561 static void set_has_pid(HasBits* has_bits) {
562 (*has_bits)[0] |= 32u;
563 }
set_has_vm_size_kb(HasBits * has_bits)564 static void set_has_vm_size_kb(HasBits* has_bits) {
565 (*has_bits)[0] |= 1u;
566 }
set_has_vm_rss_kb(HasBits * has_bits)567 static void set_has_vm_rss_kb(HasBits* has_bits) {
568 (*has_bits)[0] |= 2u;
569 }
set_has_rss_anon_kb(HasBits * has_bits)570 static void set_has_rss_anon_kb(HasBits* has_bits) {
571 (*has_bits)[0] |= 4u;
572 }
set_has_rss_file_kb(HasBits * has_bits)573 static void set_has_rss_file_kb(HasBits* has_bits) {
574 (*has_bits)[0] |= 8u;
575 }
set_has_rss_shmem_kb(HasBits * has_bits)576 static void set_has_rss_shmem_kb(HasBits* has_bits) {
577 (*has_bits)[0] |= 16u;
578 }
set_has_vm_swap_kb(HasBits * has_bits)579 static void set_has_vm_swap_kb(HasBits* has_bits) {
580 (*has_bits)[0] |= 128u;
581 }
set_has_vm_locked_kb(HasBits * has_bits)582 static void set_has_vm_locked_kb(HasBits* has_bits) {
583 (*has_bits)[0] |= 256u;
584 }
set_has_vm_hwm_kb(HasBits * has_bits)585 static void set_has_vm_hwm_kb(HasBits* has_bits) {
586 (*has_bits)[0] |= 512u;
587 }
set_has_oom_score_adj(HasBits * has_bits)588 static void set_has_oom_score_adj(HasBits* has_bits) {
589 (*has_bits)[0] |= 1024u;
590 }
set_has_is_peak_rss_resettable(HasBits * has_bits)591 static void set_has_is_peak_rss_resettable(HasBits* has_bits) {
592 (*has_bits)[0] |= 64u;
593 }
set_has_chrome_private_footprint_kb(HasBits * has_bits)594 static void set_has_chrome_private_footprint_kb(HasBits* has_bits) {
595 (*has_bits)[0] |= 2048u;
596 }
set_has_chrome_peak_resident_set_kb(HasBits * has_bits)597 static void set_has_chrome_peak_resident_set_kb(HasBits* has_bits) {
598 (*has_bits)[0] |= 4096u;
599 }
set_has_smr_rss_kb(HasBits * has_bits)600 static void set_has_smr_rss_kb(HasBits* has_bits) {
601 (*has_bits)[0] |= 8192u;
602 }
set_has_smr_pss_kb(HasBits * has_bits)603 static void set_has_smr_pss_kb(HasBits* has_bits) {
604 (*has_bits)[0] |= 16384u;
605 }
set_has_smr_pss_anon_kb(HasBits * has_bits)606 static void set_has_smr_pss_anon_kb(HasBits* has_bits) {
607 (*has_bits)[0] |= 32768u;
608 }
set_has_smr_pss_file_kb(HasBits * has_bits)609 static void set_has_smr_pss_file_kb(HasBits* has_bits) {
610 (*has_bits)[0] |= 65536u;
611 }
set_has_smr_pss_shmem_kb(HasBits * has_bits)612 static void set_has_smr_pss_shmem_kb(HasBits* has_bits) {
613 (*has_bits)[0] |= 131072u;
614 }
set_has_smr_swap_pss_kb(HasBits * has_bits)615 static void set_has_smr_swap_pss_kb(HasBits* has_bits) {
616 (*has_bits)[0] |= 1048576u;
617 }
set_has_runtime_user_mode(HasBits * has_bits)618 static void set_has_runtime_user_mode(HasBits* has_bits) {
619 (*has_bits)[0] |= 262144u;
620 }
set_has_runtime_kernel_mode(HasBits * has_bits)621 static void set_has_runtime_kernel_mode(HasBits* has_bits) {
622 (*has_bits)[0] |= 524288u;
623 }
624 };
625
ProcessStats_Process(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)626 ProcessStats_Process::ProcessStats_Process(::PROTOBUF_NAMESPACE_ID::Arena* arena,
627 bool is_message_owned)
628 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
629 SharedCtor(arena, is_message_owned);
630 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ProcessStats.Process)
631 }
ProcessStats_Process(const ProcessStats_Process & from)632 ProcessStats_Process::ProcessStats_Process(const ProcessStats_Process& from)
633 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
634 ProcessStats_Process* const _this = this; (void)_this;
635 new (&_impl_) Impl_{
636 decltype(_impl_._has_bits_){from._impl_._has_bits_}
637 , /*decltype(_impl_._cached_size_)*/{}
638 , decltype(_impl_.threads_){from._impl_.threads_}
639 , decltype(_impl_.fds_){from._impl_.fds_}
640 , decltype(_impl_.vm_size_kb_){}
641 , decltype(_impl_.vm_rss_kb_){}
642 , decltype(_impl_.rss_anon_kb_){}
643 , decltype(_impl_.rss_file_kb_){}
644 , decltype(_impl_.rss_shmem_kb_){}
645 , decltype(_impl_.pid_){}
646 , decltype(_impl_.is_peak_rss_resettable_){}
647 , decltype(_impl_.vm_swap_kb_){}
648 , decltype(_impl_.vm_locked_kb_){}
649 , decltype(_impl_.vm_hwm_kb_){}
650 , decltype(_impl_.oom_score_adj_){}
651 , decltype(_impl_.chrome_private_footprint_kb_){}
652 , decltype(_impl_.chrome_peak_resident_set_kb_){}
653 , decltype(_impl_.smr_rss_kb_){}
654 , decltype(_impl_.smr_pss_kb_){}
655 , decltype(_impl_.smr_pss_anon_kb_){}
656 , decltype(_impl_.smr_pss_file_kb_){}
657 , decltype(_impl_.smr_pss_shmem_kb_){}
658 , decltype(_impl_.runtime_user_mode_){}
659 , decltype(_impl_.runtime_kernel_mode_){}
660 , decltype(_impl_.smr_swap_pss_kb_){}};
661
662 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
663 ::memcpy(&_impl_.vm_size_kb_, &from._impl_.vm_size_kb_,
664 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.smr_swap_pss_kb_) -
665 reinterpret_cast<char*>(&_impl_.vm_size_kb_)) + sizeof(_impl_.smr_swap_pss_kb_));
666 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ProcessStats.Process)
667 }
668
SharedCtor(::_pb::Arena * arena,bool is_message_owned)669 inline void ProcessStats_Process::SharedCtor(
670 ::_pb::Arena* arena, bool is_message_owned) {
671 (void)arena;
672 (void)is_message_owned;
673 new (&_impl_) Impl_{
674 decltype(_impl_._has_bits_){}
675 , /*decltype(_impl_._cached_size_)*/{}
676 , decltype(_impl_.threads_){arena}
677 , decltype(_impl_.fds_){arena}
678 , decltype(_impl_.vm_size_kb_){::uint64_t{0u}}
679 , decltype(_impl_.vm_rss_kb_){::uint64_t{0u}}
680 , decltype(_impl_.rss_anon_kb_){::uint64_t{0u}}
681 , decltype(_impl_.rss_file_kb_){::uint64_t{0u}}
682 , decltype(_impl_.rss_shmem_kb_){::uint64_t{0u}}
683 , decltype(_impl_.pid_){0}
684 , decltype(_impl_.is_peak_rss_resettable_){false}
685 , decltype(_impl_.vm_swap_kb_){::uint64_t{0u}}
686 , decltype(_impl_.vm_locked_kb_){::uint64_t{0u}}
687 , decltype(_impl_.vm_hwm_kb_){::uint64_t{0u}}
688 , decltype(_impl_.oom_score_adj_){::int64_t{0}}
689 , decltype(_impl_.chrome_private_footprint_kb_){0u}
690 , decltype(_impl_.chrome_peak_resident_set_kb_){0u}
691 , decltype(_impl_.smr_rss_kb_){::uint64_t{0u}}
692 , decltype(_impl_.smr_pss_kb_){::uint64_t{0u}}
693 , decltype(_impl_.smr_pss_anon_kb_){::uint64_t{0u}}
694 , decltype(_impl_.smr_pss_file_kb_){::uint64_t{0u}}
695 , decltype(_impl_.smr_pss_shmem_kb_){::uint64_t{0u}}
696 , decltype(_impl_.runtime_user_mode_){::uint64_t{0u}}
697 , decltype(_impl_.runtime_kernel_mode_){::uint64_t{0u}}
698 , decltype(_impl_.smr_swap_pss_kb_){::uint64_t{0u}}
699 };
700 }
701
~ProcessStats_Process()702 ProcessStats_Process::~ProcessStats_Process() {
703 // @@protoc_insertion_point(destructor:perfetto.protos.ProcessStats.Process)
704 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
705 (void)arena;
706 return;
707 }
708 SharedDtor();
709 }
710
SharedDtor()711 inline void ProcessStats_Process::SharedDtor() {
712 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
713 _impl_.threads_.~RepeatedPtrField();
714 _impl_.fds_.~RepeatedPtrField();
715 }
716
SetCachedSize(int size) const717 void ProcessStats_Process::SetCachedSize(int size) const {
718 _impl_._cached_size_.Set(size);
719 }
720
Clear()721 void ProcessStats_Process::Clear() {
722 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ProcessStats.Process)
723 ::uint32_t cached_has_bits = 0;
724 // Prevent compiler warnings about cached_has_bits being unused
725 (void) cached_has_bits;
726
727 _impl_.threads_.Clear();
728 _impl_.fds_.Clear();
729 cached_has_bits = _impl_._has_bits_[0];
730 if (cached_has_bits & 0x000000ffu) {
731 ::memset(&_impl_.vm_size_kb_, 0, static_cast<size_t>(
732 reinterpret_cast<char*>(&_impl_.vm_swap_kb_) -
733 reinterpret_cast<char*>(&_impl_.vm_size_kb_)) + sizeof(_impl_.vm_swap_kb_));
734 }
735 if (cached_has_bits & 0x0000ff00u) {
736 ::memset(&_impl_.vm_locked_kb_, 0, static_cast<size_t>(
737 reinterpret_cast<char*>(&_impl_.smr_pss_anon_kb_) -
738 reinterpret_cast<char*>(&_impl_.vm_locked_kb_)) + sizeof(_impl_.smr_pss_anon_kb_));
739 }
740 if (cached_has_bits & 0x001f0000u) {
741 ::memset(&_impl_.smr_pss_file_kb_, 0, static_cast<size_t>(
742 reinterpret_cast<char*>(&_impl_.smr_swap_pss_kb_) -
743 reinterpret_cast<char*>(&_impl_.smr_pss_file_kb_)) + sizeof(_impl_.smr_swap_pss_kb_));
744 }
745 _impl_._has_bits_.Clear();
746 _internal_metadata_.Clear<std::string>();
747 }
748
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)749 const char* ProcessStats_Process::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
750 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
751 _Internal::HasBits has_bits{};
752 while (!ctx->Done(&ptr)) {
753 ::uint32_t tag;
754 ptr = ::_pbi::ReadTag(ptr, &tag);
755 switch (tag >> 3) {
756 // optional int32 pid = 1;
757 case 1:
758 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
759 _Internal::set_has_pid(&has_bits);
760 _impl_.pid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
761 CHK_(ptr);
762 } else {
763 goto handle_unusual;
764 }
765 continue;
766 // optional uint64 vm_size_kb = 2;
767 case 2:
768 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
769 _Internal::set_has_vm_size_kb(&has_bits);
770 _impl_.vm_size_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
771 CHK_(ptr);
772 } else {
773 goto handle_unusual;
774 }
775 continue;
776 // optional uint64 vm_rss_kb = 3;
777 case 3:
778 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
779 _Internal::set_has_vm_rss_kb(&has_bits);
780 _impl_.vm_rss_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
781 CHK_(ptr);
782 } else {
783 goto handle_unusual;
784 }
785 continue;
786 // optional uint64 rss_anon_kb = 4;
787 case 4:
788 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
789 _Internal::set_has_rss_anon_kb(&has_bits);
790 _impl_.rss_anon_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
791 CHK_(ptr);
792 } else {
793 goto handle_unusual;
794 }
795 continue;
796 // optional uint64 rss_file_kb = 5;
797 case 5:
798 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
799 _Internal::set_has_rss_file_kb(&has_bits);
800 _impl_.rss_file_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
801 CHK_(ptr);
802 } else {
803 goto handle_unusual;
804 }
805 continue;
806 // optional uint64 rss_shmem_kb = 6;
807 case 6:
808 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
809 _Internal::set_has_rss_shmem_kb(&has_bits);
810 _impl_.rss_shmem_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
811 CHK_(ptr);
812 } else {
813 goto handle_unusual;
814 }
815 continue;
816 // optional uint64 vm_swap_kb = 7;
817 case 7:
818 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
819 _Internal::set_has_vm_swap_kb(&has_bits);
820 _impl_.vm_swap_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
821 CHK_(ptr);
822 } else {
823 goto handle_unusual;
824 }
825 continue;
826 // optional uint64 vm_locked_kb = 8;
827 case 8:
828 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
829 _Internal::set_has_vm_locked_kb(&has_bits);
830 _impl_.vm_locked_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
831 CHK_(ptr);
832 } else {
833 goto handle_unusual;
834 }
835 continue;
836 // optional uint64 vm_hwm_kb = 9;
837 case 9:
838 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
839 _Internal::set_has_vm_hwm_kb(&has_bits);
840 _impl_.vm_hwm_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
841 CHK_(ptr);
842 } else {
843 goto handle_unusual;
844 }
845 continue;
846 // optional int64 oom_score_adj = 10;
847 case 10:
848 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
849 _Internal::set_has_oom_score_adj(&has_bits);
850 _impl_.oom_score_adj_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
851 CHK_(ptr);
852 } else {
853 goto handle_unusual;
854 }
855 continue;
856 // repeated .perfetto.protos.ProcessStats.Thread threads = 11;
857 case 11:
858 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 90)) {
859 ptr -= 1;
860 do {
861 ptr += 1;
862 ptr = ctx->ParseMessage(_internal_add_threads(), ptr);
863 CHK_(ptr);
864 if (!ctx->DataAvailable(ptr)) break;
865 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<90>(ptr));
866 } else {
867 goto handle_unusual;
868 }
869 continue;
870 // optional bool is_peak_rss_resettable = 12;
871 case 12:
872 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 96)) {
873 _Internal::set_has_is_peak_rss_resettable(&has_bits);
874 _impl_.is_peak_rss_resettable_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
875 CHK_(ptr);
876 } else {
877 goto handle_unusual;
878 }
879 continue;
880 // optional uint32 chrome_private_footprint_kb = 13;
881 case 13:
882 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 104)) {
883 _Internal::set_has_chrome_private_footprint_kb(&has_bits);
884 _impl_.chrome_private_footprint_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
885 CHK_(ptr);
886 } else {
887 goto handle_unusual;
888 }
889 continue;
890 // optional uint32 chrome_peak_resident_set_kb = 14;
891 case 14:
892 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 112)) {
893 _Internal::set_has_chrome_peak_resident_set_kb(&has_bits);
894 _impl_.chrome_peak_resident_set_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
895 CHK_(ptr);
896 } else {
897 goto handle_unusual;
898 }
899 continue;
900 // repeated .perfetto.protos.ProcessStats.FDInfo fds = 15;
901 case 15:
902 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 122)) {
903 ptr -= 1;
904 do {
905 ptr += 1;
906 ptr = ctx->ParseMessage(_internal_add_fds(), ptr);
907 CHK_(ptr);
908 if (!ctx->DataAvailable(ptr)) break;
909 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<122>(ptr));
910 } else {
911 goto handle_unusual;
912 }
913 continue;
914 // optional uint64 smr_rss_kb = 16;
915 case 16:
916 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 128)) {
917 _Internal::set_has_smr_rss_kb(&has_bits);
918 _impl_.smr_rss_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
919 CHK_(ptr);
920 } else {
921 goto handle_unusual;
922 }
923 continue;
924 // optional uint64 smr_pss_kb = 17;
925 case 17:
926 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 136)) {
927 _Internal::set_has_smr_pss_kb(&has_bits);
928 _impl_.smr_pss_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
929 CHK_(ptr);
930 } else {
931 goto handle_unusual;
932 }
933 continue;
934 // optional uint64 smr_pss_anon_kb = 18;
935 case 18:
936 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 144)) {
937 _Internal::set_has_smr_pss_anon_kb(&has_bits);
938 _impl_.smr_pss_anon_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
939 CHK_(ptr);
940 } else {
941 goto handle_unusual;
942 }
943 continue;
944 // optional uint64 smr_pss_file_kb = 19;
945 case 19:
946 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 152)) {
947 _Internal::set_has_smr_pss_file_kb(&has_bits);
948 _impl_.smr_pss_file_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
949 CHK_(ptr);
950 } else {
951 goto handle_unusual;
952 }
953 continue;
954 // optional uint64 smr_pss_shmem_kb = 20;
955 case 20:
956 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 160)) {
957 _Internal::set_has_smr_pss_shmem_kb(&has_bits);
958 _impl_.smr_pss_shmem_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
959 CHK_(ptr);
960 } else {
961 goto handle_unusual;
962 }
963 continue;
964 // optional uint64 runtime_user_mode = 21;
965 case 21:
966 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 168)) {
967 _Internal::set_has_runtime_user_mode(&has_bits);
968 _impl_.runtime_user_mode_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
969 CHK_(ptr);
970 } else {
971 goto handle_unusual;
972 }
973 continue;
974 // optional uint64 runtime_kernel_mode = 22;
975 case 22:
976 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 176)) {
977 _Internal::set_has_runtime_kernel_mode(&has_bits);
978 _impl_.runtime_kernel_mode_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
979 CHK_(ptr);
980 } else {
981 goto handle_unusual;
982 }
983 continue;
984 // optional uint64 smr_swap_pss_kb = 23;
985 case 23:
986 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 184)) {
987 _Internal::set_has_smr_swap_pss_kb(&has_bits);
988 _impl_.smr_swap_pss_kb_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
989 CHK_(ptr);
990 } else {
991 goto handle_unusual;
992 }
993 continue;
994 default:
995 goto handle_unusual;
996 } // switch
997 handle_unusual:
998 if ((tag == 0) || ((tag & 7) == 4)) {
999 CHK_(ptr);
1000 ctx->SetLastTag(tag);
1001 goto message_done;
1002 }
1003 ptr = UnknownFieldParse(
1004 tag,
1005 _internal_metadata_.mutable_unknown_fields<std::string>(),
1006 ptr, ctx);
1007 CHK_(ptr != nullptr);
1008 } // while
1009 message_done:
1010 _impl_._has_bits_.Or(has_bits);
1011 return ptr;
1012 failure:
1013 ptr = nullptr;
1014 goto message_done;
1015 #undef CHK_
1016 }
1017
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1018 ::uint8_t* ProcessStats_Process::_InternalSerialize(
1019 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1020 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ProcessStats.Process)
1021 ::uint32_t cached_has_bits = 0;
1022 (void) cached_has_bits;
1023
1024 cached_has_bits = _impl_._has_bits_[0];
1025 // optional int32 pid = 1;
1026 if (cached_has_bits & 0x00000020u) {
1027 target = stream->EnsureSpace(target);
1028 target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_pid(), target);
1029 }
1030
1031 // optional uint64 vm_size_kb = 2;
1032 if (cached_has_bits & 0x00000001u) {
1033 target = stream->EnsureSpace(target);
1034 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_vm_size_kb(), target);
1035 }
1036
1037 // optional uint64 vm_rss_kb = 3;
1038 if (cached_has_bits & 0x00000002u) {
1039 target = stream->EnsureSpace(target);
1040 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_vm_rss_kb(), target);
1041 }
1042
1043 // optional uint64 rss_anon_kb = 4;
1044 if (cached_has_bits & 0x00000004u) {
1045 target = stream->EnsureSpace(target);
1046 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_rss_anon_kb(), target);
1047 }
1048
1049 // optional uint64 rss_file_kb = 5;
1050 if (cached_has_bits & 0x00000008u) {
1051 target = stream->EnsureSpace(target);
1052 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_rss_file_kb(), target);
1053 }
1054
1055 // optional uint64 rss_shmem_kb = 6;
1056 if (cached_has_bits & 0x00000010u) {
1057 target = stream->EnsureSpace(target);
1058 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_rss_shmem_kb(), target);
1059 }
1060
1061 // optional uint64 vm_swap_kb = 7;
1062 if (cached_has_bits & 0x00000080u) {
1063 target = stream->EnsureSpace(target);
1064 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(7, this->_internal_vm_swap_kb(), target);
1065 }
1066
1067 // optional uint64 vm_locked_kb = 8;
1068 if (cached_has_bits & 0x00000100u) {
1069 target = stream->EnsureSpace(target);
1070 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(8, this->_internal_vm_locked_kb(), target);
1071 }
1072
1073 // optional uint64 vm_hwm_kb = 9;
1074 if (cached_has_bits & 0x00000200u) {
1075 target = stream->EnsureSpace(target);
1076 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(9, this->_internal_vm_hwm_kb(), target);
1077 }
1078
1079 // optional int64 oom_score_adj = 10;
1080 if (cached_has_bits & 0x00000400u) {
1081 target = stream->EnsureSpace(target);
1082 target = ::_pbi::WireFormatLite::WriteInt64ToArray(10, this->_internal_oom_score_adj(), target);
1083 }
1084
1085 // repeated .perfetto.protos.ProcessStats.Thread threads = 11;
1086 for (unsigned i = 0,
1087 n = static_cast<unsigned>(this->_internal_threads_size()); i < n; i++) {
1088 const auto& repfield = this->_internal_threads(i);
1089 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1090 InternalWriteMessage(11, repfield, repfield.GetCachedSize(), target, stream);
1091 }
1092
1093 // optional bool is_peak_rss_resettable = 12;
1094 if (cached_has_bits & 0x00000040u) {
1095 target = stream->EnsureSpace(target);
1096 target = ::_pbi::WireFormatLite::WriteBoolToArray(12, this->_internal_is_peak_rss_resettable(), target);
1097 }
1098
1099 // optional uint32 chrome_private_footprint_kb = 13;
1100 if (cached_has_bits & 0x00000800u) {
1101 target = stream->EnsureSpace(target);
1102 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(13, this->_internal_chrome_private_footprint_kb(), target);
1103 }
1104
1105 // optional uint32 chrome_peak_resident_set_kb = 14;
1106 if (cached_has_bits & 0x00001000u) {
1107 target = stream->EnsureSpace(target);
1108 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(14, this->_internal_chrome_peak_resident_set_kb(), target);
1109 }
1110
1111 // repeated .perfetto.protos.ProcessStats.FDInfo fds = 15;
1112 for (unsigned i = 0,
1113 n = static_cast<unsigned>(this->_internal_fds_size()); i < n; i++) {
1114 const auto& repfield = this->_internal_fds(i);
1115 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1116 InternalWriteMessage(15, repfield, repfield.GetCachedSize(), target, stream);
1117 }
1118
1119 // optional uint64 smr_rss_kb = 16;
1120 if (cached_has_bits & 0x00002000u) {
1121 target = stream->EnsureSpace(target);
1122 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(16, this->_internal_smr_rss_kb(), target);
1123 }
1124
1125 // optional uint64 smr_pss_kb = 17;
1126 if (cached_has_bits & 0x00004000u) {
1127 target = stream->EnsureSpace(target);
1128 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(17, this->_internal_smr_pss_kb(), target);
1129 }
1130
1131 // optional uint64 smr_pss_anon_kb = 18;
1132 if (cached_has_bits & 0x00008000u) {
1133 target = stream->EnsureSpace(target);
1134 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(18, this->_internal_smr_pss_anon_kb(), target);
1135 }
1136
1137 // optional uint64 smr_pss_file_kb = 19;
1138 if (cached_has_bits & 0x00010000u) {
1139 target = stream->EnsureSpace(target);
1140 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(19, this->_internal_smr_pss_file_kb(), target);
1141 }
1142
1143 // optional uint64 smr_pss_shmem_kb = 20;
1144 if (cached_has_bits & 0x00020000u) {
1145 target = stream->EnsureSpace(target);
1146 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(20, this->_internal_smr_pss_shmem_kb(), target);
1147 }
1148
1149 // optional uint64 runtime_user_mode = 21;
1150 if (cached_has_bits & 0x00040000u) {
1151 target = stream->EnsureSpace(target);
1152 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(21, this->_internal_runtime_user_mode(), target);
1153 }
1154
1155 // optional uint64 runtime_kernel_mode = 22;
1156 if (cached_has_bits & 0x00080000u) {
1157 target = stream->EnsureSpace(target);
1158 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(22, this->_internal_runtime_kernel_mode(), target);
1159 }
1160
1161 // optional uint64 smr_swap_pss_kb = 23;
1162 if (cached_has_bits & 0x00100000u) {
1163 target = stream->EnsureSpace(target);
1164 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(23, this->_internal_smr_swap_pss_kb(), target);
1165 }
1166
1167 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1168 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1169 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1170 }
1171 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ProcessStats.Process)
1172 return target;
1173 }
1174
ByteSizeLong() const1175 size_t ProcessStats_Process::ByteSizeLong() const {
1176 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ProcessStats.Process)
1177 size_t total_size = 0;
1178
1179 ::uint32_t cached_has_bits = 0;
1180 // Prevent compiler warnings about cached_has_bits being unused
1181 (void) cached_has_bits;
1182
1183 // repeated .perfetto.protos.ProcessStats.Thread threads = 11;
1184 total_size += 1UL * this->_internal_threads_size();
1185 for (const auto& msg : this->_impl_.threads_) {
1186 total_size +=
1187 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1188 }
1189
1190 // repeated .perfetto.protos.ProcessStats.FDInfo fds = 15;
1191 total_size += 1UL * this->_internal_fds_size();
1192 for (const auto& msg : this->_impl_.fds_) {
1193 total_size +=
1194 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1195 }
1196
1197 cached_has_bits = _impl_._has_bits_[0];
1198 if (cached_has_bits & 0x000000ffu) {
1199 // optional uint64 vm_size_kb = 2;
1200 if (cached_has_bits & 0x00000001u) {
1201 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_vm_size_kb());
1202 }
1203
1204 // optional uint64 vm_rss_kb = 3;
1205 if (cached_has_bits & 0x00000002u) {
1206 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_vm_rss_kb());
1207 }
1208
1209 // optional uint64 rss_anon_kb = 4;
1210 if (cached_has_bits & 0x00000004u) {
1211 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_rss_anon_kb());
1212 }
1213
1214 // optional uint64 rss_file_kb = 5;
1215 if (cached_has_bits & 0x00000008u) {
1216 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_rss_file_kb());
1217 }
1218
1219 // optional uint64 rss_shmem_kb = 6;
1220 if (cached_has_bits & 0x00000010u) {
1221 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_rss_shmem_kb());
1222 }
1223
1224 // optional int32 pid = 1;
1225 if (cached_has_bits & 0x00000020u) {
1226 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_pid());
1227 }
1228
1229 // optional bool is_peak_rss_resettable = 12;
1230 if (cached_has_bits & 0x00000040u) {
1231 total_size += 1 + 1;
1232 }
1233
1234 // optional uint64 vm_swap_kb = 7;
1235 if (cached_has_bits & 0x00000080u) {
1236 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_vm_swap_kb());
1237 }
1238
1239 }
1240 if (cached_has_bits & 0x0000ff00u) {
1241 // optional uint64 vm_locked_kb = 8;
1242 if (cached_has_bits & 0x00000100u) {
1243 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_vm_locked_kb());
1244 }
1245
1246 // optional uint64 vm_hwm_kb = 9;
1247 if (cached_has_bits & 0x00000200u) {
1248 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_vm_hwm_kb());
1249 }
1250
1251 // optional int64 oom_score_adj = 10;
1252 if (cached_has_bits & 0x00000400u) {
1253 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_oom_score_adj());
1254 }
1255
1256 // optional uint32 chrome_private_footprint_kb = 13;
1257 if (cached_has_bits & 0x00000800u) {
1258 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_chrome_private_footprint_kb());
1259 }
1260
1261 // optional uint32 chrome_peak_resident_set_kb = 14;
1262 if (cached_has_bits & 0x00001000u) {
1263 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_chrome_peak_resident_set_kb());
1264 }
1265
1266 // optional uint64 smr_rss_kb = 16;
1267 if (cached_has_bits & 0x00002000u) {
1268 total_size += 2 +
1269 ::_pbi::WireFormatLite::UInt64Size(
1270 this->_internal_smr_rss_kb());
1271 }
1272
1273 // optional uint64 smr_pss_kb = 17;
1274 if (cached_has_bits & 0x00004000u) {
1275 total_size += 2 +
1276 ::_pbi::WireFormatLite::UInt64Size(
1277 this->_internal_smr_pss_kb());
1278 }
1279
1280 // optional uint64 smr_pss_anon_kb = 18;
1281 if (cached_has_bits & 0x00008000u) {
1282 total_size += 2 +
1283 ::_pbi::WireFormatLite::UInt64Size(
1284 this->_internal_smr_pss_anon_kb());
1285 }
1286
1287 }
1288 if (cached_has_bits & 0x001f0000u) {
1289 // optional uint64 smr_pss_file_kb = 19;
1290 if (cached_has_bits & 0x00010000u) {
1291 total_size += 2 +
1292 ::_pbi::WireFormatLite::UInt64Size(
1293 this->_internal_smr_pss_file_kb());
1294 }
1295
1296 // optional uint64 smr_pss_shmem_kb = 20;
1297 if (cached_has_bits & 0x00020000u) {
1298 total_size += 2 +
1299 ::_pbi::WireFormatLite::UInt64Size(
1300 this->_internal_smr_pss_shmem_kb());
1301 }
1302
1303 // optional uint64 runtime_user_mode = 21;
1304 if (cached_has_bits & 0x00040000u) {
1305 total_size += 2 +
1306 ::_pbi::WireFormatLite::UInt64Size(
1307 this->_internal_runtime_user_mode());
1308 }
1309
1310 // optional uint64 runtime_kernel_mode = 22;
1311 if (cached_has_bits & 0x00080000u) {
1312 total_size += 2 +
1313 ::_pbi::WireFormatLite::UInt64Size(
1314 this->_internal_runtime_kernel_mode());
1315 }
1316
1317 // optional uint64 smr_swap_pss_kb = 23;
1318 if (cached_has_bits & 0x00100000u) {
1319 total_size += 2 +
1320 ::_pbi::WireFormatLite::UInt64Size(
1321 this->_internal_smr_swap_pss_kb());
1322 }
1323
1324 }
1325 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1326 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1327 }
1328 int cached_size = ::_pbi::ToCachedSize(total_size);
1329 SetCachedSize(cached_size);
1330 return total_size;
1331 }
1332
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1333 void ProcessStats_Process::CheckTypeAndMergeFrom(
1334 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1335 MergeFrom(*::_pbi::DownCast<const ProcessStats_Process*>(
1336 &from));
1337 }
1338
MergeFrom(const ProcessStats_Process & from)1339 void ProcessStats_Process::MergeFrom(const ProcessStats_Process& from) {
1340 ProcessStats_Process* const _this = this;
1341 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ProcessStats.Process)
1342 GOOGLE_DCHECK_NE(&from, _this);
1343 ::uint32_t cached_has_bits = 0;
1344 (void) cached_has_bits;
1345
1346 _this->_impl_.threads_.MergeFrom(from._impl_.threads_);
1347 _this->_impl_.fds_.MergeFrom(from._impl_.fds_);
1348 cached_has_bits = from._impl_._has_bits_[0];
1349 if (cached_has_bits & 0x000000ffu) {
1350 if (cached_has_bits & 0x00000001u) {
1351 _this->_impl_.vm_size_kb_ = from._impl_.vm_size_kb_;
1352 }
1353 if (cached_has_bits & 0x00000002u) {
1354 _this->_impl_.vm_rss_kb_ = from._impl_.vm_rss_kb_;
1355 }
1356 if (cached_has_bits & 0x00000004u) {
1357 _this->_impl_.rss_anon_kb_ = from._impl_.rss_anon_kb_;
1358 }
1359 if (cached_has_bits & 0x00000008u) {
1360 _this->_impl_.rss_file_kb_ = from._impl_.rss_file_kb_;
1361 }
1362 if (cached_has_bits & 0x00000010u) {
1363 _this->_impl_.rss_shmem_kb_ = from._impl_.rss_shmem_kb_;
1364 }
1365 if (cached_has_bits & 0x00000020u) {
1366 _this->_impl_.pid_ = from._impl_.pid_;
1367 }
1368 if (cached_has_bits & 0x00000040u) {
1369 _this->_impl_.is_peak_rss_resettable_ = from._impl_.is_peak_rss_resettable_;
1370 }
1371 if (cached_has_bits & 0x00000080u) {
1372 _this->_impl_.vm_swap_kb_ = from._impl_.vm_swap_kb_;
1373 }
1374 _this->_impl_._has_bits_[0] |= cached_has_bits;
1375 }
1376 if (cached_has_bits & 0x0000ff00u) {
1377 if (cached_has_bits & 0x00000100u) {
1378 _this->_impl_.vm_locked_kb_ = from._impl_.vm_locked_kb_;
1379 }
1380 if (cached_has_bits & 0x00000200u) {
1381 _this->_impl_.vm_hwm_kb_ = from._impl_.vm_hwm_kb_;
1382 }
1383 if (cached_has_bits & 0x00000400u) {
1384 _this->_impl_.oom_score_adj_ = from._impl_.oom_score_adj_;
1385 }
1386 if (cached_has_bits & 0x00000800u) {
1387 _this->_impl_.chrome_private_footprint_kb_ = from._impl_.chrome_private_footprint_kb_;
1388 }
1389 if (cached_has_bits & 0x00001000u) {
1390 _this->_impl_.chrome_peak_resident_set_kb_ = from._impl_.chrome_peak_resident_set_kb_;
1391 }
1392 if (cached_has_bits & 0x00002000u) {
1393 _this->_impl_.smr_rss_kb_ = from._impl_.smr_rss_kb_;
1394 }
1395 if (cached_has_bits & 0x00004000u) {
1396 _this->_impl_.smr_pss_kb_ = from._impl_.smr_pss_kb_;
1397 }
1398 if (cached_has_bits & 0x00008000u) {
1399 _this->_impl_.smr_pss_anon_kb_ = from._impl_.smr_pss_anon_kb_;
1400 }
1401 _this->_impl_._has_bits_[0] |= cached_has_bits;
1402 }
1403 if (cached_has_bits & 0x001f0000u) {
1404 if (cached_has_bits & 0x00010000u) {
1405 _this->_impl_.smr_pss_file_kb_ = from._impl_.smr_pss_file_kb_;
1406 }
1407 if (cached_has_bits & 0x00020000u) {
1408 _this->_impl_.smr_pss_shmem_kb_ = from._impl_.smr_pss_shmem_kb_;
1409 }
1410 if (cached_has_bits & 0x00040000u) {
1411 _this->_impl_.runtime_user_mode_ = from._impl_.runtime_user_mode_;
1412 }
1413 if (cached_has_bits & 0x00080000u) {
1414 _this->_impl_.runtime_kernel_mode_ = from._impl_.runtime_kernel_mode_;
1415 }
1416 if (cached_has_bits & 0x00100000u) {
1417 _this->_impl_.smr_swap_pss_kb_ = from._impl_.smr_swap_pss_kb_;
1418 }
1419 _this->_impl_._has_bits_[0] |= cached_has_bits;
1420 }
1421 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1422 }
1423
CopyFrom(const ProcessStats_Process & from)1424 void ProcessStats_Process::CopyFrom(const ProcessStats_Process& from) {
1425 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ProcessStats.Process)
1426 if (&from == this) return;
1427 Clear();
1428 MergeFrom(from);
1429 }
1430
IsInitialized() const1431 bool ProcessStats_Process::IsInitialized() const {
1432 return true;
1433 }
1434
InternalSwap(ProcessStats_Process * other)1435 void ProcessStats_Process::InternalSwap(ProcessStats_Process* other) {
1436 using std::swap;
1437 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1438 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1439 _impl_.threads_.InternalSwap(&other->_impl_.threads_);
1440 _impl_.fds_.InternalSwap(&other->_impl_.fds_);
1441 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1442 PROTOBUF_FIELD_OFFSET(ProcessStats_Process, _impl_.smr_swap_pss_kb_)
1443 + sizeof(ProcessStats_Process::_impl_.smr_swap_pss_kb_) // NOLINT
1444 - PROTOBUF_FIELD_OFFSET(ProcessStats_Process, _impl_.vm_size_kb_)>(
1445 reinterpret_cast<char*>(&_impl_.vm_size_kb_),
1446 reinterpret_cast<char*>(&other->_impl_.vm_size_kb_));
1447 }
1448
GetTypeName() const1449 std::string ProcessStats_Process::GetTypeName() const {
1450 return "perfetto.protos.ProcessStats.Process";
1451 }
1452
1453
1454 // ===================================================================
1455
1456 class ProcessStats::_Internal {
1457 public:
1458 using HasBits = decltype(std::declval<ProcessStats>()._impl_._has_bits_);
set_has_collection_end_timestamp(HasBits * has_bits)1459 static void set_has_collection_end_timestamp(HasBits* has_bits) {
1460 (*has_bits)[0] |= 1u;
1461 }
1462 };
1463
ProcessStats(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1464 ProcessStats::ProcessStats(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1465 bool is_message_owned)
1466 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1467 SharedCtor(arena, is_message_owned);
1468 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ProcessStats)
1469 }
ProcessStats(const ProcessStats & from)1470 ProcessStats::ProcessStats(const ProcessStats& from)
1471 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1472 ProcessStats* const _this = this; (void)_this;
1473 new (&_impl_) Impl_{
1474 decltype(_impl_._has_bits_){from._impl_._has_bits_}
1475 , /*decltype(_impl_._cached_size_)*/{}
1476 , decltype(_impl_.processes_){from._impl_.processes_}
1477 , decltype(_impl_.collection_end_timestamp_){}};
1478
1479 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1480 _this->_impl_.collection_end_timestamp_ = from._impl_.collection_end_timestamp_;
1481 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ProcessStats)
1482 }
1483
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1484 inline void ProcessStats::SharedCtor(
1485 ::_pb::Arena* arena, bool is_message_owned) {
1486 (void)arena;
1487 (void)is_message_owned;
1488 new (&_impl_) Impl_{
1489 decltype(_impl_._has_bits_){}
1490 , /*decltype(_impl_._cached_size_)*/{}
1491 , decltype(_impl_.processes_){arena}
1492 , decltype(_impl_.collection_end_timestamp_){::uint64_t{0u}}
1493 };
1494 }
1495
~ProcessStats()1496 ProcessStats::~ProcessStats() {
1497 // @@protoc_insertion_point(destructor:perfetto.protos.ProcessStats)
1498 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1499 (void)arena;
1500 return;
1501 }
1502 SharedDtor();
1503 }
1504
SharedDtor()1505 inline void ProcessStats::SharedDtor() {
1506 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1507 _impl_.processes_.~RepeatedPtrField();
1508 }
1509
SetCachedSize(int size) const1510 void ProcessStats::SetCachedSize(int size) const {
1511 _impl_._cached_size_.Set(size);
1512 }
1513
Clear()1514 void ProcessStats::Clear() {
1515 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ProcessStats)
1516 ::uint32_t cached_has_bits = 0;
1517 // Prevent compiler warnings about cached_has_bits being unused
1518 (void) cached_has_bits;
1519
1520 _impl_.processes_.Clear();
1521 _impl_.collection_end_timestamp_ = ::uint64_t{0u};
1522 _impl_._has_bits_.Clear();
1523 _internal_metadata_.Clear<std::string>();
1524 }
1525
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1526 const char* ProcessStats::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1527 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1528 _Internal::HasBits has_bits{};
1529 while (!ctx->Done(&ptr)) {
1530 ::uint32_t tag;
1531 ptr = ::_pbi::ReadTag(ptr, &tag);
1532 switch (tag >> 3) {
1533 // repeated .perfetto.protos.ProcessStats.Process processes = 1;
1534 case 1:
1535 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
1536 ptr -= 1;
1537 do {
1538 ptr += 1;
1539 ptr = ctx->ParseMessage(_internal_add_processes(), ptr);
1540 CHK_(ptr);
1541 if (!ctx->DataAvailable(ptr)) break;
1542 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
1543 } else {
1544 goto handle_unusual;
1545 }
1546 continue;
1547 // optional uint64 collection_end_timestamp = 2;
1548 case 2:
1549 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
1550 _Internal::set_has_collection_end_timestamp(&has_bits);
1551 _impl_.collection_end_timestamp_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1552 CHK_(ptr);
1553 } else {
1554 goto handle_unusual;
1555 }
1556 continue;
1557 default:
1558 goto handle_unusual;
1559 } // switch
1560 handle_unusual:
1561 if ((tag == 0) || ((tag & 7) == 4)) {
1562 CHK_(ptr);
1563 ctx->SetLastTag(tag);
1564 goto message_done;
1565 }
1566 ptr = UnknownFieldParse(
1567 tag,
1568 _internal_metadata_.mutable_unknown_fields<std::string>(),
1569 ptr, ctx);
1570 CHK_(ptr != nullptr);
1571 } // while
1572 message_done:
1573 _impl_._has_bits_.Or(has_bits);
1574 return ptr;
1575 failure:
1576 ptr = nullptr;
1577 goto message_done;
1578 #undef CHK_
1579 }
1580
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1581 ::uint8_t* ProcessStats::_InternalSerialize(
1582 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1583 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ProcessStats)
1584 ::uint32_t cached_has_bits = 0;
1585 (void) cached_has_bits;
1586
1587 // repeated .perfetto.protos.ProcessStats.Process processes = 1;
1588 for (unsigned i = 0,
1589 n = static_cast<unsigned>(this->_internal_processes_size()); i < n; i++) {
1590 const auto& repfield = this->_internal_processes(i);
1591 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1592 InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
1593 }
1594
1595 cached_has_bits = _impl_._has_bits_[0];
1596 // optional uint64 collection_end_timestamp = 2;
1597 if (cached_has_bits & 0x00000001u) {
1598 target = stream->EnsureSpace(target);
1599 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(2, this->_internal_collection_end_timestamp(), target);
1600 }
1601
1602 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1603 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1604 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1605 }
1606 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ProcessStats)
1607 return target;
1608 }
1609
ByteSizeLong() const1610 size_t ProcessStats::ByteSizeLong() const {
1611 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ProcessStats)
1612 size_t total_size = 0;
1613
1614 ::uint32_t cached_has_bits = 0;
1615 // Prevent compiler warnings about cached_has_bits being unused
1616 (void) cached_has_bits;
1617
1618 // repeated .perfetto.protos.ProcessStats.Process processes = 1;
1619 total_size += 1UL * this->_internal_processes_size();
1620 for (const auto& msg : this->_impl_.processes_) {
1621 total_size +=
1622 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1623 }
1624
1625 // optional uint64 collection_end_timestamp = 2;
1626 cached_has_bits = _impl_._has_bits_[0];
1627 if (cached_has_bits & 0x00000001u) {
1628 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_collection_end_timestamp());
1629 }
1630
1631 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1632 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1633 }
1634 int cached_size = ::_pbi::ToCachedSize(total_size);
1635 SetCachedSize(cached_size);
1636 return total_size;
1637 }
1638
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1639 void ProcessStats::CheckTypeAndMergeFrom(
1640 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1641 MergeFrom(*::_pbi::DownCast<const ProcessStats*>(
1642 &from));
1643 }
1644
MergeFrom(const ProcessStats & from)1645 void ProcessStats::MergeFrom(const ProcessStats& from) {
1646 ProcessStats* const _this = this;
1647 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ProcessStats)
1648 GOOGLE_DCHECK_NE(&from, _this);
1649 ::uint32_t cached_has_bits = 0;
1650 (void) cached_has_bits;
1651
1652 _this->_impl_.processes_.MergeFrom(from._impl_.processes_);
1653 if (from._internal_has_collection_end_timestamp()) {
1654 _this->_internal_set_collection_end_timestamp(from._internal_collection_end_timestamp());
1655 }
1656 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1657 }
1658
CopyFrom(const ProcessStats & from)1659 void ProcessStats::CopyFrom(const ProcessStats& from) {
1660 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ProcessStats)
1661 if (&from == this) return;
1662 Clear();
1663 MergeFrom(from);
1664 }
1665
IsInitialized() const1666 bool ProcessStats::IsInitialized() const {
1667 return true;
1668 }
1669
InternalSwap(ProcessStats * other)1670 void ProcessStats::InternalSwap(ProcessStats* other) {
1671 using std::swap;
1672 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1673 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1674 _impl_.processes_.InternalSwap(&other->_impl_.processes_);
1675 swap(_impl_.collection_end_timestamp_, other->_impl_.collection_end_timestamp_);
1676 }
1677
GetTypeName() const1678 std::string ProcessStats::GetTypeName() const {
1679 return "perfetto.protos.ProcessStats";
1680 }
1681
1682
1683 // @@protoc_insertion_point(namespace_scope)
1684 } // namespace protos
1685 } // namespace perfetto
1686 PROTOBUF_NAMESPACE_OPEN
1687 template<> PROTOBUF_NOINLINE ::perfetto::protos::ProcessStats_Thread*
CreateMaybeMessage(Arena * arena)1688 Arena::CreateMaybeMessage< ::perfetto::protos::ProcessStats_Thread >(Arena* arena) {
1689 return Arena::CreateMessageInternal< ::perfetto::protos::ProcessStats_Thread >(arena);
1690 }
1691 template<> PROTOBUF_NOINLINE ::perfetto::protos::ProcessStats_FDInfo*
CreateMaybeMessage(Arena * arena)1692 Arena::CreateMaybeMessage< ::perfetto::protos::ProcessStats_FDInfo >(Arena* arena) {
1693 return Arena::CreateMessageInternal< ::perfetto::protos::ProcessStats_FDInfo >(arena);
1694 }
1695 template<> PROTOBUF_NOINLINE ::perfetto::protos::ProcessStats_Process*
CreateMaybeMessage(Arena * arena)1696 Arena::CreateMaybeMessage< ::perfetto::protos::ProcessStats_Process >(Arena* arena) {
1697 return Arena::CreateMessageInternal< ::perfetto::protos::ProcessStats_Process >(arena);
1698 }
1699 template<> PROTOBUF_NOINLINE ::perfetto::protos::ProcessStats*
CreateMaybeMessage(Arena * arena)1700 Arena::CreateMaybeMessage< ::perfetto::protos::ProcessStats >(Arena* arena) {
1701 return Arena::CreateMessageInternal< ::perfetto::protos::ProcessStats >(arena);
1702 }
1703 PROTOBUF_NAMESPACE_CLOSE
1704
1705 // @@protoc_insertion_point(global_scope)
1706 #include <google/protobuf/port_undef.inc>
1707