1 // Generated by the protocol buffer compiler.  DO NOT EDIT!
2 // source: sampled_profile.proto
3 
4 #include "sampled_profile.pb.h"
5 
6 #include <algorithm>
7 
8 #include <google/protobuf/io/coded_stream.h>
9 #include <google/protobuf/extension_set.h>
10 #include <google/protobuf/wire_format_lite.h>
11 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
12 // @@protoc_insertion_point(includes)
13 #include <google/protobuf/port_def.inc>
14 
15 PROTOBUF_PRAGMA_INIT_SEG
16 
17 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
18 namespace _pbi = _pb::internal;
19 
20 namespace metrics {
SampledProfile_ProcessTypesEntry_DoNotUse(::_pbi::ConstantInitialized)21 PROTOBUF_CONSTEXPR SampledProfile_ProcessTypesEntry_DoNotUse::SampledProfile_ProcessTypesEntry_DoNotUse(
22     ::_pbi::ConstantInitialized) {}
23 struct SampledProfile_ProcessTypesEntry_DoNotUseDefaultTypeInternal {
SampledProfile_ProcessTypesEntry_DoNotUseDefaultTypeInternalmetrics::SampledProfile_ProcessTypesEntry_DoNotUseDefaultTypeInternal24   PROTOBUF_CONSTEXPR SampledProfile_ProcessTypesEntry_DoNotUseDefaultTypeInternal()
25       : _instance(::_pbi::ConstantInitialized{}) {}
~SampledProfile_ProcessTypesEntry_DoNotUseDefaultTypeInternalmetrics::SampledProfile_ProcessTypesEntry_DoNotUseDefaultTypeInternal26   ~SampledProfile_ProcessTypesEntry_DoNotUseDefaultTypeInternal() {}
27   union {
28     SampledProfile_ProcessTypesEntry_DoNotUse _instance;
29   };
30 };
31 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SampledProfile_ProcessTypesEntry_DoNotUseDefaultTypeInternal _SampledProfile_ProcessTypesEntry_DoNotUse_default_instance_;
SampledProfile_ThreadTypesEntry_DoNotUse(::_pbi::ConstantInitialized)32 PROTOBUF_CONSTEXPR SampledProfile_ThreadTypesEntry_DoNotUse::SampledProfile_ThreadTypesEntry_DoNotUse(
33     ::_pbi::ConstantInitialized) {}
34 struct SampledProfile_ThreadTypesEntry_DoNotUseDefaultTypeInternal {
SampledProfile_ThreadTypesEntry_DoNotUseDefaultTypeInternalmetrics::SampledProfile_ThreadTypesEntry_DoNotUseDefaultTypeInternal35   PROTOBUF_CONSTEXPR SampledProfile_ThreadTypesEntry_DoNotUseDefaultTypeInternal()
36       : _instance(::_pbi::ConstantInitialized{}) {}
~SampledProfile_ThreadTypesEntry_DoNotUseDefaultTypeInternalmetrics::SampledProfile_ThreadTypesEntry_DoNotUseDefaultTypeInternal37   ~SampledProfile_ThreadTypesEntry_DoNotUseDefaultTypeInternal() {}
38   union {
39     SampledProfile_ThreadTypesEntry_DoNotUse _instance;
40   };
41 };
42 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SampledProfile_ThreadTypesEntry_DoNotUseDefaultTypeInternal _SampledProfile_ThreadTypesEntry_DoNotUse_default_instance_;
SampledProfile(::_pbi::ConstantInitialized)43 PROTOBUF_CONSTEXPR SampledProfile::SampledProfile(
44     ::_pbi::ConstantInitialized): _impl_{
45     /*decltype(_impl_._has_bits_)*/{}
46   , /*decltype(_impl_._cached_size_)*/{}
47   , /*decltype(_impl_.process_types_)*/{}
48   , /*decltype(_impl_.thread_types_)*/{}
49   , /*decltype(_impl_.cpu_max_frequency_mhz_)*/{}
50   , /*decltype(_impl_.lacros_pids_)*/{}
51   , /*decltype(_impl_._lacros_pids_cached_byte_size_)*/{0}
52   , /*decltype(_impl_.lacros_version_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
53   , /*decltype(_impl_.perf_data_)*/nullptr
54   , /*decltype(_impl_.call_stack_profile_)*/nullptr
55   , /*decltype(_impl_.perf_stat_)*/nullptr
56   , /*decltype(_impl_.ms_after_boot_)*/int64_t{0}
57   , /*decltype(_impl_.ms_after_login_)*/int64_t{0}
58   , /*decltype(_impl_.trigger_event_)*/0
59   , /*decltype(_impl_.num_tabs_restored_)*/0
60   , /*decltype(_impl_.suspend_duration_ms_)*/int64_t{0}
61   , /*decltype(_impl_.ms_after_resume_)*/int64_t{0}
62   , /*decltype(_impl_.ms_after_restore_)*/int64_t{0}
63   , /*decltype(_impl_.process_)*/0
64   , /*decltype(_impl_.thread_)*/0
65   , /*decltype(_impl_.psi_cpu_last_10s_pct_)*/0
66   , /*decltype(_impl_.psi_cpu_last_60s_pct_)*/0
67   , /*decltype(_impl_.lacros_channel_)*/0
68   , /*decltype(_impl_.thermal_state_)*/0
69   , /*decltype(_impl_.cpu_speed_limit_percent_)*/0} {}
70 struct SampledProfileDefaultTypeInternal {
SampledProfileDefaultTypeInternalmetrics::SampledProfileDefaultTypeInternal71   PROTOBUF_CONSTEXPR SampledProfileDefaultTypeInternal()
72       : _instance(::_pbi::ConstantInitialized{}) {}
~SampledProfileDefaultTypeInternalmetrics::SampledProfileDefaultTypeInternal73   ~SampledProfileDefaultTypeInternal() {}
74   union {
75     SampledProfile _instance;
76   };
77 };
78 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SampledProfileDefaultTypeInternal _SampledProfile_default_instance_;
79 }  // namespace metrics
80 namespace metrics {
SampledProfile_TriggerEvent_IsValid(int value)81 bool SampledProfile_TriggerEvent_IsValid(int value) {
82   switch (value) {
83     case 0:
84     case 1:
85     case 2:
86     case 3:
87     case 4:
88     case 5:
89     case 6:
90     case 7:
91       return true;
92     default:
93       return false;
94   }
95 }
96 
97 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> SampledProfile_TriggerEvent_strings[8] = {};
98 
99 static const char SampledProfile_TriggerEvent_names[] =
100   "JANKY_TASK"
101   "PERIODIC_COLLECTION"
102   "PERIODIC_HEAP_COLLECTION"
103   "PROCESS_STARTUP"
104   "RESTORE_SESSION"
105   "RESUME_FROM_SUSPEND"
106   "THREAD_HUNG"
107   "UNKNOWN_TRIGGER_EVENT";
108 
109 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry SampledProfile_TriggerEvent_entries[] = {
110   { {SampledProfile_TriggerEvent_names + 0, 10}, 5 },
111   { {SampledProfile_TriggerEvent_names + 10, 19}, 1 },
112   { {SampledProfile_TriggerEvent_names + 29, 24}, 7 },
113   { {SampledProfile_TriggerEvent_names + 53, 15}, 4 },
114   { {SampledProfile_TriggerEvent_names + 68, 15}, 3 },
115   { {SampledProfile_TriggerEvent_names + 83, 19}, 2 },
116   { {SampledProfile_TriggerEvent_names + 102, 11}, 6 },
117   { {SampledProfile_TriggerEvent_names + 113, 21}, 0 },
118 };
119 
120 static const int SampledProfile_TriggerEvent_entries_by_number[] = {
121   7, // 0 -> UNKNOWN_TRIGGER_EVENT
122   1, // 1 -> PERIODIC_COLLECTION
123   5, // 2 -> RESUME_FROM_SUSPEND
124   4, // 3 -> RESTORE_SESSION
125   3, // 4 -> PROCESS_STARTUP
126   0, // 5 -> JANKY_TASK
127   6, // 6 -> THREAD_HUNG
128   2, // 7 -> PERIODIC_HEAP_COLLECTION
129 };
130 
SampledProfile_TriggerEvent_Name(SampledProfile_TriggerEvent value)131 const std::string& SampledProfile_TriggerEvent_Name(
132     SampledProfile_TriggerEvent value) {
133   static const bool dummy =
134       ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
135           SampledProfile_TriggerEvent_entries,
136           SampledProfile_TriggerEvent_entries_by_number,
137           8, SampledProfile_TriggerEvent_strings);
138   (void) dummy;
139   int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
140       SampledProfile_TriggerEvent_entries,
141       SampledProfile_TriggerEvent_entries_by_number,
142       8, value);
143   return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
144                      SampledProfile_TriggerEvent_strings[idx].get();
145 }
SampledProfile_TriggerEvent_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,SampledProfile_TriggerEvent * value)146 bool SampledProfile_TriggerEvent_Parse(
147     ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SampledProfile_TriggerEvent* value) {
148   int int_value;
149   bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
150       SampledProfile_TriggerEvent_entries, 8, name, &int_value);
151   if (success) {
152     *value = static_cast<SampledProfile_TriggerEvent>(int_value);
153   }
154   return success;
155 }
156 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
157 constexpr SampledProfile_TriggerEvent SampledProfile::UNKNOWN_TRIGGER_EVENT;
158 constexpr SampledProfile_TriggerEvent SampledProfile::PERIODIC_COLLECTION;
159 constexpr SampledProfile_TriggerEvent SampledProfile::RESUME_FROM_SUSPEND;
160 constexpr SampledProfile_TriggerEvent SampledProfile::RESTORE_SESSION;
161 constexpr SampledProfile_TriggerEvent SampledProfile::PROCESS_STARTUP;
162 constexpr SampledProfile_TriggerEvent SampledProfile::JANKY_TASK;
163 constexpr SampledProfile_TriggerEvent SampledProfile::THREAD_HUNG;
164 constexpr SampledProfile_TriggerEvent SampledProfile::PERIODIC_HEAP_COLLECTION;
165 constexpr SampledProfile_TriggerEvent SampledProfile::TriggerEvent_MIN;
166 constexpr SampledProfile_TriggerEvent SampledProfile::TriggerEvent_MAX;
167 constexpr int SampledProfile::TriggerEvent_ARRAYSIZE;
168 #endif  // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
169 
170 // ===================================================================
171 
SampledProfile_ProcessTypesEntry_DoNotUse()172 SampledProfile_ProcessTypesEntry_DoNotUse::SampledProfile_ProcessTypesEntry_DoNotUse() {}
SampledProfile_ProcessTypesEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena * arena)173 SampledProfile_ProcessTypesEntry_DoNotUse::SampledProfile_ProcessTypesEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
174     : SuperType(arena) {}
MergeFrom(const SampledProfile_ProcessTypesEntry_DoNotUse & other)175 void SampledProfile_ProcessTypesEntry_DoNotUse::MergeFrom(const SampledProfile_ProcessTypesEntry_DoNotUse& other) {
176   MergeFromInternal(other);
177 }
178 
179 // ===================================================================
180 
SampledProfile_ThreadTypesEntry_DoNotUse()181 SampledProfile_ThreadTypesEntry_DoNotUse::SampledProfile_ThreadTypesEntry_DoNotUse() {}
SampledProfile_ThreadTypesEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena * arena)182 SampledProfile_ThreadTypesEntry_DoNotUse::SampledProfile_ThreadTypesEntry_DoNotUse(::PROTOBUF_NAMESPACE_ID::Arena* arena)
183     : SuperType(arena) {}
MergeFrom(const SampledProfile_ThreadTypesEntry_DoNotUse & other)184 void SampledProfile_ThreadTypesEntry_DoNotUse::MergeFrom(const SampledProfile_ThreadTypesEntry_DoNotUse& other) {
185   MergeFromInternal(other);
186 }
187 
188 // ===================================================================
189 
190 class SampledProfile::_Internal {
191  public:
192   using HasBits = decltype(std::declval<SampledProfile>()._impl_._has_bits_);
set_has_trigger_event(HasBits * has_bits)193   static void set_has_trigger_event(HasBits* has_bits) {
194     (*has_bits)[0] |= 64u;
195   }
set_has_process(HasBits * has_bits)196   static void set_has_process(HasBits* has_bits) {
197     (*has_bits)[0] |= 2048u;
198   }
set_has_thread(HasBits * has_bits)199   static void set_has_thread(HasBits* has_bits) {
200     (*has_bits)[0] |= 4096u;
201   }
set_has_lacros_version(HasBits * has_bits)202   static void set_has_lacros_version(HasBits* has_bits) {
203     (*has_bits)[0] |= 1u;
204   }
set_has_lacros_channel(HasBits * has_bits)205   static void set_has_lacros_channel(HasBits* has_bits) {
206     (*has_bits)[0] |= 32768u;
207   }
set_has_ms_after_boot(HasBits * has_bits)208   static void set_has_ms_after_boot(HasBits* has_bits) {
209     (*has_bits)[0] |= 16u;
210   }
set_has_ms_after_login(HasBits * has_bits)211   static void set_has_ms_after_login(HasBits* has_bits) {
212     (*has_bits)[0] |= 32u;
213   }
set_has_suspend_duration_ms(HasBits * has_bits)214   static void set_has_suspend_duration_ms(HasBits* has_bits) {
215     (*has_bits)[0] |= 256u;
216   }
set_has_ms_after_resume(HasBits * has_bits)217   static void set_has_ms_after_resume(HasBits* has_bits) {
218     (*has_bits)[0] |= 512u;
219   }
set_has_num_tabs_restored(HasBits * has_bits)220   static void set_has_num_tabs_restored(HasBits* has_bits) {
221     (*has_bits)[0] |= 128u;
222   }
set_has_ms_after_restore(HasBits * has_bits)223   static void set_has_ms_after_restore(HasBits* has_bits) {
224     (*has_bits)[0] |= 1024u;
225   }
226   static const ::metrics::PerfDataProto& perf_data(const SampledProfile* msg);
set_has_perf_data(HasBits * has_bits)227   static void set_has_perf_data(HasBits* has_bits) {
228     (*has_bits)[0] |= 2u;
229   }
230   static const ::metrics::CallStackProfile& call_stack_profile(const SampledProfile* msg);
set_has_call_stack_profile(HasBits * has_bits)231   static void set_has_call_stack_profile(HasBits* has_bits) {
232     (*has_bits)[0] |= 4u;
233   }
234   static const ::metrics::PerfStatProto& perf_stat(const SampledProfile* msg);
set_has_perf_stat(HasBits * has_bits)235   static void set_has_perf_stat(HasBits* has_bits) {
236     (*has_bits)[0] |= 8u;
237   }
set_has_psi_cpu_last_10s_pct(HasBits * has_bits)238   static void set_has_psi_cpu_last_10s_pct(HasBits* has_bits) {
239     (*has_bits)[0] |= 8192u;
240   }
set_has_psi_cpu_last_60s_pct(HasBits * has_bits)241   static void set_has_psi_cpu_last_60s_pct(HasBits* has_bits) {
242     (*has_bits)[0] |= 16384u;
243   }
set_has_thermal_state(HasBits * has_bits)244   static void set_has_thermal_state(HasBits* has_bits) {
245     (*has_bits)[0] |= 65536u;
246   }
set_has_cpu_speed_limit_percent(HasBits * has_bits)247   static void set_has_cpu_speed_limit_percent(HasBits* has_bits) {
248     (*has_bits)[0] |= 131072u;
249   }
250 };
251 
252 const ::metrics::PerfDataProto&
perf_data(const SampledProfile * msg)253 SampledProfile::_Internal::perf_data(const SampledProfile* msg) {
254   return *msg->_impl_.perf_data_;
255 }
256 const ::metrics::CallStackProfile&
call_stack_profile(const SampledProfile * msg)257 SampledProfile::_Internal::call_stack_profile(const SampledProfile* msg) {
258   return *msg->_impl_.call_stack_profile_;
259 }
260 const ::metrics::PerfStatProto&
perf_stat(const SampledProfile * msg)261 SampledProfile::_Internal::perf_stat(const SampledProfile* msg) {
262   return *msg->_impl_.perf_stat_;
263 }
clear_perf_data()264 void SampledProfile::clear_perf_data() {
265   if (_impl_.perf_data_ != nullptr) _impl_.perf_data_->Clear();
266   _impl_._has_bits_[0] &= ~0x00000002u;
267 }
clear_call_stack_profile()268 void SampledProfile::clear_call_stack_profile() {
269   if (_impl_.call_stack_profile_ != nullptr) _impl_.call_stack_profile_->Clear();
270   _impl_._has_bits_[0] &= ~0x00000004u;
271 }
clear_perf_stat()272 void SampledProfile::clear_perf_stat() {
273   if (_impl_.perf_stat_ != nullptr) _impl_.perf_stat_->Clear();
274   _impl_._has_bits_[0] &= ~0x00000008u;
275 }
SampledProfile(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)276 SampledProfile::SampledProfile(::PROTOBUF_NAMESPACE_ID::Arena* arena,
277                          bool is_message_owned)
278   : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
279   SharedCtor(arena, is_message_owned);
280   // @@protoc_insertion_point(arena_constructor:metrics.SampledProfile)
281 }
SampledProfile(const SampledProfile & from)282 SampledProfile::SampledProfile(const SampledProfile& from)
283   : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
284   SampledProfile* const _this = this; (void)_this;
285   new (&_impl_) Impl_{
286       decltype(_impl_._has_bits_){from._impl_._has_bits_}
287     , /*decltype(_impl_._cached_size_)*/{}
288     , /*decltype(_impl_.process_types_)*/{}
289     , /*decltype(_impl_.thread_types_)*/{}
290     , decltype(_impl_.cpu_max_frequency_mhz_){from._impl_.cpu_max_frequency_mhz_}
291     , decltype(_impl_.lacros_pids_){from._impl_.lacros_pids_}
292     , /*decltype(_impl_._lacros_pids_cached_byte_size_)*/{0}
293     , decltype(_impl_.lacros_version_){}
294     , decltype(_impl_.perf_data_){nullptr}
295     , decltype(_impl_.call_stack_profile_){nullptr}
296     , decltype(_impl_.perf_stat_){nullptr}
297     , decltype(_impl_.ms_after_boot_){}
298     , decltype(_impl_.ms_after_login_){}
299     , decltype(_impl_.trigger_event_){}
300     , decltype(_impl_.num_tabs_restored_){}
301     , decltype(_impl_.suspend_duration_ms_){}
302     , decltype(_impl_.ms_after_resume_){}
303     , decltype(_impl_.ms_after_restore_){}
304     , decltype(_impl_.process_){}
305     , decltype(_impl_.thread_){}
306     , decltype(_impl_.psi_cpu_last_10s_pct_){}
307     , decltype(_impl_.psi_cpu_last_60s_pct_){}
308     , decltype(_impl_.lacros_channel_){}
309     , decltype(_impl_.thermal_state_){}
310     , decltype(_impl_.cpu_speed_limit_percent_){}};
311 
312   _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
313   _this->_impl_.process_types_.MergeFrom(from._impl_.process_types_);
314   _this->_impl_.thread_types_.MergeFrom(from._impl_.thread_types_);
315   _impl_.lacros_version_.InitDefault();
316   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
317     _impl_.lacros_version_.Set("", GetArenaForAllocation());
318   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
319   if (from._internal_has_lacros_version()) {
320     _this->_impl_.lacros_version_.Set(from._internal_lacros_version(),
321       _this->GetArenaForAllocation());
322   }
323   if (from._internal_has_perf_data()) {
324     _this->_impl_.perf_data_ = new ::metrics::PerfDataProto(*from._impl_.perf_data_);
325   }
326   if (from._internal_has_call_stack_profile()) {
327     _this->_impl_.call_stack_profile_ = new ::metrics::CallStackProfile(*from._impl_.call_stack_profile_);
328   }
329   if (from._internal_has_perf_stat()) {
330     _this->_impl_.perf_stat_ = new ::metrics::PerfStatProto(*from._impl_.perf_stat_);
331   }
332   ::memcpy(&_impl_.ms_after_boot_, &from._impl_.ms_after_boot_,
333     static_cast<size_t>(reinterpret_cast<char*>(&_impl_.cpu_speed_limit_percent_) -
334     reinterpret_cast<char*>(&_impl_.ms_after_boot_)) + sizeof(_impl_.cpu_speed_limit_percent_));
335   // @@protoc_insertion_point(copy_constructor:metrics.SampledProfile)
336 }
337 
SharedCtor(::_pb::Arena * arena,bool is_message_owned)338 inline void SampledProfile::SharedCtor(
339     ::_pb::Arena* arena, bool is_message_owned) {
340   (void)arena;
341   (void)is_message_owned;
342   new (&_impl_) Impl_{
343       decltype(_impl_._has_bits_){}
344     , /*decltype(_impl_._cached_size_)*/{}
345     , /*decltype(_impl_.process_types_)*/{::_pbi::ArenaInitialized(), arena}
346     , /*decltype(_impl_.thread_types_)*/{::_pbi::ArenaInitialized(), arena}
347     , decltype(_impl_.cpu_max_frequency_mhz_){arena}
348     , decltype(_impl_.lacros_pids_){arena}
349     , /*decltype(_impl_._lacros_pids_cached_byte_size_)*/{0}
350     , decltype(_impl_.lacros_version_){}
351     , decltype(_impl_.perf_data_){nullptr}
352     , decltype(_impl_.call_stack_profile_){nullptr}
353     , decltype(_impl_.perf_stat_){nullptr}
354     , decltype(_impl_.ms_after_boot_){int64_t{0}}
355     , decltype(_impl_.ms_after_login_){int64_t{0}}
356     , decltype(_impl_.trigger_event_){0}
357     , decltype(_impl_.num_tabs_restored_){0}
358     , decltype(_impl_.suspend_duration_ms_){int64_t{0}}
359     , decltype(_impl_.ms_after_resume_){int64_t{0}}
360     , decltype(_impl_.ms_after_restore_){int64_t{0}}
361     , decltype(_impl_.process_){0}
362     , decltype(_impl_.thread_){0}
363     , decltype(_impl_.psi_cpu_last_10s_pct_){0}
364     , decltype(_impl_.psi_cpu_last_60s_pct_){0}
365     , decltype(_impl_.lacros_channel_){0}
366     , decltype(_impl_.thermal_state_){0}
367     , decltype(_impl_.cpu_speed_limit_percent_){0}
368   };
369   _impl_.lacros_version_.InitDefault();
370   #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
371     _impl_.lacros_version_.Set("", GetArenaForAllocation());
372   #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
373 }
374 
~SampledProfile()375 SampledProfile::~SampledProfile() {
376   // @@protoc_insertion_point(destructor:metrics.SampledProfile)
377   if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
378   (void)arena;
379     return;
380   }
381   SharedDtor();
382 }
383 
SharedDtor()384 inline void SampledProfile::SharedDtor() {
385   GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
386   _impl_.process_types_.Destruct();
387   _impl_.process_types_.~MapFieldLite();
388   _impl_.thread_types_.Destruct();
389   _impl_.thread_types_.~MapFieldLite();
390   _impl_.cpu_max_frequency_mhz_.~RepeatedField();
391   _impl_.lacros_pids_.~RepeatedField();
392   _impl_.lacros_version_.Destroy();
393   if (this != internal_default_instance()) delete _impl_.perf_data_;
394   if (this != internal_default_instance()) delete _impl_.call_stack_profile_;
395   if (this != internal_default_instance()) delete _impl_.perf_stat_;
396 }
397 
SetCachedSize(int size) const398 void SampledProfile::SetCachedSize(int size) const {
399   _impl_._cached_size_.Set(size);
400 }
401 
Clear()402 void SampledProfile::Clear() {
403 // @@protoc_insertion_point(message_clear_start:metrics.SampledProfile)
404   uint32_t cached_has_bits = 0;
405   // Prevent compiler warnings about cached_has_bits being unused
406   (void) cached_has_bits;
407 
408   _impl_.process_types_.Clear();
409   _impl_.thread_types_.Clear();
410   _impl_.cpu_max_frequency_mhz_.Clear();
411   _impl_.lacros_pids_.Clear();
412   cached_has_bits = _impl_._has_bits_[0];
413   if (cached_has_bits & 0x0000000fu) {
414     if (cached_has_bits & 0x00000001u) {
415       _impl_.lacros_version_.ClearNonDefaultToEmpty();
416     }
417     if (cached_has_bits & 0x00000002u) {
418       GOOGLE_DCHECK(_impl_.perf_data_ != nullptr);
419       _impl_.perf_data_->Clear();
420     }
421     if (cached_has_bits & 0x00000004u) {
422       GOOGLE_DCHECK(_impl_.call_stack_profile_ != nullptr);
423       _impl_.call_stack_profile_->Clear();
424     }
425     if (cached_has_bits & 0x00000008u) {
426       GOOGLE_DCHECK(_impl_.perf_stat_ != nullptr);
427       _impl_.perf_stat_->Clear();
428     }
429   }
430   if (cached_has_bits & 0x000000f0u) {
431     ::memset(&_impl_.ms_after_boot_, 0, static_cast<size_t>(
432         reinterpret_cast<char*>(&_impl_.num_tabs_restored_) -
433         reinterpret_cast<char*>(&_impl_.ms_after_boot_)) + sizeof(_impl_.num_tabs_restored_));
434   }
435   if (cached_has_bits & 0x0000ff00u) {
436     ::memset(&_impl_.suspend_duration_ms_, 0, static_cast<size_t>(
437         reinterpret_cast<char*>(&_impl_.lacros_channel_) -
438         reinterpret_cast<char*>(&_impl_.suspend_duration_ms_)) + sizeof(_impl_.lacros_channel_));
439   }
440   if (cached_has_bits & 0x00030000u) {
441     ::memset(&_impl_.thermal_state_, 0, static_cast<size_t>(
442         reinterpret_cast<char*>(&_impl_.cpu_speed_limit_percent_) -
443         reinterpret_cast<char*>(&_impl_.thermal_state_)) + sizeof(_impl_.cpu_speed_limit_percent_));
444   }
445   _impl_._has_bits_.Clear();
446   _internal_metadata_.Clear<std::string>();
447 }
448 
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)449 const char* SampledProfile::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
450 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
451   _Internal::HasBits has_bits{};
452   while (!ctx->Done(&ptr)) {
453     uint32_t tag;
454     ptr = ::_pbi::ReadTag(ptr, &tag);
455     switch (tag >> 3) {
456       // optional .metrics.SampledProfile.TriggerEvent trigger_event = 1;
457       case 1:
458         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 8)) {
459           uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
460           CHK_(ptr);
461           if (PROTOBUF_PREDICT_TRUE(::metrics::SampledProfile_TriggerEvent_IsValid(val))) {
462             _internal_set_trigger_event(static_cast<::metrics::SampledProfile_TriggerEvent>(val));
463           } else {
464             ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(1, val, mutable_unknown_fields());
465           }
466         } else
467           goto handle_unusual;
468         continue;
469       // optional int64 ms_after_boot = 2;
470       case 2:
471         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 16)) {
472           _Internal::set_has_ms_after_boot(&has_bits);
473           _impl_.ms_after_boot_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
474           CHK_(ptr);
475         } else
476           goto handle_unusual;
477         continue;
478       // optional int64 ms_after_login = 3;
479       case 3:
480         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 24)) {
481           _Internal::set_has_ms_after_login(&has_bits);
482           _impl_.ms_after_login_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
483           CHK_(ptr);
484         } else
485           goto handle_unusual;
486         continue;
487       // optional .metrics.PerfDataProto perf_data = 4;
488       case 4:
489         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 34)) {
490           ptr = ctx->ParseMessage(_internal_mutable_perf_data(), ptr);
491           CHK_(ptr);
492         } else
493           goto handle_unusual;
494         continue;
495       // optional int64 suspend_duration_ms = 5;
496       case 5:
497         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 40)) {
498           _Internal::set_has_suspend_duration_ms(&has_bits);
499           _impl_.suspend_duration_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
500           CHK_(ptr);
501         } else
502           goto handle_unusual;
503         continue;
504       // optional int64 ms_after_resume = 6;
505       case 6:
506         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 48)) {
507           _Internal::set_has_ms_after_resume(&has_bits);
508           _impl_.ms_after_resume_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
509           CHK_(ptr);
510         } else
511           goto handle_unusual;
512         continue;
513       // optional int32 num_tabs_restored = 7;
514       case 7:
515         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 56)) {
516           _Internal::set_has_num_tabs_restored(&has_bits);
517           _impl_.num_tabs_restored_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
518           CHK_(ptr);
519         } else
520           goto handle_unusual;
521         continue;
522       // optional int64 ms_after_restore = 8;
523       case 8:
524         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 64)) {
525           _Internal::set_has_ms_after_restore(&has_bits);
526           _impl_.ms_after_restore_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
527           CHK_(ptr);
528         } else
529           goto handle_unusual;
530         continue;
531       // optional .metrics.CallStackProfile call_stack_profile = 9;
532       case 9:
533         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 74)) {
534           ptr = ctx->ParseMessage(_internal_mutable_call_stack_profile(), ptr);
535           CHK_(ptr);
536         } else
537           goto handle_unusual;
538         continue;
539       // optional .metrics.PerfStatProto perf_stat = 10;
540       case 10:
541         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 82)) {
542           ptr = ctx->ParseMessage(_internal_mutable_perf_stat(), ptr);
543           CHK_(ptr);
544         } else
545           goto handle_unusual;
546         continue;
547       // optional .metrics.Process process = 11;
548       case 11:
549         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 88)) {
550           uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
551           CHK_(ptr);
552           if (PROTOBUF_PREDICT_TRUE(::metrics::Process_IsValid(val))) {
553             _internal_set_process(static_cast<::metrics::Process>(val));
554           } else {
555             ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(11, val, mutable_unknown_fields());
556           }
557         } else
558           goto handle_unusual;
559         continue;
560       // optional .metrics.Thread thread = 12;
561       case 12:
562         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 96)) {
563           uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
564           CHK_(ptr);
565           if (PROTOBUF_PREDICT_TRUE(::metrics::Thread_IsValid(val))) {
566             _internal_set_thread(static_cast<::metrics::Thread>(val));
567           } else {
568             ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(12, val, mutable_unknown_fields());
569           }
570         } else
571           goto handle_unusual;
572         continue;
573       // map<uint32, .metrics.Process> process_types = 13;
574       case 13:
575         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 106)) {
576           ptr -= 1;
577           do {
578             ptr += 1;
579             auto object = ::PROTOBUF_NAMESPACE_ID::internal::InitEnumParseWrapper<std::string>(&_impl_.process_types_, ::metrics::Process_IsValid, 13, &_internal_metadata_);
580             ptr = ctx->ParseMessage(&object, ptr);
581             CHK_(ptr);
582             if (!ctx->DataAvailable(ptr)) break;
583           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<106>(ptr));
584         } else
585           goto handle_unusual;
586         continue;
587       // map<uint32, .metrics.Thread> thread_types = 14;
588       case 14:
589         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 114)) {
590           ptr -= 1;
591           do {
592             ptr += 1;
593             auto object = ::PROTOBUF_NAMESPACE_ID::internal::InitEnumParseWrapper<std::string>(&_impl_.thread_types_, ::metrics::Thread_IsValid, 14, &_internal_metadata_);
594             ptr = ctx->ParseMessage(&object, ptr);
595             CHK_(ptr);
596             if (!ctx->DataAvailable(ptr)) break;
597           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<114>(ptr));
598         } else
599           goto handle_unusual;
600         continue;
601       // repeated uint32 cpu_max_frequency_mhz = 15;
602       case 15:
603         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 120)) {
604           ptr -= 1;
605           do {
606             ptr += 1;
607             _internal_add_cpu_max_frequency_mhz(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
608             CHK_(ptr);
609             if (!ctx->DataAvailable(ptr)) break;
610           } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<120>(ptr));
611         } else if (static_cast<uint8_t>(tag) == 122) {
612           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_cpu_max_frequency_mhz(), ptr, ctx);
613           CHK_(ptr);
614         } else
615           goto handle_unusual;
616         continue;
617       // optional float psi_cpu_last_10s_pct = 16;
618       case 16:
619         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 133)) {
620           _Internal::set_has_psi_cpu_last_10s_pct(&has_bits);
621           _impl_.psi_cpu_last_10s_pct_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
622           ptr += sizeof(float);
623         } else
624           goto handle_unusual;
625         continue;
626       // optional float psi_cpu_last_60s_pct = 17;
627       case 17:
628         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 141)) {
629           _Internal::set_has_psi_cpu_last_60s_pct(&has_bits);
630           _impl_.psi_cpu_last_60s_pct_ = ::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<float>(ptr);
631           ptr += sizeof(float);
632         } else
633           goto handle_unusual;
634         continue;
635       // repeated uint32 lacros_pids = 18 [packed = true];
636       case 18:
637         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 146)) {
638           ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_lacros_pids(), ptr, ctx);
639           CHK_(ptr);
640         } else if (static_cast<uint8_t>(tag) == 144) {
641           _internal_add_lacros_pids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
642           CHK_(ptr);
643         } else
644           goto handle_unusual;
645         continue;
646       // optional string lacros_version = 19;
647       case 19:
648         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 154)) {
649           auto str = _internal_mutable_lacros_version();
650           ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
651           CHK_(ptr);
652         } else
653           goto handle_unusual;
654         continue;
655       // optional .metrics.SystemProfileProto.Channel lacros_channel = 20;
656       case 20:
657         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 160)) {
658           uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
659           CHK_(ptr);
660           if (PROTOBUF_PREDICT_TRUE(::metrics::SystemProfileProto_Channel_IsValid(val))) {
661             _internal_set_lacros_channel(static_cast<::metrics::SystemProfileProto_Channel>(val));
662           } else {
663             ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(20, val, mutable_unknown_fields());
664           }
665         } else
666           goto handle_unusual;
667         continue;
668       // optional .metrics.ThermalState thermal_state = 21;
669       case 21:
670         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 168)) {
671           uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
672           CHK_(ptr);
673           if (PROTOBUF_PREDICT_TRUE(::metrics::ThermalState_IsValid(val))) {
674             _internal_set_thermal_state(static_cast<::metrics::ThermalState>(val));
675           } else {
676             ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(21, val, mutable_unknown_fields());
677           }
678         } else
679           goto handle_unusual;
680         continue;
681       // optional int32 cpu_speed_limit_percent = 22;
682       case 22:
683         if (PROTOBUF_PREDICT_TRUE(static_cast<uint8_t>(tag) == 176)) {
684           _Internal::set_has_cpu_speed_limit_percent(&has_bits);
685           _impl_.cpu_speed_limit_percent_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
686           CHK_(ptr);
687         } else
688           goto handle_unusual;
689         continue;
690       default:
691         goto handle_unusual;
692     }  // switch
693   handle_unusual:
694     if ((tag == 0) || ((tag & 7) == 4)) {
695       CHK_(ptr);
696       ctx->SetLastTag(tag);
697       goto message_done;
698     }
699     ptr = UnknownFieldParse(
700         tag,
701         _internal_metadata_.mutable_unknown_fields<std::string>(),
702         ptr, ctx);
703     CHK_(ptr != nullptr);
704   }  // while
705 message_done:
706   _impl_._has_bits_.Or(has_bits);
707   return ptr;
708 failure:
709   ptr = nullptr;
710   goto message_done;
711 #undef CHK_
712 }
713 
_InternalSerialize(uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const714 uint8_t* SampledProfile::_InternalSerialize(
715     uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
716   // @@protoc_insertion_point(serialize_to_array_start:metrics.SampledProfile)
717   uint32_t cached_has_bits = 0;
718   (void) cached_has_bits;
719 
720   cached_has_bits = _impl_._has_bits_[0];
721   // optional .metrics.SampledProfile.TriggerEvent trigger_event = 1;
722   if (cached_has_bits & 0x00000040u) {
723     target = stream->EnsureSpace(target);
724     target = ::_pbi::WireFormatLite::WriteEnumToArray(
725       1, this->_internal_trigger_event(), target);
726   }
727 
728   // optional int64 ms_after_boot = 2;
729   if (cached_has_bits & 0x00000010u) {
730     target = stream->EnsureSpace(target);
731     target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_ms_after_boot(), target);
732   }
733 
734   // optional int64 ms_after_login = 3;
735   if (cached_has_bits & 0x00000020u) {
736     target = stream->EnsureSpace(target);
737     target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_ms_after_login(), target);
738   }
739 
740   // optional .metrics.PerfDataProto perf_data = 4;
741   if (cached_has_bits & 0x00000002u) {
742     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
743       InternalWriteMessage(4, _Internal::perf_data(this),
744         _Internal::perf_data(this).GetCachedSize(), target, stream);
745   }
746 
747   // optional int64 suspend_duration_ms = 5;
748   if (cached_has_bits & 0x00000100u) {
749     target = stream->EnsureSpace(target);
750     target = ::_pbi::WireFormatLite::WriteInt64ToArray(5, this->_internal_suspend_duration_ms(), target);
751   }
752 
753   // optional int64 ms_after_resume = 6;
754   if (cached_has_bits & 0x00000200u) {
755     target = stream->EnsureSpace(target);
756     target = ::_pbi::WireFormatLite::WriteInt64ToArray(6, this->_internal_ms_after_resume(), target);
757   }
758 
759   // optional int32 num_tabs_restored = 7;
760   if (cached_has_bits & 0x00000080u) {
761     target = stream->EnsureSpace(target);
762     target = ::_pbi::WireFormatLite::WriteInt32ToArray(7, this->_internal_num_tabs_restored(), target);
763   }
764 
765   // optional int64 ms_after_restore = 8;
766   if (cached_has_bits & 0x00000400u) {
767     target = stream->EnsureSpace(target);
768     target = ::_pbi::WireFormatLite::WriteInt64ToArray(8, this->_internal_ms_after_restore(), target);
769   }
770 
771   // optional .metrics.CallStackProfile call_stack_profile = 9;
772   if (cached_has_bits & 0x00000004u) {
773     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
774       InternalWriteMessage(9, _Internal::call_stack_profile(this),
775         _Internal::call_stack_profile(this).GetCachedSize(), target, stream);
776   }
777 
778   // optional .metrics.PerfStatProto perf_stat = 10;
779   if (cached_has_bits & 0x00000008u) {
780     target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
781       InternalWriteMessage(10, _Internal::perf_stat(this),
782         _Internal::perf_stat(this).GetCachedSize(), target, stream);
783   }
784 
785   // optional .metrics.Process process = 11;
786   if (cached_has_bits & 0x00000800u) {
787     target = stream->EnsureSpace(target);
788     target = ::_pbi::WireFormatLite::WriteEnumToArray(
789       11, this->_internal_process(), target);
790   }
791 
792   // optional .metrics.Thread thread = 12;
793   if (cached_has_bits & 0x00001000u) {
794     target = stream->EnsureSpace(target);
795     target = ::_pbi::WireFormatLite::WriteEnumToArray(
796       12, this->_internal_thread(), target);
797   }
798 
799   // map<uint32, .metrics.Process> process_types = 13;
800   if (!this->_internal_process_types().empty()) {
801     using MapType = ::_pb::Map<uint32_t, ::metrics::Process>;
802     using WireHelper = SampledProfile_ProcessTypesEntry_DoNotUse::Funcs;
803     const auto& map_field = this->_internal_process_types();
804 
805     if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
806       for (const auto& entry : ::_pbi::MapSorterFlat<MapType>(map_field)) {
807         target = WireHelper::InternalSerialize(13, entry.first, entry.second, target, stream);
808       }
809     } else {
810       for (const auto& entry : map_field) {
811         target = WireHelper::InternalSerialize(13, entry.first, entry.second, target, stream);
812       }
813     }
814   }
815 
816   // map<uint32, .metrics.Thread> thread_types = 14;
817   if (!this->_internal_thread_types().empty()) {
818     using MapType = ::_pb::Map<uint32_t, ::metrics::Thread>;
819     using WireHelper = SampledProfile_ThreadTypesEntry_DoNotUse::Funcs;
820     const auto& map_field = this->_internal_thread_types();
821 
822     if (stream->IsSerializationDeterministic() && map_field.size() > 1) {
823       for (const auto& entry : ::_pbi::MapSorterFlat<MapType>(map_field)) {
824         target = WireHelper::InternalSerialize(14, entry.first, entry.second, target, stream);
825       }
826     } else {
827       for (const auto& entry : map_field) {
828         target = WireHelper::InternalSerialize(14, entry.first, entry.second, target, stream);
829       }
830     }
831   }
832 
833   // repeated uint32 cpu_max_frequency_mhz = 15;
834   for (int i = 0, n = this->_internal_cpu_max_frequency_mhz_size(); i < n; i++) {
835     target = stream->EnsureSpace(target);
836     target = ::_pbi::WireFormatLite::WriteUInt32ToArray(15, this->_internal_cpu_max_frequency_mhz(i), target);
837   }
838 
839   // optional float psi_cpu_last_10s_pct = 16;
840   if (cached_has_bits & 0x00002000u) {
841     target = stream->EnsureSpace(target);
842     target = ::_pbi::WireFormatLite::WriteFloatToArray(16, this->_internal_psi_cpu_last_10s_pct(), target);
843   }
844 
845   // optional float psi_cpu_last_60s_pct = 17;
846   if (cached_has_bits & 0x00004000u) {
847     target = stream->EnsureSpace(target);
848     target = ::_pbi::WireFormatLite::WriteFloatToArray(17, this->_internal_psi_cpu_last_60s_pct(), target);
849   }
850 
851   // repeated uint32 lacros_pids = 18 [packed = true];
852   {
853     int byte_size = _impl_._lacros_pids_cached_byte_size_.load(std::memory_order_relaxed);
854     if (byte_size > 0) {
855       target = stream->WriteUInt32Packed(
856           18, _internal_lacros_pids(), byte_size, target);
857     }
858   }
859 
860   // optional string lacros_version = 19;
861   if (cached_has_bits & 0x00000001u) {
862     target = stream->WriteStringMaybeAliased(
863         19, this->_internal_lacros_version(), target);
864   }
865 
866   // optional .metrics.SystemProfileProto.Channel lacros_channel = 20;
867   if (cached_has_bits & 0x00008000u) {
868     target = stream->EnsureSpace(target);
869     target = ::_pbi::WireFormatLite::WriteEnumToArray(
870       20, this->_internal_lacros_channel(), target);
871   }
872 
873   // optional .metrics.ThermalState thermal_state = 21;
874   if (cached_has_bits & 0x00010000u) {
875     target = stream->EnsureSpace(target);
876     target = ::_pbi::WireFormatLite::WriteEnumToArray(
877       21, this->_internal_thermal_state(), target);
878   }
879 
880   // optional int32 cpu_speed_limit_percent = 22;
881   if (cached_has_bits & 0x00020000u) {
882     target = stream->EnsureSpace(target);
883     target = ::_pbi::WireFormatLite::WriteInt32ToArray(22, this->_internal_cpu_speed_limit_percent(), target);
884   }
885 
886   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
887     target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
888         static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
889   }
890   // @@protoc_insertion_point(serialize_to_array_end:metrics.SampledProfile)
891   return target;
892 }
893 
ByteSizeLong() const894 size_t SampledProfile::ByteSizeLong() const {
895 // @@protoc_insertion_point(message_byte_size_start:metrics.SampledProfile)
896   size_t total_size = 0;
897 
898   uint32_t cached_has_bits = 0;
899   // Prevent compiler warnings about cached_has_bits being unused
900   (void) cached_has_bits;
901 
902   // map<uint32, .metrics.Process> process_types = 13;
903   total_size += 1 *
904       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_process_types_size());
905   for (::PROTOBUF_NAMESPACE_ID::Map< uint32_t, ::metrics::Process >::const_iterator
906       it = this->_internal_process_types().begin();
907       it != this->_internal_process_types().end(); ++it) {
908     total_size += SampledProfile_ProcessTypesEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
909   }
910 
911   // map<uint32, .metrics.Thread> thread_types = 14;
912   total_size += 1 *
913       ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(this->_internal_thread_types_size());
914   for (::PROTOBUF_NAMESPACE_ID::Map< uint32_t, ::metrics::Thread >::const_iterator
915       it = this->_internal_thread_types().begin();
916       it != this->_internal_thread_types().end(); ++it) {
917     total_size += SampledProfile_ThreadTypesEntry_DoNotUse::Funcs::ByteSizeLong(it->first, it->second);
918   }
919 
920   // repeated uint32 cpu_max_frequency_mhz = 15;
921   {
922     size_t data_size = ::_pbi::WireFormatLite::
923       UInt32Size(this->_impl_.cpu_max_frequency_mhz_);
924     total_size += 1 *
925                   ::_pbi::FromIntSize(this->_internal_cpu_max_frequency_mhz_size());
926     total_size += data_size;
927   }
928 
929   // repeated uint32 lacros_pids = 18 [packed = true];
930   {
931     size_t data_size = ::_pbi::WireFormatLite::
932       UInt32Size(this->_impl_.lacros_pids_);
933     if (data_size > 0) {
934       total_size += 2 +
935         ::_pbi::WireFormatLite::Int32Size(static_cast<int32_t>(data_size));
936     }
937     int cached_size = ::_pbi::ToCachedSize(data_size);
938     _impl_._lacros_pids_cached_byte_size_.store(cached_size,
939                                     std::memory_order_relaxed);
940     total_size += data_size;
941   }
942 
943   cached_has_bits = _impl_._has_bits_[0];
944   if (cached_has_bits & 0x000000ffu) {
945     // optional string lacros_version = 19;
946     if (cached_has_bits & 0x00000001u) {
947       total_size += 2 +
948         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
949           this->_internal_lacros_version());
950     }
951 
952     // optional .metrics.PerfDataProto perf_data = 4;
953     if (cached_has_bits & 0x00000002u) {
954       total_size += 1 +
955         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
956           *_impl_.perf_data_);
957     }
958 
959     // optional .metrics.CallStackProfile call_stack_profile = 9;
960     if (cached_has_bits & 0x00000004u) {
961       total_size += 1 +
962         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
963           *_impl_.call_stack_profile_);
964     }
965 
966     // optional .metrics.PerfStatProto perf_stat = 10;
967     if (cached_has_bits & 0x00000008u) {
968       total_size += 1 +
969         ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
970           *_impl_.perf_stat_);
971     }
972 
973     // optional int64 ms_after_boot = 2;
974     if (cached_has_bits & 0x00000010u) {
975       total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_ms_after_boot());
976     }
977 
978     // optional int64 ms_after_login = 3;
979     if (cached_has_bits & 0x00000020u) {
980       total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_ms_after_login());
981     }
982 
983     // optional .metrics.SampledProfile.TriggerEvent trigger_event = 1;
984     if (cached_has_bits & 0x00000040u) {
985       total_size += 1 +
986         ::_pbi::WireFormatLite::EnumSize(this->_internal_trigger_event());
987     }
988 
989     // optional int32 num_tabs_restored = 7;
990     if (cached_has_bits & 0x00000080u) {
991       total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_num_tabs_restored());
992     }
993 
994   }
995   if (cached_has_bits & 0x0000ff00u) {
996     // optional int64 suspend_duration_ms = 5;
997     if (cached_has_bits & 0x00000100u) {
998       total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_suspend_duration_ms());
999     }
1000 
1001     // optional int64 ms_after_resume = 6;
1002     if (cached_has_bits & 0x00000200u) {
1003       total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_ms_after_resume());
1004     }
1005 
1006     // optional int64 ms_after_restore = 8;
1007     if (cached_has_bits & 0x00000400u) {
1008       total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_ms_after_restore());
1009     }
1010 
1011     // optional .metrics.Process process = 11;
1012     if (cached_has_bits & 0x00000800u) {
1013       total_size += 1 +
1014         ::_pbi::WireFormatLite::EnumSize(this->_internal_process());
1015     }
1016 
1017     // optional .metrics.Thread thread = 12;
1018     if (cached_has_bits & 0x00001000u) {
1019       total_size += 1 +
1020         ::_pbi::WireFormatLite::EnumSize(this->_internal_thread());
1021     }
1022 
1023     // optional float psi_cpu_last_10s_pct = 16;
1024     if (cached_has_bits & 0x00002000u) {
1025       total_size += 2 + 4;
1026     }
1027 
1028     // optional float psi_cpu_last_60s_pct = 17;
1029     if (cached_has_bits & 0x00004000u) {
1030       total_size += 2 + 4;
1031     }
1032 
1033     // optional .metrics.SystemProfileProto.Channel lacros_channel = 20;
1034     if (cached_has_bits & 0x00008000u) {
1035       total_size += 2 +
1036         ::_pbi::WireFormatLite::EnumSize(this->_internal_lacros_channel());
1037     }
1038 
1039   }
1040   if (cached_has_bits & 0x00030000u) {
1041     // optional .metrics.ThermalState thermal_state = 21;
1042     if (cached_has_bits & 0x00010000u) {
1043       total_size += 2 +
1044         ::_pbi::WireFormatLite::EnumSize(this->_internal_thermal_state());
1045     }
1046 
1047     // optional int32 cpu_speed_limit_percent = 22;
1048     if (cached_has_bits & 0x00020000u) {
1049       total_size += 2 +
1050         ::_pbi::WireFormatLite::Int32Size(
1051           this->_internal_cpu_speed_limit_percent());
1052     }
1053 
1054   }
1055   if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1056     total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1057   }
1058   int cached_size = ::_pbi::ToCachedSize(total_size);
1059   SetCachedSize(cached_size);
1060   return total_size;
1061 }
1062 
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1063 void SampledProfile::CheckTypeAndMergeFrom(
1064     const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1065   MergeFrom(*::_pbi::DownCast<const SampledProfile*>(
1066       &from));
1067 }
1068 
MergeFrom(const SampledProfile & from)1069 void SampledProfile::MergeFrom(const SampledProfile& from) {
1070   SampledProfile* const _this = this;
1071   // @@protoc_insertion_point(class_specific_merge_from_start:metrics.SampledProfile)
1072   GOOGLE_DCHECK_NE(&from, _this);
1073   uint32_t cached_has_bits = 0;
1074   (void) cached_has_bits;
1075 
1076   _this->_impl_.process_types_.MergeFrom(from._impl_.process_types_);
1077   _this->_impl_.thread_types_.MergeFrom(from._impl_.thread_types_);
1078   _this->_impl_.cpu_max_frequency_mhz_.MergeFrom(from._impl_.cpu_max_frequency_mhz_);
1079   _this->_impl_.lacros_pids_.MergeFrom(from._impl_.lacros_pids_);
1080   cached_has_bits = from._impl_._has_bits_[0];
1081   if (cached_has_bits & 0x000000ffu) {
1082     if (cached_has_bits & 0x00000001u) {
1083       _this->_internal_set_lacros_version(from._internal_lacros_version());
1084     }
1085     if (cached_has_bits & 0x00000002u) {
1086       _this->_internal_mutable_perf_data()->::metrics::PerfDataProto::MergeFrom(
1087           from._internal_perf_data());
1088     }
1089     if (cached_has_bits & 0x00000004u) {
1090       _this->_internal_mutable_call_stack_profile()->::metrics::CallStackProfile::MergeFrom(
1091           from._internal_call_stack_profile());
1092     }
1093     if (cached_has_bits & 0x00000008u) {
1094       _this->_internal_mutable_perf_stat()->::metrics::PerfStatProto::MergeFrom(
1095           from._internal_perf_stat());
1096     }
1097     if (cached_has_bits & 0x00000010u) {
1098       _this->_impl_.ms_after_boot_ = from._impl_.ms_after_boot_;
1099     }
1100     if (cached_has_bits & 0x00000020u) {
1101       _this->_impl_.ms_after_login_ = from._impl_.ms_after_login_;
1102     }
1103     if (cached_has_bits & 0x00000040u) {
1104       _this->_impl_.trigger_event_ = from._impl_.trigger_event_;
1105     }
1106     if (cached_has_bits & 0x00000080u) {
1107       _this->_impl_.num_tabs_restored_ = from._impl_.num_tabs_restored_;
1108     }
1109     _this->_impl_._has_bits_[0] |= cached_has_bits;
1110   }
1111   if (cached_has_bits & 0x0000ff00u) {
1112     if (cached_has_bits & 0x00000100u) {
1113       _this->_impl_.suspend_duration_ms_ = from._impl_.suspend_duration_ms_;
1114     }
1115     if (cached_has_bits & 0x00000200u) {
1116       _this->_impl_.ms_after_resume_ = from._impl_.ms_after_resume_;
1117     }
1118     if (cached_has_bits & 0x00000400u) {
1119       _this->_impl_.ms_after_restore_ = from._impl_.ms_after_restore_;
1120     }
1121     if (cached_has_bits & 0x00000800u) {
1122       _this->_impl_.process_ = from._impl_.process_;
1123     }
1124     if (cached_has_bits & 0x00001000u) {
1125       _this->_impl_.thread_ = from._impl_.thread_;
1126     }
1127     if (cached_has_bits & 0x00002000u) {
1128       _this->_impl_.psi_cpu_last_10s_pct_ = from._impl_.psi_cpu_last_10s_pct_;
1129     }
1130     if (cached_has_bits & 0x00004000u) {
1131       _this->_impl_.psi_cpu_last_60s_pct_ = from._impl_.psi_cpu_last_60s_pct_;
1132     }
1133     if (cached_has_bits & 0x00008000u) {
1134       _this->_impl_.lacros_channel_ = from._impl_.lacros_channel_;
1135     }
1136     _this->_impl_._has_bits_[0] |= cached_has_bits;
1137   }
1138   if (cached_has_bits & 0x00030000u) {
1139     if (cached_has_bits & 0x00010000u) {
1140       _this->_impl_.thermal_state_ = from._impl_.thermal_state_;
1141     }
1142     if (cached_has_bits & 0x00020000u) {
1143       _this->_impl_.cpu_speed_limit_percent_ = from._impl_.cpu_speed_limit_percent_;
1144     }
1145     _this->_impl_._has_bits_[0] |= cached_has_bits;
1146   }
1147   _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1148 }
1149 
CopyFrom(const SampledProfile & from)1150 void SampledProfile::CopyFrom(const SampledProfile& from) {
1151 // @@protoc_insertion_point(class_specific_copy_from_start:metrics.SampledProfile)
1152   if (&from == this) return;
1153   Clear();
1154   MergeFrom(from);
1155 }
1156 
IsInitialized() const1157 bool SampledProfile::IsInitialized() const {
1158   return true;
1159 }
1160 
InternalSwap(SampledProfile * other)1161 void SampledProfile::InternalSwap(SampledProfile* other) {
1162   using std::swap;
1163   auto* lhs_arena = GetArenaForAllocation();
1164   auto* rhs_arena = other->GetArenaForAllocation();
1165   _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1166   swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1167   _impl_.process_types_.InternalSwap(&other->_impl_.process_types_);
1168   _impl_.thread_types_.InternalSwap(&other->_impl_.thread_types_);
1169   _impl_.cpu_max_frequency_mhz_.InternalSwap(&other->_impl_.cpu_max_frequency_mhz_);
1170   _impl_.lacros_pids_.InternalSwap(&other->_impl_.lacros_pids_);
1171   ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1172       &_impl_.lacros_version_, lhs_arena,
1173       &other->_impl_.lacros_version_, rhs_arena
1174   );
1175   ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1176       PROTOBUF_FIELD_OFFSET(SampledProfile, _impl_.cpu_speed_limit_percent_)
1177       + sizeof(SampledProfile::_impl_.cpu_speed_limit_percent_)
1178       - PROTOBUF_FIELD_OFFSET(SampledProfile, _impl_.perf_data_)>(
1179           reinterpret_cast<char*>(&_impl_.perf_data_),
1180           reinterpret_cast<char*>(&other->_impl_.perf_data_));
1181 }
1182 
GetTypeName() const1183 std::string SampledProfile::GetTypeName() const {
1184   return "metrics.SampledProfile";
1185 }
1186 
1187 
1188 // @@protoc_insertion_point(namespace_scope)
1189 }  // namespace metrics
1190 PROTOBUF_NAMESPACE_OPEN
1191 template<> PROTOBUF_NOINLINE ::metrics::SampledProfile_ProcessTypesEntry_DoNotUse*
CreateMaybeMessage(Arena * arena)1192 Arena::CreateMaybeMessage< ::metrics::SampledProfile_ProcessTypesEntry_DoNotUse >(Arena* arena) {
1193   return Arena::CreateMessageInternal< ::metrics::SampledProfile_ProcessTypesEntry_DoNotUse >(arena);
1194 }
1195 template<> PROTOBUF_NOINLINE ::metrics::SampledProfile_ThreadTypesEntry_DoNotUse*
CreateMaybeMessage(Arena * arena)1196 Arena::CreateMaybeMessage< ::metrics::SampledProfile_ThreadTypesEntry_DoNotUse >(Arena* arena) {
1197   return Arena::CreateMessageInternal< ::metrics::SampledProfile_ThreadTypesEntry_DoNotUse >(arena);
1198 }
1199 template<> PROTOBUF_NOINLINE ::metrics::SampledProfile*
CreateMaybeMessage(Arena * arena)1200 Arena::CreateMaybeMessage< ::metrics::SampledProfile >(Arena* arena) {
1201   return Arena::CreateMessageInternal< ::metrics::SampledProfile >(arena);
1202 }
1203 PROTOBUF_NAMESPACE_CLOSE
1204 
1205 // @@protoc_insertion_point(global_scope)
1206 #include <google/protobuf/port_undef.inc>
1207