1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/system_info.proto
3
4 #include "protos/perfetto/trace/system_info.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 {
Utsname(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR Utsname::Utsname(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.sysname_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.version_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
29 , /*decltype(_impl_.release_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
30 , /*decltype(_impl_.machine_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}} {}
31 struct UtsnameDefaultTypeInternal {
UtsnameDefaultTypeInternalperfetto::protos::UtsnameDefaultTypeInternal32 PROTOBUF_CONSTEXPR UtsnameDefaultTypeInternal()
33 : _instance(::_pbi::ConstantInitialized{}) {}
~UtsnameDefaultTypeInternalperfetto::protos::UtsnameDefaultTypeInternal34 ~UtsnameDefaultTypeInternal() {}
35 union { // NOLINT(misc-non-private-member-variables-in-classes)
36 Utsname _instance;
37 };
38 };
39 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 UtsnameDefaultTypeInternal _Utsname_default_instance_;
SystemInfo(::_pbi::ConstantInitialized)40 PROTOBUF_CONSTEXPR SystemInfo::SystemInfo(
41 ::_pbi::ConstantInitialized): _impl_{
42 /*decltype(_impl_._has_bits_)*/{}
43 , /*decltype(_impl_._cached_size_)*/{}
44 , /*decltype(_impl_.android_build_fingerprint_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
45 , /*decltype(_impl_.tracing_service_version_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
46 , /*decltype(_impl_.android_soc_model_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
47 , /*decltype(_impl_.android_hardware_revision_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
48 , /*decltype(_impl_.android_storage_model_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
49 , /*decltype(_impl_.android_ram_model_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
50 , /*decltype(_impl_.android_guest_soc_model_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
51 , /*decltype(_impl_.android_device_manufacturer_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
52 , /*decltype(_impl_.utsname_)*/nullptr
53 , /*decltype(_impl_.hz_)*/::int64_t{0}
54 , /*decltype(_impl_.android_sdk_version_)*/::uint64_t{0u}
55 , /*decltype(_impl_.page_size_)*/0u
56 , /*decltype(_impl_.timezone_off_mins_)*/0
57 , /*decltype(_impl_.num_cpus_)*/0u} {}
58 struct SystemInfoDefaultTypeInternal {
SystemInfoDefaultTypeInternalperfetto::protos::SystemInfoDefaultTypeInternal59 PROTOBUF_CONSTEXPR SystemInfoDefaultTypeInternal()
60 : _instance(::_pbi::ConstantInitialized{}) {}
~SystemInfoDefaultTypeInternalperfetto::protos::SystemInfoDefaultTypeInternal61 ~SystemInfoDefaultTypeInternal() {}
62 union { // NOLINT(misc-non-private-member-variables-in-classes)
63 SystemInfo _instance;
64 };
65 };
66 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SystemInfoDefaultTypeInternal _SystemInfo_default_instance_;
67 } // namespace protos
68 } // namespace perfetto
69 namespace perfetto {
70 namespace protos {
71
72 // ===================================================================
73
74 class Utsname::_Internal {
75 public:
76 using HasBits = decltype(std::declval<Utsname>()._impl_._has_bits_);
set_has_sysname(HasBits * has_bits)77 static void set_has_sysname(HasBits* has_bits) {
78 (*has_bits)[0] |= 1u;
79 }
set_has_version(HasBits * has_bits)80 static void set_has_version(HasBits* has_bits) {
81 (*has_bits)[0] |= 2u;
82 }
set_has_release(HasBits * has_bits)83 static void set_has_release(HasBits* has_bits) {
84 (*has_bits)[0] |= 4u;
85 }
set_has_machine(HasBits * has_bits)86 static void set_has_machine(HasBits* has_bits) {
87 (*has_bits)[0] |= 8u;
88 }
89 };
90
Utsname(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)91 Utsname::Utsname(::PROTOBUF_NAMESPACE_ID::Arena* arena,
92 bool is_message_owned)
93 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
94 SharedCtor(arena, is_message_owned);
95 // @@protoc_insertion_point(arena_constructor:perfetto.protos.Utsname)
96 }
Utsname(const Utsname & from)97 Utsname::Utsname(const Utsname& from)
98 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
99 Utsname* const _this = this; (void)_this;
100 new (&_impl_) Impl_{
101 decltype(_impl_._has_bits_){from._impl_._has_bits_}
102 , /*decltype(_impl_._cached_size_)*/{}
103 , decltype(_impl_.sysname_){}
104 , decltype(_impl_.version_){}
105 , decltype(_impl_.release_){}
106 , decltype(_impl_.machine_){}};
107
108 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
109 _impl_.sysname_.InitDefault();
110 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
111 _impl_.sysname_.Set("", GetArenaForAllocation());
112 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
113 if (from._internal_has_sysname()) {
114 _this->_impl_.sysname_.Set(from._internal_sysname(),
115 _this->GetArenaForAllocation());
116 }
117 _impl_.version_.InitDefault();
118 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
119 _impl_.version_.Set("", GetArenaForAllocation());
120 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
121 if (from._internal_has_version()) {
122 _this->_impl_.version_.Set(from._internal_version(),
123 _this->GetArenaForAllocation());
124 }
125 _impl_.release_.InitDefault();
126 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
127 _impl_.release_.Set("", GetArenaForAllocation());
128 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
129 if (from._internal_has_release()) {
130 _this->_impl_.release_.Set(from._internal_release(),
131 _this->GetArenaForAllocation());
132 }
133 _impl_.machine_.InitDefault();
134 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
135 _impl_.machine_.Set("", GetArenaForAllocation());
136 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
137 if (from._internal_has_machine()) {
138 _this->_impl_.machine_.Set(from._internal_machine(),
139 _this->GetArenaForAllocation());
140 }
141 // @@protoc_insertion_point(copy_constructor:perfetto.protos.Utsname)
142 }
143
SharedCtor(::_pb::Arena * arena,bool is_message_owned)144 inline void Utsname::SharedCtor(
145 ::_pb::Arena* arena, bool is_message_owned) {
146 (void)arena;
147 (void)is_message_owned;
148 new (&_impl_) Impl_{
149 decltype(_impl_._has_bits_){}
150 , /*decltype(_impl_._cached_size_)*/{}
151 , decltype(_impl_.sysname_){}
152 , decltype(_impl_.version_){}
153 , decltype(_impl_.release_){}
154 , decltype(_impl_.machine_){}
155 };
156 _impl_.sysname_.InitDefault();
157 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
158 _impl_.sysname_.Set("", GetArenaForAllocation());
159 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
160 _impl_.version_.InitDefault();
161 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
162 _impl_.version_.Set("", GetArenaForAllocation());
163 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
164 _impl_.release_.InitDefault();
165 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
166 _impl_.release_.Set("", GetArenaForAllocation());
167 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
168 _impl_.machine_.InitDefault();
169 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
170 _impl_.machine_.Set("", GetArenaForAllocation());
171 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
172 }
173
~Utsname()174 Utsname::~Utsname() {
175 // @@protoc_insertion_point(destructor:perfetto.protos.Utsname)
176 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
177 (void)arena;
178 return;
179 }
180 SharedDtor();
181 }
182
SharedDtor()183 inline void Utsname::SharedDtor() {
184 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
185 _impl_.sysname_.Destroy();
186 _impl_.version_.Destroy();
187 _impl_.release_.Destroy();
188 _impl_.machine_.Destroy();
189 }
190
SetCachedSize(int size) const191 void Utsname::SetCachedSize(int size) const {
192 _impl_._cached_size_.Set(size);
193 }
194
Clear()195 void Utsname::Clear() {
196 // @@protoc_insertion_point(message_clear_start:perfetto.protos.Utsname)
197 ::uint32_t cached_has_bits = 0;
198 // Prevent compiler warnings about cached_has_bits being unused
199 (void) cached_has_bits;
200
201 cached_has_bits = _impl_._has_bits_[0];
202 if (cached_has_bits & 0x0000000fu) {
203 if (cached_has_bits & 0x00000001u) {
204 _impl_.sysname_.ClearNonDefaultToEmpty();
205 }
206 if (cached_has_bits & 0x00000002u) {
207 _impl_.version_.ClearNonDefaultToEmpty();
208 }
209 if (cached_has_bits & 0x00000004u) {
210 _impl_.release_.ClearNonDefaultToEmpty();
211 }
212 if (cached_has_bits & 0x00000008u) {
213 _impl_.machine_.ClearNonDefaultToEmpty();
214 }
215 }
216 _impl_._has_bits_.Clear();
217 _internal_metadata_.Clear<std::string>();
218 }
219
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)220 const char* Utsname::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
221 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
222 _Internal::HasBits has_bits{};
223 while (!ctx->Done(&ptr)) {
224 ::uint32_t tag;
225 ptr = ::_pbi::ReadTag(ptr, &tag);
226 switch (tag >> 3) {
227 // optional string sysname = 1;
228 case 1:
229 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
230 auto str = _internal_mutable_sysname();
231 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
232 CHK_(ptr);
233 } else {
234 goto handle_unusual;
235 }
236 continue;
237 // optional string version = 2;
238 case 2:
239 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
240 auto str = _internal_mutable_version();
241 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
242 CHK_(ptr);
243 } else {
244 goto handle_unusual;
245 }
246 continue;
247 // optional string release = 3;
248 case 3:
249 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
250 auto str = _internal_mutable_release();
251 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
252 CHK_(ptr);
253 } else {
254 goto handle_unusual;
255 }
256 continue;
257 // optional string machine = 4;
258 case 4:
259 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
260 auto str = _internal_mutable_machine();
261 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
262 CHK_(ptr);
263 } else {
264 goto handle_unusual;
265 }
266 continue;
267 default:
268 goto handle_unusual;
269 } // switch
270 handle_unusual:
271 if ((tag == 0) || ((tag & 7) == 4)) {
272 CHK_(ptr);
273 ctx->SetLastTag(tag);
274 goto message_done;
275 }
276 ptr = UnknownFieldParse(
277 tag,
278 _internal_metadata_.mutable_unknown_fields<std::string>(),
279 ptr, ctx);
280 CHK_(ptr != nullptr);
281 } // while
282 message_done:
283 _impl_._has_bits_.Or(has_bits);
284 return ptr;
285 failure:
286 ptr = nullptr;
287 goto message_done;
288 #undef CHK_
289 }
290
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const291 ::uint8_t* Utsname::_InternalSerialize(
292 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
293 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.Utsname)
294 ::uint32_t cached_has_bits = 0;
295 (void) cached_has_bits;
296
297 cached_has_bits = _impl_._has_bits_[0];
298 // optional string sysname = 1;
299 if (cached_has_bits & 0x00000001u) {
300 target = stream->WriteStringMaybeAliased(
301 1, this->_internal_sysname(), target);
302 }
303
304 // optional string version = 2;
305 if (cached_has_bits & 0x00000002u) {
306 target = stream->WriteStringMaybeAliased(
307 2, this->_internal_version(), target);
308 }
309
310 // optional string release = 3;
311 if (cached_has_bits & 0x00000004u) {
312 target = stream->WriteStringMaybeAliased(
313 3, this->_internal_release(), target);
314 }
315
316 // optional string machine = 4;
317 if (cached_has_bits & 0x00000008u) {
318 target = stream->WriteStringMaybeAliased(
319 4, this->_internal_machine(), target);
320 }
321
322 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
323 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
324 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
325 }
326 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.Utsname)
327 return target;
328 }
329
ByteSizeLong() const330 size_t Utsname::ByteSizeLong() const {
331 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.Utsname)
332 size_t total_size = 0;
333
334 ::uint32_t cached_has_bits = 0;
335 // Prevent compiler warnings about cached_has_bits being unused
336 (void) cached_has_bits;
337
338 cached_has_bits = _impl_._has_bits_[0];
339 if (cached_has_bits & 0x0000000fu) {
340 // optional string sysname = 1;
341 if (cached_has_bits & 0x00000001u) {
342 total_size += 1 +
343 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
344 this->_internal_sysname());
345 }
346
347 // optional string version = 2;
348 if (cached_has_bits & 0x00000002u) {
349 total_size += 1 +
350 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
351 this->_internal_version());
352 }
353
354 // optional string release = 3;
355 if (cached_has_bits & 0x00000004u) {
356 total_size += 1 +
357 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
358 this->_internal_release());
359 }
360
361 // optional string machine = 4;
362 if (cached_has_bits & 0x00000008u) {
363 total_size += 1 +
364 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
365 this->_internal_machine());
366 }
367
368 }
369 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
370 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
371 }
372 int cached_size = ::_pbi::ToCachedSize(total_size);
373 SetCachedSize(cached_size);
374 return total_size;
375 }
376
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)377 void Utsname::CheckTypeAndMergeFrom(
378 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
379 MergeFrom(*::_pbi::DownCast<const Utsname*>(
380 &from));
381 }
382
MergeFrom(const Utsname & from)383 void Utsname::MergeFrom(const Utsname& from) {
384 Utsname* const _this = this;
385 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.Utsname)
386 GOOGLE_DCHECK_NE(&from, _this);
387 ::uint32_t cached_has_bits = 0;
388 (void) cached_has_bits;
389
390 cached_has_bits = from._impl_._has_bits_[0];
391 if (cached_has_bits & 0x0000000fu) {
392 if (cached_has_bits & 0x00000001u) {
393 _this->_internal_set_sysname(from._internal_sysname());
394 }
395 if (cached_has_bits & 0x00000002u) {
396 _this->_internal_set_version(from._internal_version());
397 }
398 if (cached_has_bits & 0x00000004u) {
399 _this->_internal_set_release(from._internal_release());
400 }
401 if (cached_has_bits & 0x00000008u) {
402 _this->_internal_set_machine(from._internal_machine());
403 }
404 }
405 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
406 }
407
CopyFrom(const Utsname & from)408 void Utsname::CopyFrom(const Utsname& from) {
409 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.Utsname)
410 if (&from == this) return;
411 Clear();
412 MergeFrom(from);
413 }
414
IsInitialized() const415 bool Utsname::IsInitialized() const {
416 return true;
417 }
418
InternalSwap(Utsname * other)419 void Utsname::InternalSwap(Utsname* other) {
420 using std::swap;
421 auto* lhs_arena = GetArenaForAllocation();
422 auto* rhs_arena = other->GetArenaForAllocation();
423 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
424 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
425 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
426 &_impl_.sysname_, lhs_arena,
427 &other->_impl_.sysname_, rhs_arena
428 );
429 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
430 &_impl_.version_, lhs_arena,
431 &other->_impl_.version_, rhs_arena
432 );
433 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
434 &_impl_.release_, lhs_arena,
435 &other->_impl_.release_, rhs_arena
436 );
437 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
438 &_impl_.machine_, lhs_arena,
439 &other->_impl_.machine_, rhs_arena
440 );
441 }
442
GetTypeName() const443 std::string Utsname::GetTypeName() const {
444 return "perfetto.protos.Utsname";
445 }
446
447
448 // ===================================================================
449
450 class SystemInfo::_Internal {
451 public:
452 using HasBits = decltype(std::declval<SystemInfo>()._impl_._has_bits_);
453 static const ::perfetto::protos::Utsname& utsname(const SystemInfo* msg);
set_has_utsname(HasBits * has_bits)454 static void set_has_utsname(HasBits* has_bits) {
455 (*has_bits)[0] |= 256u;
456 }
set_has_android_build_fingerprint(HasBits * has_bits)457 static void set_has_android_build_fingerprint(HasBits* has_bits) {
458 (*has_bits)[0] |= 1u;
459 }
set_has_android_device_manufacturer(HasBits * has_bits)460 static void set_has_android_device_manufacturer(HasBits* has_bits) {
461 (*has_bits)[0] |= 128u;
462 }
set_has_android_soc_model(HasBits * has_bits)463 static void set_has_android_soc_model(HasBits* has_bits) {
464 (*has_bits)[0] |= 4u;
465 }
set_has_android_guest_soc_model(HasBits * has_bits)466 static void set_has_android_guest_soc_model(HasBits* has_bits) {
467 (*has_bits)[0] |= 64u;
468 }
set_has_android_hardware_revision(HasBits * has_bits)469 static void set_has_android_hardware_revision(HasBits* has_bits) {
470 (*has_bits)[0] |= 8u;
471 }
set_has_android_storage_model(HasBits * has_bits)472 static void set_has_android_storage_model(HasBits* has_bits) {
473 (*has_bits)[0] |= 16u;
474 }
set_has_android_ram_model(HasBits * has_bits)475 static void set_has_android_ram_model(HasBits* has_bits) {
476 (*has_bits)[0] |= 32u;
477 }
set_has_tracing_service_version(HasBits * has_bits)478 static void set_has_tracing_service_version(HasBits* has_bits) {
479 (*has_bits)[0] |= 2u;
480 }
set_has_android_sdk_version(HasBits * has_bits)481 static void set_has_android_sdk_version(HasBits* has_bits) {
482 (*has_bits)[0] |= 1024u;
483 }
set_has_page_size(HasBits * has_bits)484 static void set_has_page_size(HasBits* has_bits) {
485 (*has_bits)[0] |= 2048u;
486 }
set_has_num_cpus(HasBits * has_bits)487 static void set_has_num_cpus(HasBits* has_bits) {
488 (*has_bits)[0] |= 8192u;
489 }
set_has_timezone_off_mins(HasBits * has_bits)490 static void set_has_timezone_off_mins(HasBits* has_bits) {
491 (*has_bits)[0] |= 4096u;
492 }
set_has_hz(HasBits * has_bits)493 static void set_has_hz(HasBits* has_bits) {
494 (*has_bits)[0] |= 512u;
495 }
496 };
497
498 const ::perfetto::protos::Utsname&
utsname(const SystemInfo * msg)499 SystemInfo::_Internal::utsname(const SystemInfo* msg) {
500 return *msg->_impl_.utsname_;
501 }
SystemInfo(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)502 SystemInfo::SystemInfo(::PROTOBUF_NAMESPACE_ID::Arena* arena,
503 bool is_message_owned)
504 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
505 SharedCtor(arena, is_message_owned);
506 // @@protoc_insertion_point(arena_constructor:perfetto.protos.SystemInfo)
507 }
SystemInfo(const SystemInfo & from)508 SystemInfo::SystemInfo(const SystemInfo& from)
509 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
510 SystemInfo* const _this = this; (void)_this;
511 new (&_impl_) Impl_{
512 decltype(_impl_._has_bits_){from._impl_._has_bits_}
513 , /*decltype(_impl_._cached_size_)*/{}
514 , decltype(_impl_.android_build_fingerprint_){}
515 , decltype(_impl_.tracing_service_version_){}
516 , decltype(_impl_.android_soc_model_){}
517 , decltype(_impl_.android_hardware_revision_){}
518 , decltype(_impl_.android_storage_model_){}
519 , decltype(_impl_.android_ram_model_){}
520 , decltype(_impl_.android_guest_soc_model_){}
521 , decltype(_impl_.android_device_manufacturer_){}
522 , decltype(_impl_.utsname_){nullptr}
523 , decltype(_impl_.hz_){}
524 , decltype(_impl_.android_sdk_version_){}
525 , decltype(_impl_.page_size_){}
526 , decltype(_impl_.timezone_off_mins_){}
527 , decltype(_impl_.num_cpus_){}};
528
529 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
530 _impl_.android_build_fingerprint_.InitDefault();
531 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
532 _impl_.android_build_fingerprint_.Set("", GetArenaForAllocation());
533 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
534 if (from._internal_has_android_build_fingerprint()) {
535 _this->_impl_.android_build_fingerprint_.Set(from._internal_android_build_fingerprint(),
536 _this->GetArenaForAllocation());
537 }
538 _impl_.tracing_service_version_.InitDefault();
539 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
540 _impl_.tracing_service_version_.Set("", GetArenaForAllocation());
541 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
542 if (from._internal_has_tracing_service_version()) {
543 _this->_impl_.tracing_service_version_.Set(from._internal_tracing_service_version(),
544 _this->GetArenaForAllocation());
545 }
546 _impl_.android_soc_model_.InitDefault();
547 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
548 _impl_.android_soc_model_.Set("", GetArenaForAllocation());
549 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
550 if (from._internal_has_android_soc_model()) {
551 _this->_impl_.android_soc_model_.Set(from._internal_android_soc_model(),
552 _this->GetArenaForAllocation());
553 }
554 _impl_.android_hardware_revision_.InitDefault();
555 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
556 _impl_.android_hardware_revision_.Set("", GetArenaForAllocation());
557 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
558 if (from._internal_has_android_hardware_revision()) {
559 _this->_impl_.android_hardware_revision_.Set(from._internal_android_hardware_revision(),
560 _this->GetArenaForAllocation());
561 }
562 _impl_.android_storage_model_.InitDefault();
563 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
564 _impl_.android_storage_model_.Set("", GetArenaForAllocation());
565 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
566 if (from._internal_has_android_storage_model()) {
567 _this->_impl_.android_storage_model_.Set(from._internal_android_storage_model(),
568 _this->GetArenaForAllocation());
569 }
570 _impl_.android_ram_model_.InitDefault();
571 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
572 _impl_.android_ram_model_.Set("", GetArenaForAllocation());
573 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
574 if (from._internal_has_android_ram_model()) {
575 _this->_impl_.android_ram_model_.Set(from._internal_android_ram_model(),
576 _this->GetArenaForAllocation());
577 }
578 _impl_.android_guest_soc_model_.InitDefault();
579 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
580 _impl_.android_guest_soc_model_.Set("", GetArenaForAllocation());
581 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
582 if (from._internal_has_android_guest_soc_model()) {
583 _this->_impl_.android_guest_soc_model_.Set(from._internal_android_guest_soc_model(),
584 _this->GetArenaForAllocation());
585 }
586 _impl_.android_device_manufacturer_.InitDefault();
587 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
588 _impl_.android_device_manufacturer_.Set("", GetArenaForAllocation());
589 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
590 if (from._internal_has_android_device_manufacturer()) {
591 _this->_impl_.android_device_manufacturer_.Set(from._internal_android_device_manufacturer(),
592 _this->GetArenaForAllocation());
593 }
594 if (from._internal_has_utsname()) {
595 _this->_impl_.utsname_ = new ::perfetto::protos::Utsname(*from._impl_.utsname_);
596 }
597 ::memcpy(&_impl_.hz_, &from._impl_.hz_,
598 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.num_cpus_) -
599 reinterpret_cast<char*>(&_impl_.hz_)) + sizeof(_impl_.num_cpus_));
600 // @@protoc_insertion_point(copy_constructor:perfetto.protos.SystemInfo)
601 }
602
SharedCtor(::_pb::Arena * arena,bool is_message_owned)603 inline void SystemInfo::SharedCtor(
604 ::_pb::Arena* arena, bool is_message_owned) {
605 (void)arena;
606 (void)is_message_owned;
607 new (&_impl_) Impl_{
608 decltype(_impl_._has_bits_){}
609 , /*decltype(_impl_._cached_size_)*/{}
610 , decltype(_impl_.android_build_fingerprint_){}
611 , decltype(_impl_.tracing_service_version_){}
612 , decltype(_impl_.android_soc_model_){}
613 , decltype(_impl_.android_hardware_revision_){}
614 , decltype(_impl_.android_storage_model_){}
615 , decltype(_impl_.android_ram_model_){}
616 , decltype(_impl_.android_guest_soc_model_){}
617 , decltype(_impl_.android_device_manufacturer_){}
618 , decltype(_impl_.utsname_){nullptr}
619 , decltype(_impl_.hz_){::int64_t{0}}
620 , decltype(_impl_.android_sdk_version_){::uint64_t{0u}}
621 , decltype(_impl_.page_size_){0u}
622 , decltype(_impl_.timezone_off_mins_){0}
623 , decltype(_impl_.num_cpus_){0u}
624 };
625 _impl_.android_build_fingerprint_.InitDefault();
626 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
627 _impl_.android_build_fingerprint_.Set("", GetArenaForAllocation());
628 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
629 _impl_.tracing_service_version_.InitDefault();
630 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
631 _impl_.tracing_service_version_.Set("", GetArenaForAllocation());
632 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
633 _impl_.android_soc_model_.InitDefault();
634 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
635 _impl_.android_soc_model_.Set("", GetArenaForAllocation());
636 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
637 _impl_.android_hardware_revision_.InitDefault();
638 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
639 _impl_.android_hardware_revision_.Set("", GetArenaForAllocation());
640 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
641 _impl_.android_storage_model_.InitDefault();
642 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
643 _impl_.android_storage_model_.Set("", GetArenaForAllocation());
644 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
645 _impl_.android_ram_model_.InitDefault();
646 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
647 _impl_.android_ram_model_.Set("", GetArenaForAllocation());
648 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
649 _impl_.android_guest_soc_model_.InitDefault();
650 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
651 _impl_.android_guest_soc_model_.Set("", GetArenaForAllocation());
652 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
653 _impl_.android_device_manufacturer_.InitDefault();
654 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
655 _impl_.android_device_manufacturer_.Set("", GetArenaForAllocation());
656 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
657 }
658
~SystemInfo()659 SystemInfo::~SystemInfo() {
660 // @@protoc_insertion_point(destructor:perfetto.protos.SystemInfo)
661 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
662 (void)arena;
663 return;
664 }
665 SharedDtor();
666 }
667
SharedDtor()668 inline void SystemInfo::SharedDtor() {
669 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
670 _impl_.android_build_fingerprint_.Destroy();
671 _impl_.tracing_service_version_.Destroy();
672 _impl_.android_soc_model_.Destroy();
673 _impl_.android_hardware_revision_.Destroy();
674 _impl_.android_storage_model_.Destroy();
675 _impl_.android_ram_model_.Destroy();
676 _impl_.android_guest_soc_model_.Destroy();
677 _impl_.android_device_manufacturer_.Destroy();
678 if (this != internal_default_instance()) delete _impl_.utsname_;
679 }
680
SetCachedSize(int size) const681 void SystemInfo::SetCachedSize(int size) const {
682 _impl_._cached_size_.Set(size);
683 }
684
Clear()685 void SystemInfo::Clear() {
686 // @@protoc_insertion_point(message_clear_start:perfetto.protos.SystemInfo)
687 ::uint32_t cached_has_bits = 0;
688 // Prevent compiler warnings about cached_has_bits being unused
689 (void) cached_has_bits;
690
691 cached_has_bits = _impl_._has_bits_[0];
692 if (cached_has_bits & 0x000000ffu) {
693 if (cached_has_bits & 0x00000001u) {
694 _impl_.android_build_fingerprint_.ClearNonDefaultToEmpty();
695 }
696 if (cached_has_bits & 0x00000002u) {
697 _impl_.tracing_service_version_.ClearNonDefaultToEmpty();
698 }
699 if (cached_has_bits & 0x00000004u) {
700 _impl_.android_soc_model_.ClearNonDefaultToEmpty();
701 }
702 if (cached_has_bits & 0x00000008u) {
703 _impl_.android_hardware_revision_.ClearNonDefaultToEmpty();
704 }
705 if (cached_has_bits & 0x00000010u) {
706 _impl_.android_storage_model_.ClearNonDefaultToEmpty();
707 }
708 if (cached_has_bits & 0x00000020u) {
709 _impl_.android_ram_model_.ClearNonDefaultToEmpty();
710 }
711 if (cached_has_bits & 0x00000040u) {
712 _impl_.android_guest_soc_model_.ClearNonDefaultToEmpty();
713 }
714 if (cached_has_bits & 0x00000080u) {
715 _impl_.android_device_manufacturer_.ClearNonDefaultToEmpty();
716 }
717 }
718 if (cached_has_bits & 0x00000100u) {
719 GOOGLE_DCHECK(_impl_.utsname_ != nullptr);
720 _impl_.utsname_->Clear();
721 }
722 if (cached_has_bits & 0x00003e00u) {
723 ::memset(&_impl_.hz_, 0, static_cast<size_t>(
724 reinterpret_cast<char*>(&_impl_.num_cpus_) -
725 reinterpret_cast<char*>(&_impl_.hz_)) + sizeof(_impl_.num_cpus_));
726 }
727 _impl_._has_bits_.Clear();
728 _internal_metadata_.Clear<std::string>();
729 }
730
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)731 const char* SystemInfo::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
732 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
733 _Internal::HasBits has_bits{};
734 while (!ctx->Done(&ptr)) {
735 ::uint32_t tag;
736 ptr = ::_pbi::ReadTag(ptr, &tag);
737 switch (tag >> 3) {
738 // optional .perfetto.protos.Utsname utsname = 1;
739 case 1:
740 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
741 ptr = ctx->ParseMessage(_internal_mutable_utsname(), ptr);
742 CHK_(ptr);
743 } else {
744 goto handle_unusual;
745 }
746 continue;
747 // optional string android_build_fingerprint = 2;
748 case 2:
749 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
750 auto str = _internal_mutable_android_build_fingerprint();
751 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
752 CHK_(ptr);
753 } else {
754 goto handle_unusual;
755 }
756 continue;
757 // optional int64 hz = 3;
758 case 3:
759 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
760 _Internal::set_has_hz(&has_bits);
761 _impl_.hz_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
762 CHK_(ptr);
763 } else {
764 goto handle_unusual;
765 }
766 continue;
767 // optional string tracing_service_version = 4;
768 case 4:
769 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
770 auto str = _internal_mutable_tracing_service_version();
771 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
772 CHK_(ptr);
773 } else {
774 goto handle_unusual;
775 }
776 continue;
777 // optional uint64 android_sdk_version = 5;
778 case 5:
779 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
780 _Internal::set_has_android_sdk_version(&has_bits);
781 _impl_.android_sdk_version_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
782 CHK_(ptr);
783 } else {
784 goto handle_unusual;
785 }
786 continue;
787 // optional uint32 page_size = 6;
788 case 6:
789 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
790 _Internal::set_has_page_size(&has_bits);
791 _impl_.page_size_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
792 CHK_(ptr);
793 } else {
794 goto handle_unusual;
795 }
796 continue;
797 // optional int32 timezone_off_mins = 7;
798 case 7:
799 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
800 _Internal::set_has_timezone_off_mins(&has_bits);
801 _impl_.timezone_off_mins_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
802 CHK_(ptr);
803 } else {
804 goto handle_unusual;
805 }
806 continue;
807 // optional uint32 num_cpus = 8;
808 case 8:
809 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
810 _Internal::set_has_num_cpus(&has_bits);
811 _impl_.num_cpus_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
812 CHK_(ptr);
813 } else {
814 goto handle_unusual;
815 }
816 continue;
817 // optional string android_soc_model = 9;
818 case 9:
819 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 74)) {
820 auto str = _internal_mutable_android_soc_model();
821 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
822 CHK_(ptr);
823 } else {
824 goto handle_unusual;
825 }
826 continue;
827 // optional string android_hardware_revision = 10;
828 case 10:
829 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 82)) {
830 auto str = _internal_mutable_android_hardware_revision();
831 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
832 CHK_(ptr);
833 } else {
834 goto handle_unusual;
835 }
836 continue;
837 // optional string android_storage_model = 11;
838 case 11:
839 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 90)) {
840 auto str = _internal_mutable_android_storage_model();
841 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
842 CHK_(ptr);
843 } else {
844 goto handle_unusual;
845 }
846 continue;
847 // optional string android_ram_model = 12;
848 case 12:
849 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 98)) {
850 auto str = _internal_mutable_android_ram_model();
851 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
852 CHK_(ptr);
853 } else {
854 goto handle_unusual;
855 }
856 continue;
857 // optional string android_guest_soc_model = 13;
858 case 13:
859 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 106)) {
860 auto str = _internal_mutable_android_guest_soc_model();
861 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
862 CHK_(ptr);
863 } else {
864 goto handle_unusual;
865 }
866 continue;
867 // optional string android_device_manufacturer = 14;
868 case 14:
869 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 114)) {
870 auto str = _internal_mutable_android_device_manufacturer();
871 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
872 CHK_(ptr);
873 } else {
874 goto handle_unusual;
875 }
876 continue;
877 default:
878 goto handle_unusual;
879 } // switch
880 handle_unusual:
881 if ((tag == 0) || ((tag & 7) == 4)) {
882 CHK_(ptr);
883 ctx->SetLastTag(tag);
884 goto message_done;
885 }
886 ptr = UnknownFieldParse(
887 tag,
888 _internal_metadata_.mutable_unknown_fields<std::string>(),
889 ptr, ctx);
890 CHK_(ptr != nullptr);
891 } // while
892 message_done:
893 _impl_._has_bits_.Or(has_bits);
894 return ptr;
895 failure:
896 ptr = nullptr;
897 goto message_done;
898 #undef CHK_
899 }
900
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const901 ::uint8_t* SystemInfo::_InternalSerialize(
902 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
903 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.SystemInfo)
904 ::uint32_t cached_has_bits = 0;
905 (void) cached_has_bits;
906
907 cached_has_bits = _impl_._has_bits_[0];
908 // optional .perfetto.protos.Utsname utsname = 1;
909 if (cached_has_bits & 0x00000100u) {
910 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
911 InternalWriteMessage(1, _Internal::utsname(this),
912 _Internal::utsname(this).GetCachedSize(), target, stream);
913 }
914
915 // optional string android_build_fingerprint = 2;
916 if (cached_has_bits & 0x00000001u) {
917 target = stream->WriteStringMaybeAliased(
918 2, this->_internal_android_build_fingerprint(), target);
919 }
920
921 // optional int64 hz = 3;
922 if (cached_has_bits & 0x00000200u) {
923 target = stream->EnsureSpace(target);
924 target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_hz(), target);
925 }
926
927 // optional string tracing_service_version = 4;
928 if (cached_has_bits & 0x00000002u) {
929 target = stream->WriteStringMaybeAliased(
930 4, this->_internal_tracing_service_version(), target);
931 }
932
933 // optional uint64 android_sdk_version = 5;
934 if (cached_has_bits & 0x00000400u) {
935 target = stream->EnsureSpace(target);
936 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(5, this->_internal_android_sdk_version(), target);
937 }
938
939 // optional uint32 page_size = 6;
940 if (cached_has_bits & 0x00000800u) {
941 target = stream->EnsureSpace(target);
942 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(6, this->_internal_page_size(), target);
943 }
944
945 // optional int32 timezone_off_mins = 7;
946 if (cached_has_bits & 0x00001000u) {
947 target = stream->EnsureSpace(target);
948 target = ::_pbi::WireFormatLite::WriteInt32ToArray(7, this->_internal_timezone_off_mins(), target);
949 }
950
951 // optional uint32 num_cpus = 8;
952 if (cached_has_bits & 0x00002000u) {
953 target = stream->EnsureSpace(target);
954 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_num_cpus(), target);
955 }
956
957 // optional string android_soc_model = 9;
958 if (cached_has_bits & 0x00000004u) {
959 target = stream->WriteStringMaybeAliased(
960 9, this->_internal_android_soc_model(), target);
961 }
962
963 // optional string android_hardware_revision = 10;
964 if (cached_has_bits & 0x00000008u) {
965 target = stream->WriteStringMaybeAliased(
966 10, this->_internal_android_hardware_revision(), target);
967 }
968
969 // optional string android_storage_model = 11;
970 if (cached_has_bits & 0x00000010u) {
971 target = stream->WriteStringMaybeAliased(
972 11, this->_internal_android_storage_model(), target);
973 }
974
975 // optional string android_ram_model = 12;
976 if (cached_has_bits & 0x00000020u) {
977 target = stream->WriteStringMaybeAliased(
978 12, this->_internal_android_ram_model(), target);
979 }
980
981 // optional string android_guest_soc_model = 13;
982 if (cached_has_bits & 0x00000040u) {
983 target = stream->WriteStringMaybeAliased(
984 13, this->_internal_android_guest_soc_model(), target);
985 }
986
987 // optional string android_device_manufacturer = 14;
988 if (cached_has_bits & 0x00000080u) {
989 target = stream->WriteStringMaybeAliased(
990 14, this->_internal_android_device_manufacturer(), target);
991 }
992
993 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
994 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
995 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
996 }
997 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.SystemInfo)
998 return target;
999 }
1000
ByteSizeLong() const1001 size_t SystemInfo::ByteSizeLong() const {
1002 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.SystemInfo)
1003 size_t total_size = 0;
1004
1005 ::uint32_t cached_has_bits = 0;
1006 // Prevent compiler warnings about cached_has_bits being unused
1007 (void) cached_has_bits;
1008
1009 cached_has_bits = _impl_._has_bits_[0];
1010 if (cached_has_bits & 0x000000ffu) {
1011 // optional string android_build_fingerprint = 2;
1012 if (cached_has_bits & 0x00000001u) {
1013 total_size += 1 +
1014 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1015 this->_internal_android_build_fingerprint());
1016 }
1017
1018 // optional string tracing_service_version = 4;
1019 if (cached_has_bits & 0x00000002u) {
1020 total_size += 1 +
1021 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1022 this->_internal_tracing_service_version());
1023 }
1024
1025 // optional string android_soc_model = 9;
1026 if (cached_has_bits & 0x00000004u) {
1027 total_size += 1 +
1028 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1029 this->_internal_android_soc_model());
1030 }
1031
1032 // optional string android_hardware_revision = 10;
1033 if (cached_has_bits & 0x00000008u) {
1034 total_size += 1 +
1035 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1036 this->_internal_android_hardware_revision());
1037 }
1038
1039 // optional string android_storage_model = 11;
1040 if (cached_has_bits & 0x00000010u) {
1041 total_size += 1 +
1042 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1043 this->_internal_android_storage_model());
1044 }
1045
1046 // optional string android_ram_model = 12;
1047 if (cached_has_bits & 0x00000020u) {
1048 total_size += 1 +
1049 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1050 this->_internal_android_ram_model());
1051 }
1052
1053 // optional string android_guest_soc_model = 13;
1054 if (cached_has_bits & 0x00000040u) {
1055 total_size += 1 +
1056 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1057 this->_internal_android_guest_soc_model());
1058 }
1059
1060 // optional string android_device_manufacturer = 14;
1061 if (cached_has_bits & 0x00000080u) {
1062 total_size += 1 +
1063 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1064 this->_internal_android_device_manufacturer());
1065 }
1066
1067 }
1068 if (cached_has_bits & 0x00003f00u) {
1069 // optional .perfetto.protos.Utsname utsname = 1;
1070 if (cached_has_bits & 0x00000100u) {
1071 total_size += 1 +
1072 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
1073 *_impl_.utsname_);
1074 }
1075
1076 // optional int64 hz = 3;
1077 if (cached_has_bits & 0x00000200u) {
1078 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_hz());
1079 }
1080
1081 // optional uint64 android_sdk_version = 5;
1082 if (cached_has_bits & 0x00000400u) {
1083 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_android_sdk_version());
1084 }
1085
1086 // optional uint32 page_size = 6;
1087 if (cached_has_bits & 0x00000800u) {
1088 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_page_size());
1089 }
1090
1091 // optional int32 timezone_off_mins = 7;
1092 if (cached_has_bits & 0x00001000u) {
1093 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_timezone_off_mins());
1094 }
1095
1096 // optional uint32 num_cpus = 8;
1097 if (cached_has_bits & 0x00002000u) {
1098 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_num_cpus());
1099 }
1100
1101 }
1102 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1103 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1104 }
1105 int cached_size = ::_pbi::ToCachedSize(total_size);
1106 SetCachedSize(cached_size);
1107 return total_size;
1108 }
1109
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1110 void SystemInfo::CheckTypeAndMergeFrom(
1111 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1112 MergeFrom(*::_pbi::DownCast<const SystemInfo*>(
1113 &from));
1114 }
1115
MergeFrom(const SystemInfo & from)1116 void SystemInfo::MergeFrom(const SystemInfo& from) {
1117 SystemInfo* const _this = this;
1118 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.SystemInfo)
1119 GOOGLE_DCHECK_NE(&from, _this);
1120 ::uint32_t cached_has_bits = 0;
1121 (void) cached_has_bits;
1122
1123 cached_has_bits = from._impl_._has_bits_[0];
1124 if (cached_has_bits & 0x000000ffu) {
1125 if (cached_has_bits & 0x00000001u) {
1126 _this->_internal_set_android_build_fingerprint(from._internal_android_build_fingerprint());
1127 }
1128 if (cached_has_bits & 0x00000002u) {
1129 _this->_internal_set_tracing_service_version(from._internal_tracing_service_version());
1130 }
1131 if (cached_has_bits & 0x00000004u) {
1132 _this->_internal_set_android_soc_model(from._internal_android_soc_model());
1133 }
1134 if (cached_has_bits & 0x00000008u) {
1135 _this->_internal_set_android_hardware_revision(from._internal_android_hardware_revision());
1136 }
1137 if (cached_has_bits & 0x00000010u) {
1138 _this->_internal_set_android_storage_model(from._internal_android_storage_model());
1139 }
1140 if (cached_has_bits & 0x00000020u) {
1141 _this->_internal_set_android_ram_model(from._internal_android_ram_model());
1142 }
1143 if (cached_has_bits & 0x00000040u) {
1144 _this->_internal_set_android_guest_soc_model(from._internal_android_guest_soc_model());
1145 }
1146 if (cached_has_bits & 0x00000080u) {
1147 _this->_internal_set_android_device_manufacturer(from._internal_android_device_manufacturer());
1148 }
1149 }
1150 if (cached_has_bits & 0x00003f00u) {
1151 if (cached_has_bits & 0x00000100u) {
1152 _this->_internal_mutable_utsname()->::perfetto::protos::Utsname::MergeFrom(
1153 from._internal_utsname());
1154 }
1155 if (cached_has_bits & 0x00000200u) {
1156 _this->_impl_.hz_ = from._impl_.hz_;
1157 }
1158 if (cached_has_bits & 0x00000400u) {
1159 _this->_impl_.android_sdk_version_ = from._impl_.android_sdk_version_;
1160 }
1161 if (cached_has_bits & 0x00000800u) {
1162 _this->_impl_.page_size_ = from._impl_.page_size_;
1163 }
1164 if (cached_has_bits & 0x00001000u) {
1165 _this->_impl_.timezone_off_mins_ = from._impl_.timezone_off_mins_;
1166 }
1167 if (cached_has_bits & 0x00002000u) {
1168 _this->_impl_.num_cpus_ = from._impl_.num_cpus_;
1169 }
1170 _this->_impl_._has_bits_[0] |= cached_has_bits;
1171 }
1172 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1173 }
1174
CopyFrom(const SystemInfo & from)1175 void SystemInfo::CopyFrom(const SystemInfo& from) {
1176 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.SystemInfo)
1177 if (&from == this) return;
1178 Clear();
1179 MergeFrom(from);
1180 }
1181
IsInitialized() const1182 bool SystemInfo::IsInitialized() const {
1183 return true;
1184 }
1185
InternalSwap(SystemInfo * other)1186 void SystemInfo::InternalSwap(SystemInfo* other) {
1187 using std::swap;
1188 auto* lhs_arena = GetArenaForAllocation();
1189 auto* rhs_arena = other->GetArenaForAllocation();
1190 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1191 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1192 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1193 &_impl_.android_build_fingerprint_, lhs_arena,
1194 &other->_impl_.android_build_fingerprint_, rhs_arena
1195 );
1196 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1197 &_impl_.tracing_service_version_, lhs_arena,
1198 &other->_impl_.tracing_service_version_, rhs_arena
1199 );
1200 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1201 &_impl_.android_soc_model_, lhs_arena,
1202 &other->_impl_.android_soc_model_, rhs_arena
1203 );
1204 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1205 &_impl_.android_hardware_revision_, lhs_arena,
1206 &other->_impl_.android_hardware_revision_, rhs_arena
1207 );
1208 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1209 &_impl_.android_storage_model_, lhs_arena,
1210 &other->_impl_.android_storage_model_, rhs_arena
1211 );
1212 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1213 &_impl_.android_ram_model_, lhs_arena,
1214 &other->_impl_.android_ram_model_, rhs_arena
1215 );
1216 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1217 &_impl_.android_guest_soc_model_, lhs_arena,
1218 &other->_impl_.android_guest_soc_model_, rhs_arena
1219 );
1220 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1221 &_impl_.android_device_manufacturer_, lhs_arena,
1222 &other->_impl_.android_device_manufacturer_, rhs_arena
1223 );
1224 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1225 PROTOBUF_FIELD_OFFSET(SystemInfo, _impl_.num_cpus_)
1226 + sizeof(SystemInfo::_impl_.num_cpus_) // NOLINT
1227 - PROTOBUF_FIELD_OFFSET(SystemInfo, _impl_.utsname_)>(
1228 reinterpret_cast<char*>(&_impl_.utsname_),
1229 reinterpret_cast<char*>(&other->_impl_.utsname_));
1230 }
1231
GetTypeName() const1232 std::string SystemInfo::GetTypeName() const {
1233 return "perfetto.protos.SystemInfo";
1234 }
1235
1236
1237 // @@protoc_insertion_point(namespace_scope)
1238 } // namespace protos
1239 } // namespace perfetto
1240 PROTOBUF_NAMESPACE_OPEN
1241 template<> PROTOBUF_NOINLINE ::perfetto::protos::Utsname*
CreateMaybeMessage(Arena * arena)1242 Arena::CreateMaybeMessage< ::perfetto::protos::Utsname >(Arena* arena) {
1243 return Arena::CreateMessageInternal< ::perfetto::protos::Utsname >(arena);
1244 }
1245 template<> PROTOBUF_NOINLINE ::perfetto::protos::SystemInfo*
CreateMaybeMessage(Arena * arena)1246 Arena::CreateMaybeMessage< ::perfetto::protos::SystemInfo >(Arena* arena) {
1247 return Arena::CreateMessageInternal< ::perfetto::protos::SystemInfo >(arena);
1248 }
1249 PROTOBUF_NAMESPACE_CLOSE
1250
1251 // @@protoc_insertion_point(global_scope)
1252 #include <google/protobuf/port_undef.inc>
1253