1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/track_event/track_descriptor.proto
3
4 #include "protos/perfetto/trace/track_event/track_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 {
TrackDescriptor(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR TrackDescriptor::TrackDescriptor(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.process_)*/nullptr
28 , /*decltype(_impl_.thread_)*/nullptr
29 , /*decltype(_impl_.chrome_process_)*/nullptr
30 , /*decltype(_impl_.chrome_thread_)*/nullptr
31 , /*decltype(_impl_.counter_)*/nullptr
32 , /*decltype(_impl_.uuid_)*/::uint64_t{0u}
33 , /*decltype(_impl_.parent_uuid_)*/::uint64_t{0u}
34 , /*decltype(_impl_.disallow_merging_with_system_tracks_)*/false
35 , /*decltype(_impl_.child_ordering_)*/0
36 , /*decltype(_impl_.sibling_order_rank_)*/0
37 , /*decltype(_impl_.static_or_dynamic_name_)*/{}
38 , /*decltype(_impl_._oneof_case_)*/{}} {}
39 struct TrackDescriptorDefaultTypeInternal {
TrackDescriptorDefaultTypeInternalperfetto::protos::TrackDescriptorDefaultTypeInternal40 PROTOBUF_CONSTEXPR TrackDescriptorDefaultTypeInternal()
41 : _instance(::_pbi::ConstantInitialized{}) {}
~TrackDescriptorDefaultTypeInternalperfetto::protos::TrackDescriptorDefaultTypeInternal42 ~TrackDescriptorDefaultTypeInternal() {}
43 union { // NOLINT(misc-non-private-member-variables-in-classes)
44 TrackDescriptor _instance;
45 };
46 };
47 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TrackDescriptorDefaultTypeInternal _TrackDescriptor_default_instance_;
48 } // namespace protos
49 } // namespace perfetto
50 namespace perfetto {
51 namespace protos {
TrackDescriptor_ChildTracksOrdering_IsValid(int value)52 bool TrackDescriptor_ChildTracksOrdering_IsValid(int value) {
53 switch (value) {
54 case 0:
55 case 1:
56 case 2:
57 case 3:
58 return true;
59 default:
60 return false;
61 }
62 }
63
64 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> TrackDescriptor_ChildTracksOrdering_strings[4] = {};
65
66 static const char TrackDescriptor_ChildTracksOrdering_names[] =
67 "CHRONOLOGICAL"
68 "EXPLICIT"
69 "LEXICOGRAPHIC"
70 "UNKNOWN";
71
72 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry TrackDescriptor_ChildTracksOrdering_entries[] = {
73 { {TrackDescriptor_ChildTracksOrdering_names + 0, 13}, 2 },
74 { {TrackDescriptor_ChildTracksOrdering_names + 13, 8}, 3 },
75 { {TrackDescriptor_ChildTracksOrdering_names + 21, 13}, 1 },
76 { {TrackDescriptor_ChildTracksOrdering_names + 34, 7}, 0 },
77 };
78
79 static const int TrackDescriptor_ChildTracksOrdering_entries_by_number[] = {
80 3, // 0 -> UNKNOWN
81 2, // 1 -> LEXICOGRAPHIC
82 0, // 2 -> CHRONOLOGICAL
83 1, // 3 -> EXPLICIT
84 };
85
TrackDescriptor_ChildTracksOrdering_Name(TrackDescriptor_ChildTracksOrdering value)86 const std::string& TrackDescriptor_ChildTracksOrdering_Name(
87 TrackDescriptor_ChildTracksOrdering value) {
88 static const bool dummy =
89 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
90 TrackDescriptor_ChildTracksOrdering_entries,
91 TrackDescriptor_ChildTracksOrdering_entries_by_number,
92 4, TrackDescriptor_ChildTracksOrdering_strings);
93 (void) dummy;
94 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
95 TrackDescriptor_ChildTracksOrdering_entries,
96 TrackDescriptor_ChildTracksOrdering_entries_by_number,
97 4, value);
98 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
99 TrackDescriptor_ChildTracksOrdering_strings[idx].get();
100 }
TrackDescriptor_ChildTracksOrdering_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,TrackDescriptor_ChildTracksOrdering * value)101 bool TrackDescriptor_ChildTracksOrdering_Parse(
102 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TrackDescriptor_ChildTracksOrdering* value) {
103 int int_value;
104 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
105 TrackDescriptor_ChildTracksOrdering_entries, 4, name, &int_value);
106 if (success) {
107 *value = static_cast<TrackDescriptor_ChildTracksOrdering>(int_value);
108 }
109 return success;
110 }
111 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
112 constexpr TrackDescriptor_ChildTracksOrdering TrackDescriptor::UNKNOWN;
113 constexpr TrackDescriptor_ChildTracksOrdering TrackDescriptor::LEXICOGRAPHIC;
114 constexpr TrackDescriptor_ChildTracksOrdering TrackDescriptor::CHRONOLOGICAL;
115 constexpr TrackDescriptor_ChildTracksOrdering TrackDescriptor::EXPLICIT;
116 constexpr TrackDescriptor_ChildTracksOrdering TrackDescriptor::ChildTracksOrdering_MIN;
117 constexpr TrackDescriptor_ChildTracksOrdering TrackDescriptor::ChildTracksOrdering_MAX;
118 constexpr int TrackDescriptor::ChildTracksOrdering_ARRAYSIZE;
119 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
120
121 // ===================================================================
122
123 class TrackDescriptor::_Internal {
124 public:
125 using HasBits = decltype(std::declval<TrackDescriptor>()._impl_._has_bits_);
set_has_uuid(HasBits * has_bits)126 static void set_has_uuid(HasBits* has_bits) {
127 (*has_bits)[0] |= 32u;
128 }
set_has_parent_uuid(HasBits * has_bits)129 static void set_has_parent_uuid(HasBits* has_bits) {
130 (*has_bits)[0] |= 64u;
131 }
132 static const ::perfetto::protos::ProcessDescriptor& process(const TrackDescriptor* msg);
set_has_process(HasBits * has_bits)133 static void set_has_process(HasBits* has_bits) {
134 (*has_bits)[0] |= 1u;
135 }
136 static const ::perfetto::protos::ChromeProcessDescriptor& chrome_process(const TrackDescriptor* msg);
set_has_chrome_process(HasBits * has_bits)137 static void set_has_chrome_process(HasBits* has_bits) {
138 (*has_bits)[0] |= 4u;
139 }
140 static const ::perfetto::protos::ThreadDescriptor& thread(const TrackDescriptor* msg);
set_has_thread(HasBits * has_bits)141 static void set_has_thread(HasBits* has_bits) {
142 (*has_bits)[0] |= 2u;
143 }
144 static const ::perfetto::protos::ChromeThreadDescriptor& chrome_thread(const TrackDescriptor* msg);
set_has_chrome_thread(HasBits * has_bits)145 static void set_has_chrome_thread(HasBits* has_bits) {
146 (*has_bits)[0] |= 8u;
147 }
148 static const ::perfetto::protos::CounterDescriptor& counter(const TrackDescriptor* msg);
set_has_counter(HasBits * has_bits)149 static void set_has_counter(HasBits* has_bits) {
150 (*has_bits)[0] |= 16u;
151 }
set_has_disallow_merging_with_system_tracks(HasBits * has_bits)152 static void set_has_disallow_merging_with_system_tracks(HasBits* has_bits) {
153 (*has_bits)[0] |= 128u;
154 }
set_has_child_ordering(HasBits * has_bits)155 static void set_has_child_ordering(HasBits* has_bits) {
156 (*has_bits)[0] |= 256u;
157 }
set_has_sibling_order_rank(HasBits * has_bits)158 static void set_has_sibling_order_rank(HasBits* has_bits) {
159 (*has_bits)[0] |= 512u;
160 }
161 };
162
163 const ::perfetto::protos::ProcessDescriptor&
process(const TrackDescriptor * msg)164 TrackDescriptor::_Internal::process(const TrackDescriptor* msg) {
165 return *msg->_impl_.process_;
166 }
167 const ::perfetto::protos::ChromeProcessDescriptor&
chrome_process(const TrackDescriptor * msg)168 TrackDescriptor::_Internal::chrome_process(const TrackDescriptor* msg) {
169 return *msg->_impl_.chrome_process_;
170 }
171 const ::perfetto::protos::ThreadDescriptor&
thread(const TrackDescriptor * msg)172 TrackDescriptor::_Internal::thread(const TrackDescriptor* msg) {
173 return *msg->_impl_.thread_;
174 }
175 const ::perfetto::protos::ChromeThreadDescriptor&
chrome_thread(const TrackDescriptor * msg)176 TrackDescriptor::_Internal::chrome_thread(const TrackDescriptor* msg) {
177 return *msg->_impl_.chrome_thread_;
178 }
179 const ::perfetto::protos::CounterDescriptor&
counter(const TrackDescriptor * msg)180 TrackDescriptor::_Internal::counter(const TrackDescriptor* msg) {
181 return *msg->_impl_.counter_;
182 }
clear_process()183 void TrackDescriptor::clear_process() {
184 if (_impl_.process_ != nullptr) _impl_.process_->Clear();
185 _impl_._has_bits_[0] &= ~0x00000001u;
186 }
clear_chrome_process()187 void TrackDescriptor::clear_chrome_process() {
188 if (_impl_.chrome_process_ != nullptr) _impl_.chrome_process_->Clear();
189 _impl_._has_bits_[0] &= ~0x00000004u;
190 }
clear_thread()191 void TrackDescriptor::clear_thread() {
192 if (_impl_.thread_ != nullptr) _impl_.thread_->Clear();
193 _impl_._has_bits_[0] &= ~0x00000002u;
194 }
clear_chrome_thread()195 void TrackDescriptor::clear_chrome_thread() {
196 if (_impl_.chrome_thread_ != nullptr) _impl_.chrome_thread_->Clear();
197 _impl_._has_bits_[0] &= ~0x00000008u;
198 }
clear_counter()199 void TrackDescriptor::clear_counter() {
200 if (_impl_.counter_ != nullptr) _impl_.counter_->Clear();
201 _impl_._has_bits_[0] &= ~0x00000010u;
202 }
TrackDescriptor(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)203 TrackDescriptor::TrackDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena,
204 bool is_message_owned)
205 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
206 SharedCtor(arena, is_message_owned);
207 // @@protoc_insertion_point(arena_constructor:perfetto.protos.TrackDescriptor)
208 }
TrackDescriptor(const TrackDescriptor & from)209 TrackDescriptor::TrackDescriptor(const TrackDescriptor& from)
210 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
211 TrackDescriptor* const _this = this; (void)_this;
212 new (&_impl_) Impl_{
213 decltype(_impl_._has_bits_){from._impl_._has_bits_}
214 , /*decltype(_impl_._cached_size_)*/{}
215 , decltype(_impl_.process_){nullptr}
216 , decltype(_impl_.thread_){nullptr}
217 , decltype(_impl_.chrome_process_){nullptr}
218 , decltype(_impl_.chrome_thread_){nullptr}
219 , decltype(_impl_.counter_){nullptr}
220 , decltype(_impl_.uuid_){}
221 , decltype(_impl_.parent_uuid_){}
222 , decltype(_impl_.disallow_merging_with_system_tracks_){}
223 , decltype(_impl_.child_ordering_){}
224 , decltype(_impl_.sibling_order_rank_){}
225 , decltype(_impl_.static_or_dynamic_name_){}
226 , /*decltype(_impl_._oneof_case_)*/{}};
227
228 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
229 if (from._internal_has_process()) {
230 _this->_impl_.process_ = new ::perfetto::protos::ProcessDescriptor(*from._impl_.process_);
231 }
232 if (from._internal_has_thread()) {
233 _this->_impl_.thread_ = new ::perfetto::protos::ThreadDescriptor(*from._impl_.thread_);
234 }
235 if (from._internal_has_chrome_process()) {
236 _this->_impl_.chrome_process_ = new ::perfetto::protos::ChromeProcessDescriptor(*from._impl_.chrome_process_);
237 }
238 if (from._internal_has_chrome_thread()) {
239 _this->_impl_.chrome_thread_ = new ::perfetto::protos::ChromeThreadDescriptor(*from._impl_.chrome_thread_);
240 }
241 if (from._internal_has_counter()) {
242 _this->_impl_.counter_ = new ::perfetto::protos::CounterDescriptor(*from._impl_.counter_);
243 }
244 ::memcpy(&_impl_.uuid_, &from._impl_.uuid_,
245 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.sibling_order_rank_) -
246 reinterpret_cast<char*>(&_impl_.uuid_)) + sizeof(_impl_.sibling_order_rank_));
247 clear_has_static_or_dynamic_name();
248 switch (from.static_or_dynamic_name_case()) {
249 case kName: {
250 _this->_internal_set_name(from._internal_name());
251 break;
252 }
253 case kStaticName: {
254 _this->_internal_set_static_name(from._internal_static_name());
255 break;
256 }
257 case kAtraceName: {
258 _this->_internal_set_atrace_name(from._internal_atrace_name());
259 break;
260 }
261 case STATIC_OR_DYNAMIC_NAME_NOT_SET: {
262 break;
263 }
264 }
265 // @@protoc_insertion_point(copy_constructor:perfetto.protos.TrackDescriptor)
266 }
267
SharedCtor(::_pb::Arena * arena,bool is_message_owned)268 inline void TrackDescriptor::SharedCtor(
269 ::_pb::Arena* arena, bool is_message_owned) {
270 (void)arena;
271 (void)is_message_owned;
272 new (&_impl_) Impl_{
273 decltype(_impl_._has_bits_){}
274 , /*decltype(_impl_._cached_size_)*/{}
275 , decltype(_impl_.process_){nullptr}
276 , decltype(_impl_.thread_){nullptr}
277 , decltype(_impl_.chrome_process_){nullptr}
278 , decltype(_impl_.chrome_thread_){nullptr}
279 , decltype(_impl_.counter_){nullptr}
280 , decltype(_impl_.uuid_){::uint64_t{0u}}
281 , decltype(_impl_.parent_uuid_){::uint64_t{0u}}
282 , decltype(_impl_.disallow_merging_with_system_tracks_){false}
283 , decltype(_impl_.child_ordering_){0}
284 , decltype(_impl_.sibling_order_rank_){0}
285 , decltype(_impl_.static_or_dynamic_name_){}
286 , /*decltype(_impl_._oneof_case_)*/{}
287 };
288 clear_has_static_or_dynamic_name();
289 }
290
~TrackDescriptor()291 TrackDescriptor::~TrackDescriptor() {
292 // @@protoc_insertion_point(destructor:perfetto.protos.TrackDescriptor)
293 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
294 (void)arena;
295 return;
296 }
297 SharedDtor();
298 }
299
SharedDtor()300 inline void TrackDescriptor::SharedDtor() {
301 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
302 if (this != internal_default_instance()) delete _impl_.process_;
303 if (this != internal_default_instance()) delete _impl_.thread_;
304 if (this != internal_default_instance()) delete _impl_.chrome_process_;
305 if (this != internal_default_instance()) delete _impl_.chrome_thread_;
306 if (this != internal_default_instance()) delete _impl_.counter_;
307 if (has_static_or_dynamic_name()) {
308 clear_static_or_dynamic_name();
309 }
310 }
311
SetCachedSize(int size) const312 void TrackDescriptor::SetCachedSize(int size) const {
313 _impl_._cached_size_.Set(size);
314 }
315
clear_static_or_dynamic_name()316 void TrackDescriptor::clear_static_or_dynamic_name() {
317 // @@protoc_insertion_point(one_of_clear_start:perfetto.protos.TrackDescriptor)
318 switch (static_or_dynamic_name_case()) {
319 case kName: {
320 _impl_.static_or_dynamic_name_.name_.Destroy();
321 break;
322 }
323 case kStaticName: {
324 _impl_.static_or_dynamic_name_.static_name_.Destroy();
325 break;
326 }
327 case kAtraceName: {
328 _impl_.static_or_dynamic_name_.atrace_name_.Destroy();
329 break;
330 }
331 case STATIC_OR_DYNAMIC_NAME_NOT_SET: {
332 break;
333 }
334 }
335 _impl_._oneof_case_[0] = STATIC_OR_DYNAMIC_NAME_NOT_SET;
336 }
337
338
Clear()339 void TrackDescriptor::Clear() {
340 // @@protoc_insertion_point(message_clear_start:perfetto.protos.TrackDescriptor)
341 ::uint32_t cached_has_bits = 0;
342 // Prevent compiler warnings about cached_has_bits being unused
343 (void) cached_has_bits;
344
345 cached_has_bits = _impl_._has_bits_[0];
346 if (cached_has_bits & 0x0000001fu) {
347 if (cached_has_bits & 0x00000001u) {
348 GOOGLE_DCHECK(_impl_.process_ != nullptr);
349 _impl_.process_->Clear();
350 }
351 if (cached_has_bits & 0x00000002u) {
352 GOOGLE_DCHECK(_impl_.thread_ != nullptr);
353 _impl_.thread_->Clear();
354 }
355 if (cached_has_bits & 0x00000004u) {
356 GOOGLE_DCHECK(_impl_.chrome_process_ != nullptr);
357 _impl_.chrome_process_->Clear();
358 }
359 if (cached_has_bits & 0x00000008u) {
360 GOOGLE_DCHECK(_impl_.chrome_thread_ != nullptr);
361 _impl_.chrome_thread_->Clear();
362 }
363 if (cached_has_bits & 0x00000010u) {
364 GOOGLE_DCHECK(_impl_.counter_ != nullptr);
365 _impl_.counter_->Clear();
366 }
367 }
368 if (cached_has_bits & 0x000000e0u) {
369 ::memset(&_impl_.uuid_, 0, static_cast<size_t>(
370 reinterpret_cast<char*>(&_impl_.disallow_merging_with_system_tracks_) -
371 reinterpret_cast<char*>(&_impl_.uuid_)) + sizeof(_impl_.disallow_merging_with_system_tracks_));
372 }
373 if (cached_has_bits & 0x00000300u) {
374 ::memset(&_impl_.child_ordering_, 0, static_cast<size_t>(
375 reinterpret_cast<char*>(&_impl_.sibling_order_rank_) -
376 reinterpret_cast<char*>(&_impl_.child_ordering_)) + sizeof(_impl_.sibling_order_rank_));
377 }
378 clear_static_or_dynamic_name();
379 _impl_._has_bits_.Clear();
380 _internal_metadata_.Clear<std::string>();
381 }
382
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)383 const char* TrackDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
384 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
385 _Internal::HasBits has_bits{};
386 while (!ctx->Done(&ptr)) {
387 ::uint32_t tag;
388 ptr = ::_pbi::ReadTag(ptr, &tag);
389 switch (tag >> 3) {
390 // optional uint64 uuid = 1;
391 case 1:
392 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
393 _Internal::set_has_uuid(&has_bits);
394 _impl_.uuid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
395 CHK_(ptr);
396 } else {
397 goto handle_unusual;
398 }
399 continue;
400 // string name = 2;
401 case 2:
402 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
403 auto str = _internal_mutable_name();
404 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
405 CHK_(ptr);
406 } else {
407 goto handle_unusual;
408 }
409 continue;
410 // optional .perfetto.protos.ProcessDescriptor process = 3;
411 case 3:
412 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
413 ptr = ctx->ParseMessage(_internal_mutable_process(), ptr);
414 CHK_(ptr);
415 } else {
416 goto handle_unusual;
417 }
418 continue;
419 // optional .perfetto.protos.ThreadDescriptor thread = 4;
420 case 4:
421 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
422 ptr = ctx->ParseMessage(_internal_mutable_thread(), ptr);
423 CHK_(ptr);
424 } else {
425 goto handle_unusual;
426 }
427 continue;
428 // optional uint64 parent_uuid = 5;
429 case 5:
430 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
431 _Internal::set_has_parent_uuid(&has_bits);
432 _impl_.parent_uuid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
433 CHK_(ptr);
434 } else {
435 goto handle_unusual;
436 }
437 continue;
438 // optional .perfetto.protos.ChromeProcessDescriptor chrome_process = 6;
439 case 6:
440 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
441 ptr = ctx->ParseMessage(_internal_mutable_chrome_process(), ptr);
442 CHK_(ptr);
443 } else {
444 goto handle_unusual;
445 }
446 continue;
447 // optional .perfetto.protos.ChromeThreadDescriptor chrome_thread = 7;
448 case 7:
449 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
450 ptr = ctx->ParseMessage(_internal_mutable_chrome_thread(), ptr);
451 CHK_(ptr);
452 } else {
453 goto handle_unusual;
454 }
455 continue;
456 // optional .perfetto.protos.CounterDescriptor counter = 8;
457 case 8:
458 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 66)) {
459 ptr = ctx->ParseMessage(_internal_mutable_counter(), ptr);
460 CHK_(ptr);
461 } else {
462 goto handle_unusual;
463 }
464 continue;
465 // optional bool disallow_merging_with_system_tracks = 9;
466 case 9:
467 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
468 _Internal::set_has_disallow_merging_with_system_tracks(&has_bits);
469 _impl_.disallow_merging_with_system_tracks_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
470 CHK_(ptr);
471 } else {
472 goto handle_unusual;
473 }
474 continue;
475 // string static_name = 10;
476 case 10:
477 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 82)) {
478 auto str = _internal_mutable_static_name();
479 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
480 CHK_(ptr);
481 } else {
482 goto handle_unusual;
483 }
484 continue;
485 // optional .perfetto.protos.TrackDescriptor.ChildTracksOrdering child_ordering = 11;
486 case 11:
487 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
488 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
489 CHK_(ptr);
490 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::TrackDescriptor_ChildTracksOrdering_IsValid(val))) {
491 _internal_set_child_ordering(static_cast<::perfetto::protos::TrackDescriptor_ChildTracksOrdering>(val));
492 } else {
493 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(11, val, mutable_unknown_fields());
494 }
495 } else {
496 goto handle_unusual;
497 }
498 continue;
499 // optional int32 sibling_order_rank = 12;
500 case 12:
501 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 96)) {
502 _Internal::set_has_sibling_order_rank(&has_bits);
503 _impl_.sibling_order_rank_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
504 CHK_(ptr);
505 } else {
506 goto handle_unusual;
507 }
508 continue;
509 // string atrace_name = 13;
510 case 13:
511 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 106)) {
512 auto str = _internal_mutable_atrace_name();
513 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
514 CHK_(ptr);
515 } else {
516 goto handle_unusual;
517 }
518 continue;
519 default:
520 goto handle_unusual;
521 } // switch
522 handle_unusual:
523 if ((tag == 0) || ((tag & 7) == 4)) {
524 CHK_(ptr);
525 ctx->SetLastTag(tag);
526 goto message_done;
527 }
528 ptr = UnknownFieldParse(
529 tag,
530 _internal_metadata_.mutable_unknown_fields<std::string>(),
531 ptr, ctx);
532 CHK_(ptr != nullptr);
533 } // while
534 message_done:
535 _impl_._has_bits_.Or(has_bits);
536 return ptr;
537 failure:
538 ptr = nullptr;
539 goto message_done;
540 #undef CHK_
541 }
542
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const543 ::uint8_t* TrackDescriptor::_InternalSerialize(
544 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
545 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TrackDescriptor)
546 ::uint32_t cached_has_bits = 0;
547 (void) cached_has_bits;
548
549 cached_has_bits = _impl_._has_bits_[0];
550 // optional uint64 uuid = 1;
551 if (cached_has_bits & 0x00000020u) {
552 target = stream->EnsureSpace(target);
553 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_uuid(), target);
554 }
555
556 // string name = 2;
557 if (_internal_has_name()) {
558 target = stream->WriteStringMaybeAliased(
559 2, this->_internal_name(), target);
560 }
561
562 // optional .perfetto.protos.ProcessDescriptor process = 3;
563 if (cached_has_bits & 0x00000001u) {
564 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
565 InternalWriteMessage(3, _Internal::process(this),
566 _Internal::process(this).GetCachedSize(), target, stream);
567 }
568
569 // optional .perfetto.protos.ThreadDescriptor thread = 4;
570 if (cached_has_bits & 0x00000002u) {
571 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
572 InternalWriteMessage(4, _Internal::thread(this),
573 _Internal::thread(this).GetCachedSize(), target, stream);
574 }
575
576 // optional uint64 parent_uuid = 5;
577 if (cached_has_bits & 0x00000040u) {
578 target = stream->EnsureSpace(target);
579 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_parent_uuid(), target);
580 }
581
582 // optional .perfetto.protos.ChromeProcessDescriptor chrome_process = 6;
583 if (cached_has_bits & 0x00000004u) {
584 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
585 InternalWriteMessage(6, _Internal::chrome_process(this),
586 _Internal::chrome_process(this).GetCachedSize(), target, stream);
587 }
588
589 // optional .perfetto.protos.ChromeThreadDescriptor chrome_thread = 7;
590 if (cached_has_bits & 0x00000008u) {
591 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
592 InternalWriteMessage(7, _Internal::chrome_thread(this),
593 _Internal::chrome_thread(this).GetCachedSize(), target, stream);
594 }
595
596 // optional .perfetto.protos.CounterDescriptor counter = 8;
597 if (cached_has_bits & 0x00000010u) {
598 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
599 InternalWriteMessage(8, _Internal::counter(this),
600 _Internal::counter(this).GetCachedSize(), target, stream);
601 }
602
603 // optional bool disallow_merging_with_system_tracks = 9;
604 if (cached_has_bits & 0x00000080u) {
605 target = stream->EnsureSpace(target);
606 target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_disallow_merging_with_system_tracks(), target);
607 }
608
609 // string static_name = 10;
610 if (_internal_has_static_name()) {
611 target = stream->WriteStringMaybeAliased(
612 10, this->_internal_static_name(), target);
613 }
614
615 // optional .perfetto.protos.TrackDescriptor.ChildTracksOrdering child_ordering = 11;
616 if (cached_has_bits & 0x00000100u) {
617 target = stream->EnsureSpace(target);
618 target = ::_pbi::WireFormatLite::WriteEnumToArray(
619 11, this->_internal_child_ordering(), target);
620 }
621
622 // optional int32 sibling_order_rank = 12;
623 if (cached_has_bits & 0x00000200u) {
624 target = stream->EnsureSpace(target);
625 target = ::_pbi::WireFormatLite::WriteInt32ToArray(12, this->_internal_sibling_order_rank(), target);
626 }
627
628 // string atrace_name = 13;
629 if (_internal_has_atrace_name()) {
630 target = stream->WriteStringMaybeAliased(
631 13, this->_internal_atrace_name(), target);
632 }
633
634 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
635 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
636 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
637 }
638 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TrackDescriptor)
639 return target;
640 }
641
ByteSizeLong() const642 size_t TrackDescriptor::ByteSizeLong() const {
643 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TrackDescriptor)
644 size_t total_size = 0;
645
646 ::uint32_t cached_has_bits = 0;
647 // Prevent compiler warnings about cached_has_bits being unused
648 (void) cached_has_bits;
649
650 cached_has_bits = _impl_._has_bits_[0];
651 if (cached_has_bits & 0x000000ffu) {
652 // optional .perfetto.protos.ProcessDescriptor process = 3;
653 if (cached_has_bits & 0x00000001u) {
654 total_size += 1 +
655 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
656 *_impl_.process_);
657 }
658
659 // optional .perfetto.protos.ThreadDescriptor thread = 4;
660 if (cached_has_bits & 0x00000002u) {
661 total_size += 1 +
662 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
663 *_impl_.thread_);
664 }
665
666 // optional .perfetto.protos.ChromeProcessDescriptor chrome_process = 6;
667 if (cached_has_bits & 0x00000004u) {
668 total_size += 1 +
669 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
670 *_impl_.chrome_process_);
671 }
672
673 // optional .perfetto.protos.ChromeThreadDescriptor chrome_thread = 7;
674 if (cached_has_bits & 0x00000008u) {
675 total_size += 1 +
676 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
677 *_impl_.chrome_thread_);
678 }
679
680 // optional .perfetto.protos.CounterDescriptor counter = 8;
681 if (cached_has_bits & 0x00000010u) {
682 total_size += 1 +
683 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
684 *_impl_.counter_);
685 }
686
687 // optional uint64 uuid = 1;
688 if (cached_has_bits & 0x00000020u) {
689 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_uuid());
690 }
691
692 // optional uint64 parent_uuid = 5;
693 if (cached_has_bits & 0x00000040u) {
694 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_parent_uuid());
695 }
696
697 // optional bool disallow_merging_with_system_tracks = 9;
698 if (cached_has_bits & 0x00000080u) {
699 total_size += 1 + 1;
700 }
701
702 }
703 if (cached_has_bits & 0x00000300u) {
704 // optional .perfetto.protos.TrackDescriptor.ChildTracksOrdering child_ordering = 11;
705 if (cached_has_bits & 0x00000100u) {
706 total_size += 1 +
707 ::_pbi::WireFormatLite::EnumSize(this->_internal_child_ordering());
708 }
709
710 // optional int32 sibling_order_rank = 12;
711 if (cached_has_bits & 0x00000200u) {
712 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_sibling_order_rank());
713 }
714
715 }
716 switch (static_or_dynamic_name_case()) {
717 // string name = 2;
718 case kName: {
719 total_size += 1 +
720 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
721 this->_internal_name());
722 break;
723 }
724 // string static_name = 10;
725 case kStaticName: {
726 total_size += 1 +
727 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
728 this->_internal_static_name());
729 break;
730 }
731 // string atrace_name = 13;
732 case kAtraceName: {
733 total_size += 1 +
734 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
735 this->_internal_atrace_name());
736 break;
737 }
738 case STATIC_OR_DYNAMIC_NAME_NOT_SET: {
739 break;
740 }
741 }
742 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
743 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
744 }
745 int cached_size = ::_pbi::ToCachedSize(total_size);
746 SetCachedSize(cached_size);
747 return total_size;
748 }
749
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)750 void TrackDescriptor::CheckTypeAndMergeFrom(
751 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
752 MergeFrom(*::_pbi::DownCast<const TrackDescriptor*>(
753 &from));
754 }
755
MergeFrom(const TrackDescriptor & from)756 void TrackDescriptor::MergeFrom(const TrackDescriptor& from) {
757 TrackDescriptor* const _this = this;
758 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TrackDescriptor)
759 GOOGLE_DCHECK_NE(&from, _this);
760 ::uint32_t cached_has_bits = 0;
761 (void) cached_has_bits;
762
763 cached_has_bits = from._impl_._has_bits_[0];
764 if (cached_has_bits & 0x000000ffu) {
765 if (cached_has_bits & 0x00000001u) {
766 _this->_internal_mutable_process()->::perfetto::protos::ProcessDescriptor::MergeFrom(
767 from._internal_process());
768 }
769 if (cached_has_bits & 0x00000002u) {
770 _this->_internal_mutable_thread()->::perfetto::protos::ThreadDescriptor::MergeFrom(
771 from._internal_thread());
772 }
773 if (cached_has_bits & 0x00000004u) {
774 _this->_internal_mutable_chrome_process()->::perfetto::protos::ChromeProcessDescriptor::MergeFrom(
775 from._internal_chrome_process());
776 }
777 if (cached_has_bits & 0x00000008u) {
778 _this->_internal_mutable_chrome_thread()->::perfetto::protos::ChromeThreadDescriptor::MergeFrom(
779 from._internal_chrome_thread());
780 }
781 if (cached_has_bits & 0x00000010u) {
782 _this->_internal_mutable_counter()->::perfetto::protos::CounterDescriptor::MergeFrom(
783 from._internal_counter());
784 }
785 if (cached_has_bits & 0x00000020u) {
786 _this->_impl_.uuid_ = from._impl_.uuid_;
787 }
788 if (cached_has_bits & 0x00000040u) {
789 _this->_impl_.parent_uuid_ = from._impl_.parent_uuid_;
790 }
791 if (cached_has_bits & 0x00000080u) {
792 _this->_impl_.disallow_merging_with_system_tracks_ = from._impl_.disallow_merging_with_system_tracks_;
793 }
794 _this->_impl_._has_bits_[0] |= cached_has_bits;
795 }
796 if (cached_has_bits & 0x00000300u) {
797 if (cached_has_bits & 0x00000100u) {
798 _this->_impl_.child_ordering_ = from._impl_.child_ordering_;
799 }
800 if (cached_has_bits & 0x00000200u) {
801 _this->_impl_.sibling_order_rank_ = from._impl_.sibling_order_rank_;
802 }
803 _this->_impl_._has_bits_[0] |= cached_has_bits;
804 }
805 switch (from.static_or_dynamic_name_case()) {
806 case kName: {
807 _this->_internal_set_name(from._internal_name());
808 break;
809 }
810 case kStaticName: {
811 _this->_internal_set_static_name(from._internal_static_name());
812 break;
813 }
814 case kAtraceName: {
815 _this->_internal_set_atrace_name(from._internal_atrace_name());
816 break;
817 }
818 case STATIC_OR_DYNAMIC_NAME_NOT_SET: {
819 break;
820 }
821 }
822 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
823 }
824
CopyFrom(const TrackDescriptor & from)825 void TrackDescriptor::CopyFrom(const TrackDescriptor& from) {
826 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TrackDescriptor)
827 if (&from == this) return;
828 Clear();
829 MergeFrom(from);
830 }
831
IsInitialized() const832 bool TrackDescriptor::IsInitialized() const {
833 return true;
834 }
835
InternalSwap(TrackDescriptor * other)836 void TrackDescriptor::InternalSwap(TrackDescriptor* other) {
837 using std::swap;
838 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
839 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
840 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
841 PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_.sibling_order_rank_)
842 + sizeof(TrackDescriptor::_impl_.sibling_order_rank_) // NOLINT
843 - PROTOBUF_FIELD_OFFSET(TrackDescriptor, _impl_.process_)>(
844 reinterpret_cast<char*>(&_impl_.process_),
845 reinterpret_cast<char*>(&other->_impl_.process_));
846 swap(_impl_.static_or_dynamic_name_, other->_impl_.static_or_dynamic_name_);
847 swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
848 }
849
GetTypeName() const850 std::string TrackDescriptor::GetTypeName() const {
851 return "perfetto.protos.TrackDescriptor";
852 }
853
854
855 // @@protoc_insertion_point(namespace_scope)
856 } // namespace protos
857 } // namespace perfetto
858 PROTOBUF_NAMESPACE_OPEN
859 template<> PROTOBUF_NOINLINE ::perfetto::protos::TrackDescriptor*
CreateMaybeMessage(Arena * arena)860 Arena::CreateMaybeMessage< ::perfetto::protos::TrackDescriptor >(Arena* arena) {
861 return Arena::CreateMessageInternal< ::perfetto::protos::TrackDescriptor >(arena);
862 }
863 PROTOBUF_NAMESPACE_CLOSE
864
865 // @@protoc_insertion_point(global_scope)
866 #include <google/protobuf/port_undef.inc>
867