1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/config/sys_stats/sys_stats_config.proto
3
4 #include "protos/perfetto/config/sys_stats/sys_stats_config.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 {
SysStatsConfig(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR SysStatsConfig::SysStatsConfig(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.meminfo_counters_)*/{}
28 , /*decltype(_impl_.vmstat_counters_)*/{}
29 , /*decltype(_impl_.stat_counters_)*/{}
30 , /*decltype(_impl_.meminfo_period_ms_)*/0u
31 , /*decltype(_impl_.vmstat_period_ms_)*/0u
32 , /*decltype(_impl_.stat_period_ms_)*/0u
33 , /*decltype(_impl_.devfreq_period_ms_)*/0u
34 , /*decltype(_impl_.cpufreq_period_ms_)*/0u
35 , /*decltype(_impl_.buddyinfo_period_ms_)*/0u
36 , /*decltype(_impl_.diskstat_period_ms_)*/0u
37 , /*decltype(_impl_.psi_period_ms_)*/0u
38 , /*decltype(_impl_.thermal_period_ms_)*/0u
39 , /*decltype(_impl_.cpuidle_period_ms_)*/0u
40 , /*decltype(_impl_.gpufreq_period_ms_)*/0u} {}
41 struct SysStatsConfigDefaultTypeInternal {
SysStatsConfigDefaultTypeInternalperfetto::protos::SysStatsConfigDefaultTypeInternal42 PROTOBUF_CONSTEXPR SysStatsConfigDefaultTypeInternal()
43 : _instance(::_pbi::ConstantInitialized{}) {}
~SysStatsConfigDefaultTypeInternalperfetto::protos::SysStatsConfigDefaultTypeInternal44 ~SysStatsConfigDefaultTypeInternal() {}
45 union { // NOLINT(misc-non-private-member-variables-in-classes)
46 SysStatsConfig _instance;
47 };
48 };
49 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 SysStatsConfigDefaultTypeInternal _SysStatsConfig_default_instance_;
50 } // namespace protos
51 } // namespace perfetto
52 namespace perfetto {
53 namespace protos {
SysStatsConfig_StatCounters_IsValid(int value)54 bool SysStatsConfig_StatCounters_IsValid(int value) {
55 switch (value) {
56 case 0:
57 case 1:
58 case 2:
59 case 3:
60 case 4:
61 return true;
62 default:
63 return false;
64 }
65 }
66
67 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> SysStatsConfig_StatCounters_strings[5] = {};
68
69 static const char SysStatsConfig_StatCounters_names[] =
70 "STAT_CPU_TIMES"
71 "STAT_FORK_COUNT"
72 "STAT_IRQ_COUNTS"
73 "STAT_SOFTIRQ_COUNTS"
74 "STAT_UNSPECIFIED";
75
76 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry SysStatsConfig_StatCounters_entries[] = {
77 { {SysStatsConfig_StatCounters_names + 0, 14}, 1 },
78 { {SysStatsConfig_StatCounters_names + 14, 15}, 4 },
79 { {SysStatsConfig_StatCounters_names + 29, 15}, 2 },
80 { {SysStatsConfig_StatCounters_names + 44, 19}, 3 },
81 { {SysStatsConfig_StatCounters_names + 63, 16}, 0 },
82 };
83
84 static const int SysStatsConfig_StatCounters_entries_by_number[] = {
85 4, // 0 -> STAT_UNSPECIFIED
86 0, // 1 -> STAT_CPU_TIMES
87 2, // 2 -> STAT_IRQ_COUNTS
88 3, // 3 -> STAT_SOFTIRQ_COUNTS
89 1, // 4 -> STAT_FORK_COUNT
90 };
91
SysStatsConfig_StatCounters_Name(SysStatsConfig_StatCounters value)92 const std::string& SysStatsConfig_StatCounters_Name(
93 SysStatsConfig_StatCounters value) {
94 static const bool dummy =
95 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
96 SysStatsConfig_StatCounters_entries,
97 SysStatsConfig_StatCounters_entries_by_number,
98 5, SysStatsConfig_StatCounters_strings);
99 (void) dummy;
100 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
101 SysStatsConfig_StatCounters_entries,
102 SysStatsConfig_StatCounters_entries_by_number,
103 5, value);
104 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
105 SysStatsConfig_StatCounters_strings[idx].get();
106 }
SysStatsConfig_StatCounters_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,SysStatsConfig_StatCounters * value)107 bool SysStatsConfig_StatCounters_Parse(
108 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, SysStatsConfig_StatCounters* value) {
109 int int_value;
110 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
111 SysStatsConfig_StatCounters_entries, 5, name, &int_value);
112 if (success) {
113 *value = static_cast<SysStatsConfig_StatCounters>(int_value);
114 }
115 return success;
116 }
117 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
118 constexpr SysStatsConfig_StatCounters SysStatsConfig::STAT_UNSPECIFIED;
119 constexpr SysStatsConfig_StatCounters SysStatsConfig::STAT_CPU_TIMES;
120 constexpr SysStatsConfig_StatCounters SysStatsConfig::STAT_IRQ_COUNTS;
121 constexpr SysStatsConfig_StatCounters SysStatsConfig::STAT_SOFTIRQ_COUNTS;
122 constexpr SysStatsConfig_StatCounters SysStatsConfig::STAT_FORK_COUNT;
123 constexpr SysStatsConfig_StatCounters SysStatsConfig::StatCounters_MIN;
124 constexpr SysStatsConfig_StatCounters SysStatsConfig::StatCounters_MAX;
125 constexpr int SysStatsConfig::StatCounters_ARRAYSIZE;
126 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
127
128 // ===================================================================
129
130 class SysStatsConfig::_Internal {
131 public:
132 using HasBits = decltype(std::declval<SysStatsConfig>()._impl_._has_bits_);
set_has_meminfo_period_ms(HasBits * has_bits)133 static void set_has_meminfo_period_ms(HasBits* has_bits) {
134 (*has_bits)[0] |= 1u;
135 }
set_has_vmstat_period_ms(HasBits * has_bits)136 static void set_has_vmstat_period_ms(HasBits* has_bits) {
137 (*has_bits)[0] |= 2u;
138 }
set_has_stat_period_ms(HasBits * has_bits)139 static void set_has_stat_period_ms(HasBits* has_bits) {
140 (*has_bits)[0] |= 4u;
141 }
set_has_devfreq_period_ms(HasBits * has_bits)142 static void set_has_devfreq_period_ms(HasBits* has_bits) {
143 (*has_bits)[0] |= 8u;
144 }
set_has_cpufreq_period_ms(HasBits * has_bits)145 static void set_has_cpufreq_period_ms(HasBits* has_bits) {
146 (*has_bits)[0] |= 16u;
147 }
set_has_buddyinfo_period_ms(HasBits * has_bits)148 static void set_has_buddyinfo_period_ms(HasBits* has_bits) {
149 (*has_bits)[0] |= 32u;
150 }
set_has_diskstat_period_ms(HasBits * has_bits)151 static void set_has_diskstat_period_ms(HasBits* has_bits) {
152 (*has_bits)[0] |= 64u;
153 }
set_has_psi_period_ms(HasBits * has_bits)154 static void set_has_psi_period_ms(HasBits* has_bits) {
155 (*has_bits)[0] |= 128u;
156 }
set_has_thermal_period_ms(HasBits * has_bits)157 static void set_has_thermal_period_ms(HasBits* has_bits) {
158 (*has_bits)[0] |= 256u;
159 }
set_has_cpuidle_period_ms(HasBits * has_bits)160 static void set_has_cpuidle_period_ms(HasBits* has_bits) {
161 (*has_bits)[0] |= 512u;
162 }
set_has_gpufreq_period_ms(HasBits * has_bits)163 static void set_has_gpufreq_period_ms(HasBits* has_bits) {
164 (*has_bits)[0] |= 1024u;
165 }
166 };
167
SysStatsConfig(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)168 SysStatsConfig::SysStatsConfig(::PROTOBUF_NAMESPACE_ID::Arena* arena,
169 bool is_message_owned)
170 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
171 SharedCtor(arena, is_message_owned);
172 // @@protoc_insertion_point(arena_constructor:perfetto.protos.SysStatsConfig)
173 }
SysStatsConfig(const SysStatsConfig & from)174 SysStatsConfig::SysStatsConfig(const SysStatsConfig& from)
175 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
176 SysStatsConfig* const _this = this; (void)_this;
177 new (&_impl_) Impl_{
178 decltype(_impl_._has_bits_){from._impl_._has_bits_}
179 , /*decltype(_impl_._cached_size_)*/{}
180 , decltype(_impl_.meminfo_counters_){from._impl_.meminfo_counters_}
181 , decltype(_impl_.vmstat_counters_){from._impl_.vmstat_counters_}
182 , decltype(_impl_.stat_counters_){from._impl_.stat_counters_}
183 , decltype(_impl_.meminfo_period_ms_){}
184 , decltype(_impl_.vmstat_period_ms_){}
185 , decltype(_impl_.stat_period_ms_){}
186 , decltype(_impl_.devfreq_period_ms_){}
187 , decltype(_impl_.cpufreq_period_ms_){}
188 , decltype(_impl_.buddyinfo_period_ms_){}
189 , decltype(_impl_.diskstat_period_ms_){}
190 , decltype(_impl_.psi_period_ms_){}
191 , decltype(_impl_.thermal_period_ms_){}
192 , decltype(_impl_.cpuidle_period_ms_){}
193 , decltype(_impl_.gpufreq_period_ms_){}};
194
195 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
196 ::memcpy(&_impl_.meminfo_period_ms_, &from._impl_.meminfo_period_ms_,
197 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.gpufreq_period_ms_) -
198 reinterpret_cast<char*>(&_impl_.meminfo_period_ms_)) + sizeof(_impl_.gpufreq_period_ms_));
199 // @@protoc_insertion_point(copy_constructor:perfetto.protos.SysStatsConfig)
200 }
201
SharedCtor(::_pb::Arena * arena,bool is_message_owned)202 inline void SysStatsConfig::SharedCtor(
203 ::_pb::Arena* arena, bool is_message_owned) {
204 (void)arena;
205 (void)is_message_owned;
206 new (&_impl_) Impl_{
207 decltype(_impl_._has_bits_){}
208 , /*decltype(_impl_._cached_size_)*/{}
209 , decltype(_impl_.meminfo_counters_){arena}
210 , decltype(_impl_.vmstat_counters_){arena}
211 , decltype(_impl_.stat_counters_){arena}
212 , decltype(_impl_.meminfo_period_ms_){0u}
213 , decltype(_impl_.vmstat_period_ms_){0u}
214 , decltype(_impl_.stat_period_ms_){0u}
215 , decltype(_impl_.devfreq_period_ms_){0u}
216 , decltype(_impl_.cpufreq_period_ms_){0u}
217 , decltype(_impl_.buddyinfo_period_ms_){0u}
218 , decltype(_impl_.diskstat_period_ms_){0u}
219 , decltype(_impl_.psi_period_ms_){0u}
220 , decltype(_impl_.thermal_period_ms_){0u}
221 , decltype(_impl_.cpuidle_period_ms_){0u}
222 , decltype(_impl_.gpufreq_period_ms_){0u}
223 };
224 }
225
~SysStatsConfig()226 SysStatsConfig::~SysStatsConfig() {
227 // @@protoc_insertion_point(destructor:perfetto.protos.SysStatsConfig)
228 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
229 (void)arena;
230 return;
231 }
232 SharedDtor();
233 }
234
SharedDtor()235 inline void SysStatsConfig::SharedDtor() {
236 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
237 _impl_.meminfo_counters_.~RepeatedField();
238 _impl_.vmstat_counters_.~RepeatedField();
239 _impl_.stat_counters_.~RepeatedField();
240 }
241
SetCachedSize(int size) const242 void SysStatsConfig::SetCachedSize(int size) const {
243 _impl_._cached_size_.Set(size);
244 }
245
Clear()246 void SysStatsConfig::Clear() {
247 // @@protoc_insertion_point(message_clear_start:perfetto.protos.SysStatsConfig)
248 ::uint32_t cached_has_bits = 0;
249 // Prevent compiler warnings about cached_has_bits being unused
250 (void) cached_has_bits;
251
252 _impl_.meminfo_counters_.Clear();
253 _impl_.vmstat_counters_.Clear();
254 _impl_.stat_counters_.Clear();
255 cached_has_bits = _impl_._has_bits_[0];
256 if (cached_has_bits & 0x000000ffu) {
257 ::memset(&_impl_.meminfo_period_ms_, 0, static_cast<size_t>(
258 reinterpret_cast<char*>(&_impl_.psi_period_ms_) -
259 reinterpret_cast<char*>(&_impl_.meminfo_period_ms_)) + sizeof(_impl_.psi_period_ms_));
260 }
261 if (cached_has_bits & 0x00000700u) {
262 ::memset(&_impl_.thermal_period_ms_, 0, static_cast<size_t>(
263 reinterpret_cast<char*>(&_impl_.gpufreq_period_ms_) -
264 reinterpret_cast<char*>(&_impl_.thermal_period_ms_)) + sizeof(_impl_.gpufreq_period_ms_));
265 }
266 _impl_._has_bits_.Clear();
267 _internal_metadata_.Clear<std::string>();
268 }
269
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)270 const char* SysStatsConfig::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
271 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
272 _Internal::HasBits has_bits{};
273 while (!ctx->Done(&ptr)) {
274 ::uint32_t tag;
275 ptr = ::_pbi::ReadTag(ptr, &tag);
276 switch (tag >> 3) {
277 // optional uint32 meminfo_period_ms = 1;
278 case 1:
279 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
280 _Internal::set_has_meminfo_period_ms(&has_bits);
281 _impl_.meminfo_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
282 CHK_(ptr);
283 } else {
284 goto handle_unusual;
285 }
286 continue;
287 // repeated .perfetto.protos.MeminfoCounters meminfo_counters = 2;
288 case 2:
289 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
290 ptr -= 1;
291 do {
292 ptr += 1;
293 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
294 CHK_(ptr);
295 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::MeminfoCounters_IsValid(val))) {
296 _internal_add_meminfo_counters(static_cast<::perfetto::protos::MeminfoCounters>(val));
297 } else {
298 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(2, val, mutable_unknown_fields());
299 }
300 if (!ctx->DataAvailable(ptr)) break;
301 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<16>(ptr));
302 } else if (static_cast<::uint8_t>(tag) == 18) {
303 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_meminfo_counters(), ptr, ctx, ::perfetto::protos::MeminfoCounters_IsValid, &_internal_metadata_, 2);
304 CHK_(ptr);
305 } else {
306 goto handle_unusual;
307 }
308 continue;
309 // optional uint32 vmstat_period_ms = 3;
310 case 3:
311 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
312 _Internal::set_has_vmstat_period_ms(&has_bits);
313 _impl_.vmstat_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
314 CHK_(ptr);
315 } else {
316 goto handle_unusual;
317 }
318 continue;
319 // repeated .perfetto.protos.VmstatCounters vmstat_counters = 4;
320 case 4:
321 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
322 ptr -= 1;
323 do {
324 ptr += 1;
325 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
326 CHK_(ptr);
327 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::VmstatCounters_IsValid(val))) {
328 _internal_add_vmstat_counters(static_cast<::perfetto::protos::VmstatCounters>(val));
329 } else {
330 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(4, val, mutable_unknown_fields());
331 }
332 if (!ctx->DataAvailable(ptr)) break;
333 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<32>(ptr));
334 } else if (static_cast<::uint8_t>(tag) == 34) {
335 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_vmstat_counters(), ptr, ctx, ::perfetto::protos::VmstatCounters_IsValid, &_internal_metadata_, 4);
336 CHK_(ptr);
337 } else {
338 goto handle_unusual;
339 }
340 continue;
341 // optional uint32 stat_period_ms = 5;
342 case 5:
343 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
344 _Internal::set_has_stat_period_ms(&has_bits);
345 _impl_.stat_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
346 CHK_(ptr);
347 } else {
348 goto handle_unusual;
349 }
350 continue;
351 // repeated .perfetto.protos.SysStatsConfig.StatCounters stat_counters = 6;
352 case 6:
353 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
354 ptr -= 1;
355 do {
356 ptr += 1;
357 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
358 CHK_(ptr);
359 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::SysStatsConfig_StatCounters_IsValid(val))) {
360 _internal_add_stat_counters(static_cast<::perfetto::protos::SysStatsConfig_StatCounters>(val));
361 } else {
362 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(6, val, mutable_unknown_fields());
363 }
364 if (!ctx->DataAvailable(ptr)) break;
365 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<48>(ptr));
366 } else if (static_cast<::uint8_t>(tag) == 50) {
367 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_stat_counters(), ptr, ctx, ::perfetto::protos::SysStatsConfig_StatCounters_IsValid, &_internal_metadata_, 6);
368 CHK_(ptr);
369 } else {
370 goto handle_unusual;
371 }
372 continue;
373 // optional uint32 devfreq_period_ms = 7;
374 case 7:
375 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
376 _Internal::set_has_devfreq_period_ms(&has_bits);
377 _impl_.devfreq_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
378 CHK_(ptr);
379 } else {
380 goto handle_unusual;
381 }
382 continue;
383 // optional uint32 cpufreq_period_ms = 8;
384 case 8:
385 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
386 _Internal::set_has_cpufreq_period_ms(&has_bits);
387 _impl_.cpufreq_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
388 CHK_(ptr);
389 } else {
390 goto handle_unusual;
391 }
392 continue;
393 // optional uint32 buddyinfo_period_ms = 9;
394 case 9:
395 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
396 _Internal::set_has_buddyinfo_period_ms(&has_bits);
397 _impl_.buddyinfo_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
398 CHK_(ptr);
399 } else {
400 goto handle_unusual;
401 }
402 continue;
403 // optional uint32 diskstat_period_ms = 10;
404 case 10:
405 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
406 _Internal::set_has_diskstat_period_ms(&has_bits);
407 _impl_.diskstat_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
408 CHK_(ptr);
409 } else {
410 goto handle_unusual;
411 }
412 continue;
413 // optional uint32 psi_period_ms = 11;
414 case 11:
415 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
416 _Internal::set_has_psi_period_ms(&has_bits);
417 _impl_.psi_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
418 CHK_(ptr);
419 } else {
420 goto handle_unusual;
421 }
422 continue;
423 // optional uint32 thermal_period_ms = 12;
424 case 12:
425 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 96)) {
426 _Internal::set_has_thermal_period_ms(&has_bits);
427 _impl_.thermal_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
428 CHK_(ptr);
429 } else {
430 goto handle_unusual;
431 }
432 continue;
433 // optional uint32 cpuidle_period_ms = 13;
434 case 13:
435 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 104)) {
436 _Internal::set_has_cpuidle_period_ms(&has_bits);
437 _impl_.cpuidle_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
438 CHK_(ptr);
439 } else {
440 goto handle_unusual;
441 }
442 continue;
443 // optional uint32 gpufreq_period_ms = 14;
444 case 14:
445 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 112)) {
446 _Internal::set_has_gpufreq_period_ms(&has_bits);
447 _impl_.gpufreq_period_ms_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
448 CHK_(ptr);
449 } else {
450 goto handle_unusual;
451 }
452 continue;
453 default:
454 goto handle_unusual;
455 } // switch
456 handle_unusual:
457 if ((tag == 0) || ((tag & 7) == 4)) {
458 CHK_(ptr);
459 ctx->SetLastTag(tag);
460 goto message_done;
461 }
462 ptr = UnknownFieldParse(
463 tag,
464 _internal_metadata_.mutable_unknown_fields<std::string>(),
465 ptr, ctx);
466 CHK_(ptr != nullptr);
467 } // while
468 message_done:
469 _impl_._has_bits_.Or(has_bits);
470 return ptr;
471 failure:
472 ptr = nullptr;
473 goto message_done;
474 #undef CHK_
475 }
476
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const477 ::uint8_t* SysStatsConfig::_InternalSerialize(
478 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
479 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.SysStatsConfig)
480 ::uint32_t cached_has_bits = 0;
481 (void) cached_has_bits;
482
483 cached_has_bits = _impl_._has_bits_[0];
484 // optional uint32 meminfo_period_ms = 1;
485 if (cached_has_bits & 0x00000001u) {
486 target = stream->EnsureSpace(target);
487 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_meminfo_period_ms(), target);
488 }
489
490 // repeated .perfetto.protos.MeminfoCounters meminfo_counters = 2;
491 for (int i = 0, n = this->_internal_meminfo_counters_size(); i < n; i++) {
492 target = stream->EnsureSpace(target);
493 target = ::_pbi::WireFormatLite::WriteEnumToArray(
494 2, this->_internal_meminfo_counters(i), target);
495 }
496
497 // optional uint32 vmstat_period_ms = 3;
498 if (cached_has_bits & 0x00000002u) {
499 target = stream->EnsureSpace(target);
500 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(3, this->_internal_vmstat_period_ms(), target);
501 }
502
503 // repeated .perfetto.protos.VmstatCounters vmstat_counters = 4;
504 for (int i = 0, n = this->_internal_vmstat_counters_size(); i < n; i++) {
505 target = stream->EnsureSpace(target);
506 target = ::_pbi::WireFormatLite::WriteEnumToArray(
507 4, this->_internal_vmstat_counters(i), target);
508 }
509
510 // optional uint32 stat_period_ms = 5;
511 if (cached_has_bits & 0x00000004u) {
512 target = stream->EnsureSpace(target);
513 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_stat_period_ms(), target);
514 }
515
516 // repeated .perfetto.protos.SysStatsConfig.StatCounters stat_counters = 6;
517 for (int i = 0, n = this->_internal_stat_counters_size(); i < n; i++) {
518 target = stream->EnsureSpace(target);
519 target = ::_pbi::WireFormatLite::WriteEnumToArray(
520 6, this->_internal_stat_counters(i), target);
521 }
522
523 // optional uint32 devfreq_period_ms = 7;
524 if (cached_has_bits & 0x00000008u) {
525 target = stream->EnsureSpace(target);
526 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(7, this->_internal_devfreq_period_ms(), target);
527 }
528
529 // optional uint32 cpufreq_period_ms = 8;
530 if (cached_has_bits & 0x00000010u) {
531 target = stream->EnsureSpace(target);
532 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(8, this->_internal_cpufreq_period_ms(), target);
533 }
534
535 // optional uint32 buddyinfo_period_ms = 9;
536 if (cached_has_bits & 0x00000020u) {
537 target = stream->EnsureSpace(target);
538 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(9, this->_internal_buddyinfo_period_ms(), target);
539 }
540
541 // optional uint32 diskstat_period_ms = 10;
542 if (cached_has_bits & 0x00000040u) {
543 target = stream->EnsureSpace(target);
544 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(10, this->_internal_diskstat_period_ms(), target);
545 }
546
547 // optional uint32 psi_period_ms = 11;
548 if (cached_has_bits & 0x00000080u) {
549 target = stream->EnsureSpace(target);
550 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(11, this->_internal_psi_period_ms(), target);
551 }
552
553 // optional uint32 thermal_period_ms = 12;
554 if (cached_has_bits & 0x00000100u) {
555 target = stream->EnsureSpace(target);
556 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(12, this->_internal_thermal_period_ms(), target);
557 }
558
559 // optional uint32 cpuidle_period_ms = 13;
560 if (cached_has_bits & 0x00000200u) {
561 target = stream->EnsureSpace(target);
562 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(13, this->_internal_cpuidle_period_ms(), target);
563 }
564
565 // optional uint32 gpufreq_period_ms = 14;
566 if (cached_has_bits & 0x00000400u) {
567 target = stream->EnsureSpace(target);
568 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(14, this->_internal_gpufreq_period_ms(), target);
569 }
570
571 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
572 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
573 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
574 }
575 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.SysStatsConfig)
576 return target;
577 }
578
ByteSizeLong() const579 size_t SysStatsConfig::ByteSizeLong() const {
580 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.SysStatsConfig)
581 size_t total_size = 0;
582
583 ::uint32_t cached_has_bits = 0;
584 // Prevent compiler warnings about cached_has_bits being unused
585 (void) cached_has_bits;
586
587 // repeated .perfetto.protos.MeminfoCounters meminfo_counters = 2;
588 {
589 size_t data_size = 0;
590 unsigned int count = static_cast<unsigned int>(this->_internal_meminfo_counters_size());for (unsigned int i = 0; i < count; i++) {
591 data_size += ::_pbi::WireFormatLite::EnumSize(
592 this->_internal_meminfo_counters(static_cast<int>(i)));
593 }
594 total_size += (1UL * count) + data_size;
595 }
596
597 // repeated .perfetto.protos.VmstatCounters vmstat_counters = 4;
598 {
599 size_t data_size = 0;
600 unsigned int count = static_cast<unsigned int>(this->_internal_vmstat_counters_size());for (unsigned int i = 0; i < count; i++) {
601 data_size += ::_pbi::WireFormatLite::EnumSize(
602 this->_internal_vmstat_counters(static_cast<int>(i)));
603 }
604 total_size += (1UL * count) + data_size;
605 }
606
607 // repeated .perfetto.protos.SysStatsConfig.StatCounters stat_counters = 6;
608 {
609 size_t data_size = 0;
610 unsigned int count = static_cast<unsigned int>(this->_internal_stat_counters_size());for (unsigned int i = 0; i < count; i++) {
611 data_size += ::_pbi::WireFormatLite::EnumSize(
612 this->_internal_stat_counters(static_cast<int>(i)));
613 }
614 total_size += (1UL * count) + data_size;
615 }
616
617 cached_has_bits = _impl_._has_bits_[0];
618 if (cached_has_bits & 0x000000ffu) {
619 // optional uint32 meminfo_period_ms = 1;
620 if (cached_has_bits & 0x00000001u) {
621 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_meminfo_period_ms());
622 }
623
624 // optional uint32 vmstat_period_ms = 3;
625 if (cached_has_bits & 0x00000002u) {
626 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_vmstat_period_ms());
627 }
628
629 // optional uint32 stat_period_ms = 5;
630 if (cached_has_bits & 0x00000004u) {
631 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_stat_period_ms());
632 }
633
634 // optional uint32 devfreq_period_ms = 7;
635 if (cached_has_bits & 0x00000008u) {
636 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_devfreq_period_ms());
637 }
638
639 // optional uint32 cpufreq_period_ms = 8;
640 if (cached_has_bits & 0x00000010u) {
641 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_cpufreq_period_ms());
642 }
643
644 // optional uint32 buddyinfo_period_ms = 9;
645 if (cached_has_bits & 0x00000020u) {
646 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_buddyinfo_period_ms());
647 }
648
649 // optional uint32 diskstat_period_ms = 10;
650 if (cached_has_bits & 0x00000040u) {
651 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_diskstat_period_ms());
652 }
653
654 // optional uint32 psi_period_ms = 11;
655 if (cached_has_bits & 0x00000080u) {
656 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_psi_period_ms());
657 }
658
659 }
660 if (cached_has_bits & 0x00000700u) {
661 // optional uint32 thermal_period_ms = 12;
662 if (cached_has_bits & 0x00000100u) {
663 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_thermal_period_ms());
664 }
665
666 // optional uint32 cpuidle_period_ms = 13;
667 if (cached_has_bits & 0x00000200u) {
668 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_cpuidle_period_ms());
669 }
670
671 // optional uint32 gpufreq_period_ms = 14;
672 if (cached_has_bits & 0x00000400u) {
673 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_gpufreq_period_ms());
674 }
675
676 }
677 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
678 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
679 }
680 int cached_size = ::_pbi::ToCachedSize(total_size);
681 SetCachedSize(cached_size);
682 return total_size;
683 }
684
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)685 void SysStatsConfig::CheckTypeAndMergeFrom(
686 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
687 MergeFrom(*::_pbi::DownCast<const SysStatsConfig*>(
688 &from));
689 }
690
MergeFrom(const SysStatsConfig & from)691 void SysStatsConfig::MergeFrom(const SysStatsConfig& from) {
692 SysStatsConfig* const _this = this;
693 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.SysStatsConfig)
694 GOOGLE_DCHECK_NE(&from, _this);
695 ::uint32_t cached_has_bits = 0;
696 (void) cached_has_bits;
697
698 _this->_impl_.meminfo_counters_.MergeFrom(from._impl_.meminfo_counters_);
699 _this->_impl_.vmstat_counters_.MergeFrom(from._impl_.vmstat_counters_);
700 _this->_impl_.stat_counters_.MergeFrom(from._impl_.stat_counters_);
701 cached_has_bits = from._impl_._has_bits_[0];
702 if (cached_has_bits & 0x000000ffu) {
703 if (cached_has_bits & 0x00000001u) {
704 _this->_impl_.meminfo_period_ms_ = from._impl_.meminfo_period_ms_;
705 }
706 if (cached_has_bits & 0x00000002u) {
707 _this->_impl_.vmstat_period_ms_ = from._impl_.vmstat_period_ms_;
708 }
709 if (cached_has_bits & 0x00000004u) {
710 _this->_impl_.stat_period_ms_ = from._impl_.stat_period_ms_;
711 }
712 if (cached_has_bits & 0x00000008u) {
713 _this->_impl_.devfreq_period_ms_ = from._impl_.devfreq_period_ms_;
714 }
715 if (cached_has_bits & 0x00000010u) {
716 _this->_impl_.cpufreq_period_ms_ = from._impl_.cpufreq_period_ms_;
717 }
718 if (cached_has_bits & 0x00000020u) {
719 _this->_impl_.buddyinfo_period_ms_ = from._impl_.buddyinfo_period_ms_;
720 }
721 if (cached_has_bits & 0x00000040u) {
722 _this->_impl_.diskstat_period_ms_ = from._impl_.diskstat_period_ms_;
723 }
724 if (cached_has_bits & 0x00000080u) {
725 _this->_impl_.psi_period_ms_ = from._impl_.psi_period_ms_;
726 }
727 _this->_impl_._has_bits_[0] |= cached_has_bits;
728 }
729 if (cached_has_bits & 0x00000700u) {
730 if (cached_has_bits & 0x00000100u) {
731 _this->_impl_.thermal_period_ms_ = from._impl_.thermal_period_ms_;
732 }
733 if (cached_has_bits & 0x00000200u) {
734 _this->_impl_.cpuidle_period_ms_ = from._impl_.cpuidle_period_ms_;
735 }
736 if (cached_has_bits & 0x00000400u) {
737 _this->_impl_.gpufreq_period_ms_ = from._impl_.gpufreq_period_ms_;
738 }
739 _this->_impl_._has_bits_[0] |= cached_has_bits;
740 }
741 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
742 }
743
CopyFrom(const SysStatsConfig & from)744 void SysStatsConfig::CopyFrom(const SysStatsConfig& from) {
745 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.SysStatsConfig)
746 if (&from == this) return;
747 Clear();
748 MergeFrom(from);
749 }
750
IsInitialized() const751 bool SysStatsConfig::IsInitialized() const {
752 return true;
753 }
754
InternalSwap(SysStatsConfig * other)755 void SysStatsConfig::InternalSwap(SysStatsConfig* other) {
756 using std::swap;
757 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
758 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
759 _impl_.meminfo_counters_.InternalSwap(&other->_impl_.meminfo_counters_);
760 _impl_.vmstat_counters_.InternalSwap(&other->_impl_.vmstat_counters_);
761 _impl_.stat_counters_.InternalSwap(&other->_impl_.stat_counters_);
762 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
763 PROTOBUF_FIELD_OFFSET(SysStatsConfig, _impl_.gpufreq_period_ms_)
764 + sizeof(SysStatsConfig::_impl_.gpufreq_period_ms_) // NOLINT
765 - PROTOBUF_FIELD_OFFSET(SysStatsConfig, _impl_.meminfo_period_ms_)>(
766 reinterpret_cast<char*>(&_impl_.meminfo_period_ms_),
767 reinterpret_cast<char*>(&other->_impl_.meminfo_period_ms_));
768 }
769
GetTypeName() const770 std::string SysStatsConfig::GetTypeName() const {
771 return "perfetto.protos.SysStatsConfig";
772 }
773
774
775 // @@protoc_insertion_point(namespace_scope)
776 } // namespace protos
777 } // namespace perfetto
778 PROTOBUF_NAMESPACE_OPEN
779 template<> PROTOBUF_NOINLINE ::perfetto::protos::SysStatsConfig*
CreateMaybeMessage(Arena * arena)780 Arena::CreateMaybeMessage< ::perfetto::protos::SysStatsConfig >(Arena* arena) {
781 return Arena::CreateMessageInternal< ::perfetto::protos::SysStatsConfig >(arena);
782 }
783 PROTOBUF_NAMESPACE_CLOSE
784
785 // @@protoc_insertion_point(global_scope)
786 #include <google/protobuf/port_undef.inc>
787