1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/track_event/process_descriptor.proto
3
4 #include "protos/perfetto/trace/track_event/process_descriptor.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 {
ProcessDescriptor(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR ProcessDescriptor::ProcessDescriptor(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.cmdline_)*/{}
28 , /*decltype(_impl_.process_labels_)*/{}
29 , /*decltype(_impl_.process_name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
30 , /*decltype(_impl_.pid_)*/0
31 , /*decltype(_impl_.legacy_sort_index_)*/0
32 , /*decltype(_impl_.chrome_process_type_)*/0
33 , /*decltype(_impl_.process_priority_)*/0
34 , /*decltype(_impl_.start_timestamp_ns_)*/::int64_t{0}} {}
35 struct ProcessDescriptorDefaultTypeInternal {
ProcessDescriptorDefaultTypeInternalperfetto::protos::ProcessDescriptorDefaultTypeInternal36 PROTOBUF_CONSTEXPR ProcessDescriptorDefaultTypeInternal()
37 : _instance(::_pbi::ConstantInitialized{}) {}
~ProcessDescriptorDefaultTypeInternalperfetto::protos::ProcessDescriptorDefaultTypeInternal38 ~ProcessDescriptorDefaultTypeInternal() {}
39 union { // NOLINT(misc-non-private-member-variables-in-classes)
40 ProcessDescriptor _instance;
41 };
42 };
43 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 ProcessDescriptorDefaultTypeInternal _ProcessDescriptor_default_instance_;
44 } // namespace protos
45 } // namespace perfetto
46 namespace perfetto {
47 namespace protos {
ProcessDescriptor_ChromeProcessType_IsValid(int value)48 bool ProcessDescriptor_ChromeProcessType_IsValid(int value) {
49 switch (value) {
50 case 0:
51 case 1:
52 case 2:
53 case 3:
54 case 4:
55 case 5:
56 case 6:
57 case 7:
58 case 8:
59 return true;
60 default:
61 return false;
62 }
63 }
64
65 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> ProcessDescriptor_ChromeProcessType_strings[9] = {};
66
67 static const char ProcessDescriptor_ChromeProcessType_names[] =
68 "PROCESS_BROWSER"
69 "PROCESS_GPU"
70 "PROCESS_PPAPI_BROKER"
71 "PROCESS_PPAPI_PLUGIN"
72 "PROCESS_RENDERER"
73 "PROCESS_SANDBOX_HELPER"
74 "PROCESS_UNSPECIFIED"
75 "PROCESS_UTILITY"
76 "PROCESS_ZYGOTE";
77
78 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry ProcessDescriptor_ChromeProcessType_entries[] = {
79 { {ProcessDescriptor_ChromeProcessType_names + 0, 15}, 1 },
80 { {ProcessDescriptor_ChromeProcessType_names + 15, 11}, 6 },
81 { {ProcessDescriptor_ChromeProcessType_names + 26, 20}, 8 },
82 { {ProcessDescriptor_ChromeProcessType_names + 46, 20}, 7 },
83 { {ProcessDescriptor_ChromeProcessType_names + 66, 16}, 2 },
84 { {ProcessDescriptor_ChromeProcessType_names + 82, 22}, 5 },
85 { {ProcessDescriptor_ChromeProcessType_names + 104, 19}, 0 },
86 { {ProcessDescriptor_ChromeProcessType_names + 123, 15}, 3 },
87 { {ProcessDescriptor_ChromeProcessType_names + 138, 14}, 4 },
88 };
89
90 static const int ProcessDescriptor_ChromeProcessType_entries_by_number[] = {
91 6, // 0 -> PROCESS_UNSPECIFIED
92 0, // 1 -> PROCESS_BROWSER
93 4, // 2 -> PROCESS_RENDERER
94 7, // 3 -> PROCESS_UTILITY
95 8, // 4 -> PROCESS_ZYGOTE
96 5, // 5 -> PROCESS_SANDBOX_HELPER
97 1, // 6 -> PROCESS_GPU
98 3, // 7 -> PROCESS_PPAPI_PLUGIN
99 2, // 8 -> PROCESS_PPAPI_BROKER
100 };
101
ProcessDescriptor_ChromeProcessType_Name(ProcessDescriptor_ChromeProcessType value)102 const std::string& ProcessDescriptor_ChromeProcessType_Name(
103 ProcessDescriptor_ChromeProcessType value) {
104 static const bool dummy =
105 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
106 ProcessDescriptor_ChromeProcessType_entries,
107 ProcessDescriptor_ChromeProcessType_entries_by_number,
108 9, ProcessDescriptor_ChromeProcessType_strings);
109 (void) dummy;
110 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
111 ProcessDescriptor_ChromeProcessType_entries,
112 ProcessDescriptor_ChromeProcessType_entries_by_number,
113 9, value);
114 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
115 ProcessDescriptor_ChromeProcessType_strings[idx].get();
116 }
ProcessDescriptor_ChromeProcessType_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,ProcessDescriptor_ChromeProcessType * value)117 bool ProcessDescriptor_ChromeProcessType_Parse(
118 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, ProcessDescriptor_ChromeProcessType* value) {
119 int int_value;
120 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
121 ProcessDescriptor_ChromeProcessType_entries, 9, name, &int_value);
122 if (success) {
123 *value = static_cast<ProcessDescriptor_ChromeProcessType>(int_value);
124 }
125 return success;
126 }
127 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
128 constexpr ProcessDescriptor_ChromeProcessType ProcessDescriptor::PROCESS_UNSPECIFIED;
129 constexpr ProcessDescriptor_ChromeProcessType ProcessDescriptor::PROCESS_BROWSER;
130 constexpr ProcessDescriptor_ChromeProcessType ProcessDescriptor::PROCESS_RENDERER;
131 constexpr ProcessDescriptor_ChromeProcessType ProcessDescriptor::PROCESS_UTILITY;
132 constexpr ProcessDescriptor_ChromeProcessType ProcessDescriptor::PROCESS_ZYGOTE;
133 constexpr ProcessDescriptor_ChromeProcessType ProcessDescriptor::PROCESS_SANDBOX_HELPER;
134 constexpr ProcessDescriptor_ChromeProcessType ProcessDescriptor::PROCESS_GPU;
135 constexpr ProcessDescriptor_ChromeProcessType ProcessDescriptor::PROCESS_PPAPI_PLUGIN;
136 constexpr ProcessDescriptor_ChromeProcessType ProcessDescriptor::PROCESS_PPAPI_BROKER;
137 constexpr ProcessDescriptor_ChromeProcessType ProcessDescriptor::ChromeProcessType_MIN;
138 constexpr ProcessDescriptor_ChromeProcessType ProcessDescriptor::ChromeProcessType_MAX;
139 constexpr int ProcessDescriptor::ChromeProcessType_ARRAYSIZE;
140 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
141
142 // ===================================================================
143
144 class ProcessDescriptor::_Internal {
145 public:
146 using HasBits = decltype(std::declval<ProcessDescriptor>()._impl_._has_bits_);
set_has_pid(HasBits * has_bits)147 static void set_has_pid(HasBits* has_bits) {
148 (*has_bits)[0] |= 2u;
149 }
set_has_process_name(HasBits * has_bits)150 static void set_has_process_name(HasBits* has_bits) {
151 (*has_bits)[0] |= 1u;
152 }
set_has_process_priority(HasBits * has_bits)153 static void set_has_process_priority(HasBits* has_bits) {
154 (*has_bits)[0] |= 16u;
155 }
set_has_start_timestamp_ns(HasBits * has_bits)156 static void set_has_start_timestamp_ns(HasBits* has_bits) {
157 (*has_bits)[0] |= 32u;
158 }
set_has_chrome_process_type(HasBits * has_bits)159 static void set_has_chrome_process_type(HasBits* has_bits) {
160 (*has_bits)[0] |= 8u;
161 }
set_has_legacy_sort_index(HasBits * has_bits)162 static void set_has_legacy_sort_index(HasBits* has_bits) {
163 (*has_bits)[0] |= 4u;
164 }
165 };
166
ProcessDescriptor(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)167 ProcessDescriptor::ProcessDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena,
168 bool is_message_owned)
169 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
170 SharedCtor(arena, is_message_owned);
171 // @@protoc_insertion_point(arena_constructor:perfetto.protos.ProcessDescriptor)
172 }
ProcessDescriptor(const ProcessDescriptor & from)173 ProcessDescriptor::ProcessDescriptor(const ProcessDescriptor& from)
174 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
175 ProcessDescriptor* const _this = this; (void)_this;
176 new (&_impl_) Impl_{
177 decltype(_impl_._has_bits_){from._impl_._has_bits_}
178 , /*decltype(_impl_._cached_size_)*/{}
179 , decltype(_impl_.cmdline_){from._impl_.cmdline_}
180 , decltype(_impl_.process_labels_){from._impl_.process_labels_}
181 , decltype(_impl_.process_name_){}
182 , decltype(_impl_.pid_){}
183 , decltype(_impl_.legacy_sort_index_){}
184 , decltype(_impl_.chrome_process_type_){}
185 , decltype(_impl_.process_priority_){}
186 , decltype(_impl_.start_timestamp_ns_){}};
187
188 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
189 _impl_.process_name_.InitDefault();
190 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
191 _impl_.process_name_.Set("", GetArenaForAllocation());
192 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
193 if (from._internal_has_process_name()) {
194 _this->_impl_.process_name_.Set(from._internal_process_name(),
195 _this->GetArenaForAllocation());
196 }
197 ::memcpy(&_impl_.pid_, &from._impl_.pid_,
198 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.start_timestamp_ns_) -
199 reinterpret_cast<char*>(&_impl_.pid_)) + sizeof(_impl_.start_timestamp_ns_));
200 // @@protoc_insertion_point(copy_constructor:perfetto.protos.ProcessDescriptor)
201 }
202
SharedCtor(::_pb::Arena * arena,bool is_message_owned)203 inline void ProcessDescriptor::SharedCtor(
204 ::_pb::Arena* arena, bool is_message_owned) {
205 (void)arena;
206 (void)is_message_owned;
207 new (&_impl_) Impl_{
208 decltype(_impl_._has_bits_){}
209 , /*decltype(_impl_._cached_size_)*/{}
210 , decltype(_impl_.cmdline_){arena}
211 , decltype(_impl_.process_labels_){arena}
212 , decltype(_impl_.process_name_){}
213 , decltype(_impl_.pid_){0}
214 , decltype(_impl_.legacy_sort_index_){0}
215 , decltype(_impl_.chrome_process_type_){0}
216 , decltype(_impl_.process_priority_){0}
217 , decltype(_impl_.start_timestamp_ns_){::int64_t{0}}
218 };
219 _impl_.process_name_.InitDefault();
220 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
221 _impl_.process_name_.Set("", GetArenaForAllocation());
222 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
223 }
224
~ProcessDescriptor()225 ProcessDescriptor::~ProcessDescriptor() {
226 // @@protoc_insertion_point(destructor:perfetto.protos.ProcessDescriptor)
227 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
228 (void)arena;
229 return;
230 }
231 SharedDtor();
232 }
233
SharedDtor()234 inline void ProcessDescriptor::SharedDtor() {
235 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
236 _impl_.cmdline_.~RepeatedPtrField();
237 _impl_.process_labels_.~RepeatedPtrField();
238 _impl_.process_name_.Destroy();
239 }
240
SetCachedSize(int size) const241 void ProcessDescriptor::SetCachedSize(int size) const {
242 _impl_._cached_size_.Set(size);
243 }
244
Clear()245 void ProcessDescriptor::Clear() {
246 // @@protoc_insertion_point(message_clear_start:perfetto.protos.ProcessDescriptor)
247 ::uint32_t cached_has_bits = 0;
248 // Prevent compiler warnings about cached_has_bits being unused
249 (void) cached_has_bits;
250
251 _impl_.cmdline_.Clear();
252 _impl_.process_labels_.Clear();
253 cached_has_bits = _impl_._has_bits_[0];
254 if (cached_has_bits & 0x00000001u) {
255 _impl_.process_name_.ClearNonDefaultToEmpty();
256 }
257 if (cached_has_bits & 0x0000003eu) {
258 ::memset(&_impl_.pid_, 0, static_cast<size_t>(
259 reinterpret_cast<char*>(&_impl_.start_timestamp_ns_) -
260 reinterpret_cast<char*>(&_impl_.pid_)) + sizeof(_impl_.start_timestamp_ns_));
261 }
262 _impl_._has_bits_.Clear();
263 _internal_metadata_.Clear<std::string>();
264 }
265
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)266 const char* ProcessDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
267 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
268 _Internal::HasBits has_bits{};
269 while (!ctx->Done(&ptr)) {
270 ::uint32_t tag;
271 ptr = ::_pbi::ReadTag(ptr, &tag);
272 switch (tag >> 3) {
273 // optional int32 pid = 1;
274 case 1:
275 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
276 _Internal::set_has_pid(&has_bits);
277 _impl_.pid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
278 CHK_(ptr);
279 } else {
280 goto handle_unusual;
281 }
282 continue;
283 // repeated string cmdline = 2;
284 case 2:
285 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
286 ptr -= 1;
287 do {
288 ptr += 1;
289 auto str = _internal_add_cmdline();
290 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
291 CHK_(ptr);
292 if (!ctx->DataAvailable(ptr)) break;
293 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
294 } else {
295 goto handle_unusual;
296 }
297 continue;
298 // optional int32 legacy_sort_index = 3;
299 case 3:
300 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
301 _Internal::set_has_legacy_sort_index(&has_bits);
302 _impl_.legacy_sort_index_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
303 CHK_(ptr);
304 } else {
305 goto handle_unusual;
306 }
307 continue;
308 // optional .perfetto.protos.ProcessDescriptor.ChromeProcessType chrome_process_type = 4;
309 case 4:
310 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
311 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
312 CHK_(ptr);
313 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::ProcessDescriptor_ChromeProcessType_IsValid(val))) {
314 _internal_set_chrome_process_type(static_cast<::perfetto::protos::ProcessDescriptor_ChromeProcessType>(val));
315 } else {
316 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
317 }
318 } else {
319 goto handle_unusual;
320 }
321 continue;
322 // optional int32 process_priority = 5;
323 case 5:
324 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
325 _Internal::set_has_process_priority(&has_bits);
326 _impl_.process_priority_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
327 CHK_(ptr);
328 } else {
329 goto handle_unusual;
330 }
331 continue;
332 // optional string process_name = 6;
333 case 6:
334 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
335 auto str = _internal_mutable_process_name();
336 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
337 CHK_(ptr);
338 } else {
339 goto handle_unusual;
340 }
341 continue;
342 // optional int64 start_timestamp_ns = 7;
343 case 7:
344 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
345 _Internal::set_has_start_timestamp_ns(&has_bits);
346 _impl_.start_timestamp_ns_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
347 CHK_(ptr);
348 } else {
349 goto handle_unusual;
350 }
351 continue;
352 // repeated string process_labels = 8;
353 case 8:
354 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 66)) {
355 ptr -= 1;
356 do {
357 ptr += 1;
358 auto str = _internal_add_process_labels();
359 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
360 CHK_(ptr);
361 if (!ctx->DataAvailable(ptr)) break;
362 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<66>(ptr));
363 } else {
364 goto handle_unusual;
365 }
366 continue;
367 default:
368 goto handle_unusual;
369 } // switch
370 handle_unusual:
371 if ((tag == 0) || ((tag & 7) == 4)) {
372 CHK_(ptr);
373 ctx->SetLastTag(tag);
374 goto message_done;
375 }
376 ptr = UnknownFieldParse(
377 tag,
378 _internal_metadata_.mutable_unknown_fields<std::string>(),
379 ptr, ctx);
380 CHK_(ptr != nullptr);
381 } // while
382 message_done:
383 _impl_._has_bits_.Or(has_bits);
384 return ptr;
385 failure:
386 ptr = nullptr;
387 goto message_done;
388 #undef CHK_
389 }
390
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const391 ::uint8_t* ProcessDescriptor::_InternalSerialize(
392 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
393 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.ProcessDescriptor)
394 ::uint32_t cached_has_bits = 0;
395 (void) cached_has_bits;
396
397 cached_has_bits = _impl_._has_bits_[0];
398 // optional int32 pid = 1;
399 if (cached_has_bits & 0x00000002u) {
400 target = stream->EnsureSpace(target);
401 target = ::_pbi::WireFormatLite::WriteInt32ToArray(1, this->_internal_pid(), target);
402 }
403
404 // repeated string cmdline = 2;
405 for (int i = 0, n = this->_internal_cmdline_size(); i < n; i++) {
406 const auto& s = this->_internal_cmdline(i);
407 target = stream->WriteString(2, s, target);
408 }
409
410 // optional int32 legacy_sort_index = 3;
411 if (cached_has_bits & 0x00000004u) {
412 target = stream->EnsureSpace(target);
413 target = ::_pbi::WireFormatLite::WriteInt32ToArray(3, this->_internal_legacy_sort_index(), target);
414 }
415
416 // optional .perfetto.protos.ProcessDescriptor.ChromeProcessType chrome_process_type = 4;
417 if (cached_has_bits & 0x00000008u) {
418 target = stream->EnsureSpace(target);
419 target = ::_pbi::WireFormatLite::WriteEnumToArray(
420 4, this->_internal_chrome_process_type(), target);
421 }
422
423 // optional int32 process_priority = 5;
424 if (cached_has_bits & 0x00000010u) {
425 target = stream->EnsureSpace(target);
426 target = ::_pbi::WireFormatLite::WriteInt32ToArray(5, this->_internal_process_priority(), target);
427 }
428
429 // optional string process_name = 6;
430 if (cached_has_bits & 0x00000001u) {
431 target = stream->WriteStringMaybeAliased(
432 6, this->_internal_process_name(), target);
433 }
434
435 // optional int64 start_timestamp_ns = 7;
436 if (cached_has_bits & 0x00000020u) {
437 target = stream->EnsureSpace(target);
438 target = ::_pbi::WireFormatLite::WriteInt64ToArray(7, this->_internal_start_timestamp_ns(), target);
439 }
440
441 // repeated string process_labels = 8;
442 for (int i = 0, n = this->_internal_process_labels_size(); i < n; i++) {
443 const auto& s = this->_internal_process_labels(i);
444 target = stream->WriteString(8, s, target);
445 }
446
447 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
448 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
449 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
450 }
451 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.ProcessDescriptor)
452 return target;
453 }
454
ByteSizeLong() const455 size_t ProcessDescriptor::ByteSizeLong() const {
456 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.ProcessDescriptor)
457 size_t total_size = 0;
458
459 ::uint32_t cached_has_bits = 0;
460 // Prevent compiler warnings about cached_has_bits being unused
461 (void) cached_has_bits;
462
463 // repeated string cmdline = 2;
464 total_size += 1 *
465 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.cmdline_.size());
466 for (int i = 0, n = _impl_.cmdline_.size(); i < n; i++) {
467 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
468 _impl_.cmdline_.Get(i));
469 }
470
471 // repeated string process_labels = 8;
472 total_size += 1 *
473 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.process_labels_.size());
474 for (int i = 0, n = _impl_.process_labels_.size(); i < n; i++) {
475 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
476 _impl_.process_labels_.Get(i));
477 }
478
479 cached_has_bits = _impl_._has_bits_[0];
480 if (cached_has_bits & 0x0000003fu) {
481 // optional string process_name = 6;
482 if (cached_has_bits & 0x00000001u) {
483 total_size += 1 +
484 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
485 this->_internal_process_name());
486 }
487
488 // optional int32 pid = 1;
489 if (cached_has_bits & 0x00000002u) {
490 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_pid());
491 }
492
493 // optional int32 legacy_sort_index = 3;
494 if (cached_has_bits & 0x00000004u) {
495 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_legacy_sort_index());
496 }
497
498 // optional .perfetto.protos.ProcessDescriptor.ChromeProcessType chrome_process_type = 4;
499 if (cached_has_bits & 0x00000008u) {
500 total_size += 1 +
501 ::_pbi::WireFormatLite::EnumSize(this->_internal_chrome_process_type());
502 }
503
504 // optional int32 process_priority = 5;
505 if (cached_has_bits & 0x00000010u) {
506 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_process_priority());
507 }
508
509 // optional int64 start_timestamp_ns = 7;
510 if (cached_has_bits & 0x00000020u) {
511 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_start_timestamp_ns());
512 }
513
514 }
515 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
516 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
517 }
518 int cached_size = ::_pbi::ToCachedSize(total_size);
519 SetCachedSize(cached_size);
520 return total_size;
521 }
522
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)523 void ProcessDescriptor::CheckTypeAndMergeFrom(
524 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
525 MergeFrom(*::_pbi::DownCast<const ProcessDescriptor*>(
526 &from));
527 }
528
MergeFrom(const ProcessDescriptor & from)529 void ProcessDescriptor::MergeFrom(const ProcessDescriptor& from) {
530 ProcessDescriptor* const _this = this;
531 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.ProcessDescriptor)
532 GOOGLE_DCHECK_NE(&from, _this);
533 ::uint32_t cached_has_bits = 0;
534 (void) cached_has_bits;
535
536 _this->_impl_.cmdline_.MergeFrom(from._impl_.cmdline_);
537 _this->_impl_.process_labels_.MergeFrom(from._impl_.process_labels_);
538 cached_has_bits = from._impl_._has_bits_[0];
539 if (cached_has_bits & 0x0000003fu) {
540 if (cached_has_bits & 0x00000001u) {
541 _this->_internal_set_process_name(from._internal_process_name());
542 }
543 if (cached_has_bits & 0x00000002u) {
544 _this->_impl_.pid_ = from._impl_.pid_;
545 }
546 if (cached_has_bits & 0x00000004u) {
547 _this->_impl_.legacy_sort_index_ = from._impl_.legacy_sort_index_;
548 }
549 if (cached_has_bits & 0x00000008u) {
550 _this->_impl_.chrome_process_type_ = from._impl_.chrome_process_type_;
551 }
552 if (cached_has_bits & 0x00000010u) {
553 _this->_impl_.process_priority_ = from._impl_.process_priority_;
554 }
555 if (cached_has_bits & 0x00000020u) {
556 _this->_impl_.start_timestamp_ns_ = from._impl_.start_timestamp_ns_;
557 }
558 _this->_impl_._has_bits_[0] |= cached_has_bits;
559 }
560 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
561 }
562
CopyFrom(const ProcessDescriptor & from)563 void ProcessDescriptor::CopyFrom(const ProcessDescriptor& from) {
564 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.ProcessDescriptor)
565 if (&from == this) return;
566 Clear();
567 MergeFrom(from);
568 }
569
IsInitialized() const570 bool ProcessDescriptor::IsInitialized() const {
571 return true;
572 }
573
InternalSwap(ProcessDescriptor * other)574 void ProcessDescriptor::InternalSwap(ProcessDescriptor* other) {
575 using std::swap;
576 auto* lhs_arena = GetArenaForAllocation();
577 auto* rhs_arena = other->GetArenaForAllocation();
578 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
579 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
580 _impl_.cmdline_.InternalSwap(&other->_impl_.cmdline_);
581 _impl_.process_labels_.InternalSwap(&other->_impl_.process_labels_);
582 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
583 &_impl_.process_name_, lhs_arena,
584 &other->_impl_.process_name_, rhs_arena
585 );
586 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
587 PROTOBUF_FIELD_OFFSET(ProcessDescriptor, _impl_.start_timestamp_ns_)
588 + sizeof(ProcessDescriptor::_impl_.start_timestamp_ns_) // NOLINT
589 - PROTOBUF_FIELD_OFFSET(ProcessDescriptor, _impl_.pid_)>(
590 reinterpret_cast<char*>(&_impl_.pid_),
591 reinterpret_cast<char*>(&other->_impl_.pid_));
592 }
593
GetTypeName() const594 std::string ProcessDescriptor::GetTypeName() const {
595 return "perfetto.protos.ProcessDescriptor";
596 }
597
598
599 // @@protoc_insertion_point(namespace_scope)
600 } // namespace protos
601 } // namespace perfetto
602 PROTOBUF_NAMESPACE_OPEN
603 template<> PROTOBUF_NOINLINE ::perfetto::protos::ProcessDescriptor*
CreateMaybeMessage(Arena * arena)604 Arena::CreateMaybeMessage< ::perfetto::protos::ProcessDescriptor >(Arena* arena) {
605 return Arena::CreateMessageInternal< ::perfetto::protos::ProcessDescriptor >(arena);
606 }
607 PROTOBUF_NAMESPACE_CLOSE
608
609 // @@protoc_insertion_point(global_scope)
610 #include <google/protobuf/port_undef.inc>
611