1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/common/gpu_counter_descriptor.proto
3
4 #include "protos/perfetto/common/gpu_counter_descriptor.pb.h"
5
6 #include <algorithm>
7 #include <cstdint>
8
9 #include <google/protobuf/io/coded_stream.h>
10 #include <google/protobuf/extension_set.h>
11 #include <google/protobuf/wire_format_lite.h>
12 #include <google/protobuf/io/zero_copy_stream_impl_lite.h>
13 // @@protoc_insertion_point(includes)
14 #include <google/protobuf/port_def.inc>
15
16 PROTOBUF_PRAGMA_INIT_SEG
17
18 namespace _pb = ::PROTOBUF_NAMESPACE_ID;
19 namespace _pbi = _pb::internal;
20
21 namespace perfetto {
22 namespace protos {
GpuCounterDescriptor_GpuCounterSpec(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR GpuCounterDescriptor_GpuCounterSpec::GpuCounterDescriptor_GpuCounterSpec(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.numerator_units_)*/{}
28 , /*decltype(_impl_.denominator_units_)*/{}
29 , /*decltype(_impl_.groups_)*/{}
30 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
31 , /*decltype(_impl_.description_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
32 , /*decltype(_impl_.counter_id_)*/0u
33 , /*decltype(_impl_.select_by_default_)*/false
34 , /*decltype(_impl_.peak_value_)*/{}
35 , /*decltype(_impl_._oneof_case_)*/{}} {}
36 struct GpuCounterDescriptor_GpuCounterSpecDefaultTypeInternal {
GpuCounterDescriptor_GpuCounterSpecDefaultTypeInternalperfetto::protos::GpuCounterDescriptor_GpuCounterSpecDefaultTypeInternal37 PROTOBUF_CONSTEXPR GpuCounterDescriptor_GpuCounterSpecDefaultTypeInternal()
38 : _instance(::_pbi::ConstantInitialized{}) {}
~GpuCounterDescriptor_GpuCounterSpecDefaultTypeInternalperfetto::protos::GpuCounterDescriptor_GpuCounterSpecDefaultTypeInternal39 ~GpuCounterDescriptor_GpuCounterSpecDefaultTypeInternal() {}
40 union { // NOLINT(misc-non-private-member-variables-in-classes)
41 GpuCounterDescriptor_GpuCounterSpec _instance;
42 };
43 };
44 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GpuCounterDescriptor_GpuCounterSpecDefaultTypeInternal _GpuCounterDescriptor_GpuCounterSpec_default_instance_;
GpuCounterDescriptor_GpuCounterBlock(::_pbi::ConstantInitialized)45 PROTOBUF_CONSTEXPR GpuCounterDescriptor_GpuCounterBlock::GpuCounterDescriptor_GpuCounterBlock(
46 ::_pbi::ConstantInitialized): _impl_{
47 /*decltype(_impl_._has_bits_)*/{}
48 , /*decltype(_impl_._cached_size_)*/{}
49 , /*decltype(_impl_.counter_ids_)*/{}
50 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
51 , /*decltype(_impl_.description_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
52 , /*decltype(_impl_.block_id_)*/0u
53 , /*decltype(_impl_.block_capacity_)*/0u} {}
54 struct GpuCounterDescriptor_GpuCounterBlockDefaultTypeInternal {
GpuCounterDescriptor_GpuCounterBlockDefaultTypeInternalperfetto::protos::GpuCounterDescriptor_GpuCounterBlockDefaultTypeInternal55 PROTOBUF_CONSTEXPR GpuCounterDescriptor_GpuCounterBlockDefaultTypeInternal()
56 : _instance(::_pbi::ConstantInitialized{}) {}
~GpuCounterDescriptor_GpuCounterBlockDefaultTypeInternalperfetto::protos::GpuCounterDescriptor_GpuCounterBlockDefaultTypeInternal57 ~GpuCounterDescriptor_GpuCounterBlockDefaultTypeInternal() {}
58 union { // NOLINT(misc-non-private-member-variables-in-classes)
59 GpuCounterDescriptor_GpuCounterBlock _instance;
60 };
61 };
62 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GpuCounterDescriptor_GpuCounterBlockDefaultTypeInternal _GpuCounterDescriptor_GpuCounterBlock_default_instance_;
GpuCounterDescriptor(::_pbi::ConstantInitialized)63 PROTOBUF_CONSTEXPR GpuCounterDescriptor::GpuCounterDescriptor(
64 ::_pbi::ConstantInitialized): _impl_{
65 /*decltype(_impl_._has_bits_)*/{}
66 , /*decltype(_impl_._cached_size_)*/{}
67 , /*decltype(_impl_.specs_)*/{}
68 , /*decltype(_impl_.blocks_)*/{}
69 , /*decltype(_impl_.min_sampling_period_ns_)*/::uint64_t{0u}
70 , /*decltype(_impl_.max_sampling_period_ns_)*/::uint64_t{0u}
71 , /*decltype(_impl_.supports_instrumented_sampling_)*/false} {}
72 struct GpuCounterDescriptorDefaultTypeInternal {
GpuCounterDescriptorDefaultTypeInternalperfetto::protos::GpuCounterDescriptorDefaultTypeInternal73 PROTOBUF_CONSTEXPR GpuCounterDescriptorDefaultTypeInternal()
74 : _instance(::_pbi::ConstantInitialized{}) {}
~GpuCounterDescriptorDefaultTypeInternalperfetto::protos::GpuCounterDescriptorDefaultTypeInternal75 ~GpuCounterDescriptorDefaultTypeInternal() {}
76 union { // NOLINT(misc-non-private-member-variables-in-classes)
77 GpuCounterDescriptor _instance;
78 };
79 };
80 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 GpuCounterDescriptorDefaultTypeInternal _GpuCounterDescriptor_default_instance_;
81 } // namespace protos
82 } // namespace perfetto
83 namespace perfetto {
84 namespace protos {
GpuCounterDescriptor_GpuCounterGroup_IsValid(int value)85 bool GpuCounterDescriptor_GpuCounterGroup_IsValid(int value) {
86 switch (value) {
87 case 0:
88 case 1:
89 case 2:
90 case 3:
91 case 4:
92 case 5:
93 case 6:
94 return true;
95 default:
96 return false;
97 }
98 }
99
100 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> GpuCounterDescriptor_GpuCounterGroup_strings[7] = {};
101
102 static const char GpuCounterDescriptor_GpuCounterGroup_names[] =
103 "COMPUTE"
104 "FRAGMENTS"
105 "MEMORY"
106 "PRIMITIVES"
107 "SYSTEM"
108 "UNCLASSIFIED"
109 "VERTICES";
110
111 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry GpuCounterDescriptor_GpuCounterGroup_entries[] = {
112 { {GpuCounterDescriptor_GpuCounterGroup_names + 0, 7}, 6 },
113 { {GpuCounterDescriptor_GpuCounterGroup_names + 7, 9}, 3 },
114 { {GpuCounterDescriptor_GpuCounterGroup_names + 16, 6}, 5 },
115 { {GpuCounterDescriptor_GpuCounterGroup_names + 22, 10}, 4 },
116 { {GpuCounterDescriptor_GpuCounterGroup_names + 32, 6}, 1 },
117 { {GpuCounterDescriptor_GpuCounterGroup_names + 38, 12}, 0 },
118 { {GpuCounterDescriptor_GpuCounterGroup_names + 50, 8}, 2 },
119 };
120
121 static const int GpuCounterDescriptor_GpuCounterGroup_entries_by_number[] = {
122 5, // 0 -> UNCLASSIFIED
123 4, // 1 -> SYSTEM
124 6, // 2 -> VERTICES
125 1, // 3 -> FRAGMENTS
126 3, // 4 -> PRIMITIVES
127 2, // 5 -> MEMORY
128 0, // 6 -> COMPUTE
129 };
130
GpuCounterDescriptor_GpuCounterGroup_Name(GpuCounterDescriptor_GpuCounterGroup value)131 const std::string& GpuCounterDescriptor_GpuCounterGroup_Name(
132 GpuCounterDescriptor_GpuCounterGroup value) {
133 static const bool dummy =
134 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
135 GpuCounterDescriptor_GpuCounterGroup_entries,
136 GpuCounterDescriptor_GpuCounterGroup_entries_by_number,
137 7, GpuCounterDescriptor_GpuCounterGroup_strings);
138 (void) dummy;
139 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
140 GpuCounterDescriptor_GpuCounterGroup_entries,
141 GpuCounterDescriptor_GpuCounterGroup_entries_by_number,
142 7, value);
143 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
144 GpuCounterDescriptor_GpuCounterGroup_strings[idx].get();
145 }
GpuCounterDescriptor_GpuCounterGroup_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,GpuCounterDescriptor_GpuCounterGroup * value)146 bool GpuCounterDescriptor_GpuCounterGroup_Parse(
147 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GpuCounterDescriptor_GpuCounterGroup* value) {
148 int int_value;
149 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
150 GpuCounterDescriptor_GpuCounterGroup_entries, 7, name, &int_value);
151 if (success) {
152 *value = static_cast<GpuCounterDescriptor_GpuCounterGroup>(int_value);
153 }
154 return success;
155 }
156 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
157 constexpr GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor::UNCLASSIFIED;
158 constexpr GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor::SYSTEM;
159 constexpr GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor::VERTICES;
160 constexpr GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor::FRAGMENTS;
161 constexpr GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor::PRIMITIVES;
162 constexpr GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor::MEMORY;
163 constexpr GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor::COMPUTE;
164 constexpr GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor::GpuCounterGroup_MIN;
165 constexpr GpuCounterDescriptor_GpuCounterGroup GpuCounterDescriptor::GpuCounterGroup_MAX;
166 constexpr int GpuCounterDescriptor::GpuCounterGroup_ARRAYSIZE;
167 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
GpuCounterDescriptor_MeasureUnit_IsValid(int value)168 bool GpuCounterDescriptor_MeasureUnit_IsValid(int value) {
169 switch (value) {
170 case 0:
171 case 1:
172 case 2:
173 case 3:
174 case 4:
175 case 5:
176 case 6:
177 case 7:
178 case 8:
179 case 9:
180 case 10:
181 case 11:
182 case 12:
183 case 13:
184 case 14:
185 case 15:
186 case 16:
187 case 17:
188 case 18:
189 case 19:
190 case 20:
191 case 21:
192 case 22:
193 case 23:
194 case 24:
195 case 25:
196 case 26:
197 case 27:
198 case 28:
199 case 29:
200 case 30:
201 case 31:
202 case 32:
203 case 33:
204 case 34:
205 case 35:
206 case 36:
207 case 37:
208 case 38:
209 case 39:
210 case 40:
211 return true;
212 default:
213 return false;
214 }
215 }
216
217 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> GpuCounterDescriptor_MeasureUnit_strings[41] = {};
218
219 static const char GpuCounterDescriptor_MeasureUnit_names[] =
220 "AMPERE"
221 "BIT"
222 "BYTE"
223 "CELSIUS"
224 "FAHRENHEIT"
225 "FRAGMENT"
226 "GIGABIT"
227 "GIGABYTE"
228 "GIGAHERTZ"
229 "HERTZ"
230 "HOUR"
231 "INSTRUCTION"
232 "JOULE"
233 "KELVIN"
234 "KILOBIT"
235 "KILOBYTE"
236 "KILOHERTZ"
237 "KILOWATT"
238 "MEGABIT"
239 "MEGABYTE"
240 "MEGAHERTZ"
241 "MICROSECOND"
242 "MILLISECOND"
243 "MILLIWATT"
244 "MINUTE"
245 "NANOSECOND"
246 "NONE"
247 "PERCENT"
248 "PETABIT"
249 "PETABYTE"
250 "PETAHERTZ"
251 "PIXEL"
252 "PRIMITIVE"
253 "SECOND"
254 "TERABIT"
255 "TERABYTE"
256 "TERAHERTZ"
257 "TRIANGLE"
258 "VERTEX"
259 "VOLT"
260 "WATT";
261
262 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry GpuCounterDescriptor_MeasureUnit_entries[] = {
263 { {GpuCounterDescriptor_MeasureUnit_names + 0, 6}, 33 },
264 { {GpuCounterDescriptor_MeasureUnit_names + 6, 3}, 1 },
265 { {GpuCounterDescriptor_MeasureUnit_names + 9, 4}, 7 },
266 { {GpuCounterDescriptor_MeasureUnit_names + 13, 7}, 34 },
267 { {GpuCounterDescriptor_MeasureUnit_names + 20, 10}, 35 },
268 { {GpuCounterDescriptor_MeasureUnit_names + 30, 8}, 39 },
269 { {GpuCounterDescriptor_MeasureUnit_names + 38, 7}, 4 },
270 { {GpuCounterDescriptor_MeasureUnit_names + 45, 8}, 10 },
271 { {GpuCounterDescriptor_MeasureUnit_names + 53, 9}, 16 },
272 { {GpuCounterDescriptor_MeasureUnit_names + 62, 5}, 13 },
273 { {GpuCounterDescriptor_MeasureUnit_names + 67, 4}, 24 },
274 { {GpuCounterDescriptor_MeasureUnit_names + 71, 11}, 40 },
275 { {GpuCounterDescriptor_MeasureUnit_names + 82, 5}, 31 },
276 { {GpuCounterDescriptor_MeasureUnit_names + 87, 6}, 36 },
277 { {GpuCounterDescriptor_MeasureUnit_names + 93, 7}, 2 },
278 { {GpuCounterDescriptor_MeasureUnit_names + 100, 8}, 8 },
279 { {GpuCounterDescriptor_MeasureUnit_names + 108, 9}, 14 },
280 { {GpuCounterDescriptor_MeasureUnit_names + 117, 8}, 30 },
281 { {GpuCounterDescriptor_MeasureUnit_names + 125, 7}, 3 },
282 { {GpuCounterDescriptor_MeasureUnit_names + 132, 8}, 9 },
283 { {GpuCounterDescriptor_MeasureUnit_names + 140, 9}, 15 },
284 { {GpuCounterDescriptor_MeasureUnit_names + 149, 11}, 20 },
285 { {GpuCounterDescriptor_MeasureUnit_names + 160, 11}, 21 },
286 { {GpuCounterDescriptor_MeasureUnit_names + 171, 9}, 28 },
287 { {GpuCounterDescriptor_MeasureUnit_names + 180, 6}, 23 },
288 { {GpuCounterDescriptor_MeasureUnit_names + 186, 10}, 19 },
289 { {GpuCounterDescriptor_MeasureUnit_names + 196, 4}, 0 },
290 { {GpuCounterDescriptor_MeasureUnit_names + 200, 7}, 37 },
291 { {GpuCounterDescriptor_MeasureUnit_names + 207, 7}, 6 },
292 { {GpuCounterDescriptor_MeasureUnit_names + 214, 8}, 12 },
293 { {GpuCounterDescriptor_MeasureUnit_names + 222, 9}, 18 },
294 { {GpuCounterDescriptor_MeasureUnit_names + 231, 5}, 26 },
295 { {GpuCounterDescriptor_MeasureUnit_names + 236, 9}, 38 },
296 { {GpuCounterDescriptor_MeasureUnit_names + 245, 6}, 22 },
297 { {GpuCounterDescriptor_MeasureUnit_names + 251, 7}, 5 },
298 { {GpuCounterDescriptor_MeasureUnit_names + 258, 8}, 11 },
299 { {GpuCounterDescriptor_MeasureUnit_names + 266, 9}, 17 },
300 { {GpuCounterDescriptor_MeasureUnit_names + 275, 8}, 27 },
301 { {GpuCounterDescriptor_MeasureUnit_names + 283, 6}, 25 },
302 { {GpuCounterDescriptor_MeasureUnit_names + 289, 4}, 32 },
303 { {GpuCounterDescriptor_MeasureUnit_names + 293, 4}, 29 },
304 };
305
306 static const int GpuCounterDescriptor_MeasureUnit_entries_by_number[] = {
307 26, // 0 -> NONE
308 1, // 1 -> BIT
309 14, // 2 -> KILOBIT
310 18, // 3 -> MEGABIT
311 6, // 4 -> GIGABIT
312 34, // 5 -> TERABIT
313 28, // 6 -> PETABIT
314 2, // 7 -> BYTE
315 15, // 8 -> KILOBYTE
316 19, // 9 -> MEGABYTE
317 7, // 10 -> GIGABYTE
318 35, // 11 -> TERABYTE
319 29, // 12 -> PETABYTE
320 9, // 13 -> HERTZ
321 16, // 14 -> KILOHERTZ
322 20, // 15 -> MEGAHERTZ
323 8, // 16 -> GIGAHERTZ
324 36, // 17 -> TERAHERTZ
325 30, // 18 -> PETAHERTZ
326 25, // 19 -> NANOSECOND
327 21, // 20 -> MICROSECOND
328 22, // 21 -> MILLISECOND
329 33, // 22 -> SECOND
330 24, // 23 -> MINUTE
331 10, // 24 -> HOUR
332 38, // 25 -> VERTEX
333 31, // 26 -> PIXEL
334 37, // 27 -> TRIANGLE
335 23, // 28 -> MILLIWATT
336 40, // 29 -> WATT
337 17, // 30 -> KILOWATT
338 12, // 31 -> JOULE
339 39, // 32 -> VOLT
340 0, // 33 -> AMPERE
341 3, // 34 -> CELSIUS
342 4, // 35 -> FAHRENHEIT
343 13, // 36 -> KELVIN
344 27, // 37 -> PERCENT
345 32, // 38 -> PRIMITIVE
346 5, // 39 -> FRAGMENT
347 11, // 40 -> INSTRUCTION
348 };
349
GpuCounterDescriptor_MeasureUnit_Name(GpuCounterDescriptor_MeasureUnit value)350 const std::string& GpuCounterDescriptor_MeasureUnit_Name(
351 GpuCounterDescriptor_MeasureUnit value) {
352 static const bool dummy =
353 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
354 GpuCounterDescriptor_MeasureUnit_entries,
355 GpuCounterDescriptor_MeasureUnit_entries_by_number,
356 41, GpuCounterDescriptor_MeasureUnit_strings);
357 (void) dummy;
358 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
359 GpuCounterDescriptor_MeasureUnit_entries,
360 GpuCounterDescriptor_MeasureUnit_entries_by_number,
361 41, value);
362 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
363 GpuCounterDescriptor_MeasureUnit_strings[idx].get();
364 }
GpuCounterDescriptor_MeasureUnit_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,GpuCounterDescriptor_MeasureUnit * value)365 bool GpuCounterDescriptor_MeasureUnit_Parse(
366 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, GpuCounterDescriptor_MeasureUnit* value) {
367 int int_value;
368 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
369 GpuCounterDescriptor_MeasureUnit_entries, 41, name, &int_value);
370 if (success) {
371 *value = static_cast<GpuCounterDescriptor_MeasureUnit>(int_value);
372 }
373 return success;
374 }
375 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
376 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::NONE;
377 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::BIT;
378 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::KILOBIT;
379 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::MEGABIT;
380 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::GIGABIT;
381 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::TERABIT;
382 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::PETABIT;
383 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::BYTE;
384 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::KILOBYTE;
385 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::MEGABYTE;
386 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::GIGABYTE;
387 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::TERABYTE;
388 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::PETABYTE;
389 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::HERTZ;
390 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::KILOHERTZ;
391 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::MEGAHERTZ;
392 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::GIGAHERTZ;
393 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::TERAHERTZ;
394 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::PETAHERTZ;
395 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::NANOSECOND;
396 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::MICROSECOND;
397 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::MILLISECOND;
398 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::SECOND;
399 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::MINUTE;
400 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::HOUR;
401 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::VERTEX;
402 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::PIXEL;
403 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::TRIANGLE;
404 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::PRIMITIVE;
405 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::FRAGMENT;
406 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::MILLIWATT;
407 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::WATT;
408 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::KILOWATT;
409 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::JOULE;
410 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::VOLT;
411 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::AMPERE;
412 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::CELSIUS;
413 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::FAHRENHEIT;
414 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::KELVIN;
415 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::PERCENT;
416 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::INSTRUCTION;
417 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::MeasureUnit_MIN;
418 constexpr GpuCounterDescriptor_MeasureUnit GpuCounterDescriptor::MeasureUnit_MAX;
419 constexpr int GpuCounterDescriptor::MeasureUnit_ARRAYSIZE;
420 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
421
422 // ===================================================================
423
424 class GpuCounterDescriptor_GpuCounterSpec::_Internal {
425 public:
426 using HasBits = decltype(std::declval<GpuCounterDescriptor_GpuCounterSpec>()._impl_._has_bits_);
set_has_counter_id(HasBits * has_bits)427 static void set_has_counter_id(HasBits* has_bits) {
428 (*has_bits)[0] |= 4u;
429 }
set_has_name(HasBits * has_bits)430 static void set_has_name(HasBits* has_bits) {
431 (*has_bits)[0] |= 1u;
432 }
set_has_description(HasBits * has_bits)433 static void set_has_description(HasBits* has_bits) {
434 (*has_bits)[0] |= 2u;
435 }
set_has_select_by_default(HasBits * has_bits)436 static void set_has_select_by_default(HasBits* has_bits) {
437 (*has_bits)[0] |= 8u;
438 }
439 };
440
GpuCounterDescriptor_GpuCounterSpec(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)441 GpuCounterDescriptor_GpuCounterSpec::GpuCounterDescriptor_GpuCounterSpec(::PROTOBUF_NAMESPACE_ID::Arena* arena,
442 bool is_message_owned)
443 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
444 SharedCtor(arena, is_message_owned);
445 // @@protoc_insertion_point(arena_constructor:perfetto.protos.GpuCounterDescriptor.GpuCounterSpec)
446 }
GpuCounterDescriptor_GpuCounterSpec(const GpuCounterDescriptor_GpuCounterSpec & from)447 GpuCounterDescriptor_GpuCounterSpec::GpuCounterDescriptor_GpuCounterSpec(const GpuCounterDescriptor_GpuCounterSpec& from)
448 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
449 GpuCounterDescriptor_GpuCounterSpec* const _this = this; (void)_this;
450 new (&_impl_) Impl_{
451 decltype(_impl_._has_bits_){from._impl_._has_bits_}
452 , /*decltype(_impl_._cached_size_)*/{}
453 , decltype(_impl_.numerator_units_){from._impl_.numerator_units_}
454 , decltype(_impl_.denominator_units_){from._impl_.denominator_units_}
455 , decltype(_impl_.groups_){from._impl_.groups_}
456 , decltype(_impl_.name_){}
457 , decltype(_impl_.description_){}
458 , decltype(_impl_.counter_id_){}
459 , decltype(_impl_.select_by_default_){}
460 , decltype(_impl_.peak_value_){}
461 , /*decltype(_impl_._oneof_case_)*/{}};
462
463 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
464 _impl_.name_.InitDefault();
465 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
466 _impl_.name_.Set("", GetArenaForAllocation());
467 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
468 if (from._internal_has_name()) {
469 _this->_impl_.name_.Set(from._internal_name(),
470 _this->GetArenaForAllocation());
471 }
472 _impl_.description_.InitDefault();
473 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
474 _impl_.description_.Set("", GetArenaForAllocation());
475 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
476 if (from._internal_has_description()) {
477 _this->_impl_.description_.Set(from._internal_description(),
478 _this->GetArenaForAllocation());
479 }
480 ::memcpy(&_impl_.counter_id_, &from._impl_.counter_id_,
481 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.select_by_default_) -
482 reinterpret_cast<char*>(&_impl_.counter_id_)) + sizeof(_impl_.select_by_default_));
483 clear_has_peak_value();
484 switch (from.peak_value_case()) {
485 case kIntPeakValue: {
486 _this->_internal_set_int_peak_value(from._internal_int_peak_value());
487 break;
488 }
489 case kDoublePeakValue: {
490 _this->_internal_set_double_peak_value(from._internal_double_peak_value());
491 break;
492 }
493 case PEAK_VALUE_NOT_SET: {
494 break;
495 }
496 }
497 // @@protoc_insertion_point(copy_constructor:perfetto.protos.GpuCounterDescriptor.GpuCounterSpec)
498 }
499
SharedCtor(::_pb::Arena * arena,bool is_message_owned)500 inline void GpuCounterDescriptor_GpuCounterSpec::SharedCtor(
501 ::_pb::Arena* arena, bool is_message_owned) {
502 (void)arena;
503 (void)is_message_owned;
504 new (&_impl_) Impl_{
505 decltype(_impl_._has_bits_){}
506 , /*decltype(_impl_._cached_size_)*/{}
507 , decltype(_impl_.numerator_units_){arena}
508 , decltype(_impl_.denominator_units_){arena}
509 , decltype(_impl_.groups_){arena}
510 , decltype(_impl_.name_){}
511 , decltype(_impl_.description_){}
512 , decltype(_impl_.counter_id_){0u}
513 , decltype(_impl_.select_by_default_){false}
514 , decltype(_impl_.peak_value_){}
515 , /*decltype(_impl_._oneof_case_)*/{}
516 };
517 _impl_.name_.InitDefault();
518 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
519 _impl_.name_.Set("", GetArenaForAllocation());
520 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
521 _impl_.description_.InitDefault();
522 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
523 _impl_.description_.Set("", GetArenaForAllocation());
524 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
525 clear_has_peak_value();
526 }
527
~GpuCounterDescriptor_GpuCounterSpec()528 GpuCounterDescriptor_GpuCounterSpec::~GpuCounterDescriptor_GpuCounterSpec() {
529 // @@protoc_insertion_point(destructor:perfetto.protos.GpuCounterDescriptor.GpuCounterSpec)
530 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
531 (void)arena;
532 return;
533 }
534 SharedDtor();
535 }
536
SharedDtor()537 inline void GpuCounterDescriptor_GpuCounterSpec::SharedDtor() {
538 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
539 _impl_.numerator_units_.~RepeatedField();
540 _impl_.denominator_units_.~RepeatedField();
541 _impl_.groups_.~RepeatedField();
542 _impl_.name_.Destroy();
543 _impl_.description_.Destroy();
544 if (has_peak_value()) {
545 clear_peak_value();
546 }
547 }
548
SetCachedSize(int size) const549 void GpuCounterDescriptor_GpuCounterSpec::SetCachedSize(int size) const {
550 _impl_._cached_size_.Set(size);
551 }
552
clear_peak_value()553 void GpuCounterDescriptor_GpuCounterSpec::clear_peak_value() {
554 // @@protoc_insertion_point(one_of_clear_start:perfetto.protos.GpuCounterDescriptor.GpuCounterSpec)
555 switch (peak_value_case()) {
556 case kIntPeakValue: {
557 // No need to clear
558 break;
559 }
560 case kDoublePeakValue: {
561 // No need to clear
562 break;
563 }
564 case PEAK_VALUE_NOT_SET: {
565 break;
566 }
567 }
568 _impl_._oneof_case_[0] = PEAK_VALUE_NOT_SET;
569 }
570
571
Clear()572 void GpuCounterDescriptor_GpuCounterSpec::Clear() {
573 // @@protoc_insertion_point(message_clear_start:perfetto.protos.GpuCounterDescriptor.GpuCounterSpec)
574 ::uint32_t cached_has_bits = 0;
575 // Prevent compiler warnings about cached_has_bits being unused
576 (void) cached_has_bits;
577
578 _impl_.numerator_units_.Clear();
579 _impl_.denominator_units_.Clear();
580 _impl_.groups_.Clear();
581 cached_has_bits = _impl_._has_bits_[0];
582 if (cached_has_bits & 0x00000003u) {
583 if (cached_has_bits & 0x00000001u) {
584 _impl_.name_.ClearNonDefaultToEmpty();
585 }
586 if (cached_has_bits & 0x00000002u) {
587 _impl_.description_.ClearNonDefaultToEmpty();
588 }
589 }
590 if (cached_has_bits & 0x0000000cu) {
591 ::memset(&_impl_.counter_id_, 0, static_cast<size_t>(
592 reinterpret_cast<char*>(&_impl_.select_by_default_) -
593 reinterpret_cast<char*>(&_impl_.counter_id_)) + sizeof(_impl_.select_by_default_));
594 }
595 clear_peak_value();
596 _impl_._has_bits_.Clear();
597 _internal_metadata_.Clear<std::string>();
598 }
599
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)600 const char* GpuCounterDescriptor_GpuCounterSpec::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
601 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
602 _Internal::HasBits has_bits{};
603 while (!ctx->Done(&ptr)) {
604 ::uint32_t tag;
605 ptr = ::_pbi::ReadTag(ptr, &tag);
606 switch (tag >> 3) {
607 // optional uint32 counter_id = 1;
608 case 1:
609 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
610 _Internal::set_has_counter_id(&has_bits);
611 _impl_.counter_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
612 CHK_(ptr);
613 } else {
614 goto handle_unusual;
615 }
616 continue;
617 // optional string name = 2;
618 case 2:
619 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
620 auto str = _internal_mutable_name();
621 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
622 CHK_(ptr);
623 } else {
624 goto handle_unusual;
625 }
626 continue;
627 // optional string description = 3;
628 case 3:
629 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
630 auto str = _internal_mutable_description();
631 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
632 CHK_(ptr);
633 } else {
634 goto handle_unusual;
635 }
636 continue;
637 // int64 int_peak_value = 5;
638 case 5:
639 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
640 _internal_set_int_peak_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
641 CHK_(ptr);
642 } else {
643 goto handle_unusual;
644 }
645 continue;
646 // double double_peak_value = 6;
647 case 6:
648 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 49)) {
649 _internal_set_double_peak_value(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
650 ptr += sizeof(double);
651 } else {
652 goto handle_unusual;
653 }
654 continue;
655 // repeated .perfetto.protos.GpuCounterDescriptor.MeasureUnit numerator_units = 7;
656 case 7:
657 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 56)) {
658 ptr -= 1;
659 do {
660 ptr += 1;
661 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
662 CHK_(ptr);
663 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::GpuCounterDescriptor_MeasureUnit_IsValid(val))) {
664 _internal_add_numerator_units(static_cast<::perfetto::protos::GpuCounterDescriptor_MeasureUnit>(val));
665 } else {
666 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(7, val, mutable_unknown_fields());
667 }
668 if (!ctx->DataAvailable(ptr)) break;
669 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<56>(ptr));
670 } else if (static_cast<::uint8_t>(tag) == 58) {
671 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_numerator_units(), ptr, ctx, ::perfetto::protos::GpuCounterDescriptor_MeasureUnit_IsValid, &_internal_metadata_, 7);
672 CHK_(ptr);
673 } else {
674 goto handle_unusual;
675 }
676 continue;
677 // repeated .perfetto.protos.GpuCounterDescriptor.MeasureUnit denominator_units = 8;
678 case 8:
679 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
680 ptr -= 1;
681 do {
682 ptr += 1;
683 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
684 CHK_(ptr);
685 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::GpuCounterDescriptor_MeasureUnit_IsValid(val))) {
686 _internal_add_denominator_units(static_cast<::perfetto::protos::GpuCounterDescriptor_MeasureUnit>(val));
687 } else {
688 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(8, val, mutable_unknown_fields());
689 }
690 if (!ctx->DataAvailable(ptr)) break;
691 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<64>(ptr));
692 } else if (static_cast<::uint8_t>(tag) == 66) {
693 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_denominator_units(), ptr, ctx, ::perfetto::protos::GpuCounterDescriptor_MeasureUnit_IsValid, &_internal_metadata_, 8);
694 CHK_(ptr);
695 } else {
696 goto handle_unusual;
697 }
698 continue;
699 // optional bool select_by_default = 9;
700 case 9:
701 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
702 _Internal::set_has_select_by_default(&has_bits);
703 _impl_.select_by_default_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
704 CHK_(ptr);
705 } else {
706 goto handle_unusual;
707 }
708 continue;
709 // repeated .perfetto.protos.GpuCounterDescriptor.GpuCounterGroup groups = 10;
710 case 10:
711 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
712 ptr -= 1;
713 do {
714 ptr += 1;
715 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
716 CHK_(ptr);
717 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::GpuCounterDescriptor_GpuCounterGroup_IsValid(val))) {
718 _internal_add_groups(static_cast<::perfetto::protos::GpuCounterDescriptor_GpuCounterGroup>(val));
719 } else {
720 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(10, val, mutable_unknown_fields());
721 }
722 if (!ctx->DataAvailable(ptr)) break;
723 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<80>(ptr));
724 } else if (static_cast<::uint8_t>(tag) == 82) {
725 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedEnumParser<std::string>(_internal_mutable_groups(), ptr, ctx, ::perfetto::protos::GpuCounterDescriptor_GpuCounterGroup_IsValid, &_internal_metadata_, 10);
726 CHK_(ptr);
727 } else {
728 goto handle_unusual;
729 }
730 continue;
731 default:
732 goto handle_unusual;
733 } // switch
734 handle_unusual:
735 if ((tag == 0) || ((tag & 7) == 4)) {
736 CHK_(ptr);
737 ctx->SetLastTag(tag);
738 goto message_done;
739 }
740 ptr = UnknownFieldParse(
741 tag,
742 _internal_metadata_.mutable_unknown_fields<std::string>(),
743 ptr, ctx);
744 CHK_(ptr != nullptr);
745 } // while
746 message_done:
747 _impl_._has_bits_.Or(has_bits);
748 return ptr;
749 failure:
750 ptr = nullptr;
751 goto message_done;
752 #undef CHK_
753 }
754
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const755 ::uint8_t* GpuCounterDescriptor_GpuCounterSpec::_InternalSerialize(
756 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
757 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.GpuCounterDescriptor.GpuCounterSpec)
758 ::uint32_t cached_has_bits = 0;
759 (void) cached_has_bits;
760
761 cached_has_bits = _impl_._has_bits_[0];
762 // optional uint32 counter_id = 1;
763 if (cached_has_bits & 0x00000004u) {
764 target = stream->EnsureSpace(target);
765 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_counter_id(), target);
766 }
767
768 // optional string name = 2;
769 if (cached_has_bits & 0x00000001u) {
770 target = stream->WriteStringMaybeAliased(
771 2, this->_internal_name(), target);
772 }
773
774 // optional string description = 3;
775 if (cached_has_bits & 0x00000002u) {
776 target = stream->WriteStringMaybeAliased(
777 3, this->_internal_description(), target);
778 }
779
780 switch (peak_value_case()) {
781 case kIntPeakValue: {
782 target = stream->EnsureSpace(target);
783 target = ::_pbi::WireFormatLite::WriteInt64ToArray(5, this->_internal_int_peak_value(), target);
784 break;
785 }
786 case kDoublePeakValue: {
787 target = stream->EnsureSpace(target);
788 target = ::_pbi::WireFormatLite::WriteDoubleToArray(6, this->_internal_double_peak_value(), target);
789 break;
790 }
791 default: ;
792 }
793 // repeated .perfetto.protos.GpuCounterDescriptor.MeasureUnit numerator_units = 7;
794 for (int i = 0, n = this->_internal_numerator_units_size(); i < n; i++) {
795 target = stream->EnsureSpace(target);
796 target = ::_pbi::WireFormatLite::WriteEnumToArray(
797 7, this->_internal_numerator_units(i), target);
798 }
799
800 // repeated .perfetto.protos.GpuCounterDescriptor.MeasureUnit denominator_units = 8;
801 for (int i = 0, n = this->_internal_denominator_units_size(); i < n; i++) {
802 target = stream->EnsureSpace(target);
803 target = ::_pbi::WireFormatLite::WriteEnumToArray(
804 8, this->_internal_denominator_units(i), target);
805 }
806
807 // optional bool select_by_default = 9;
808 if (cached_has_bits & 0x00000008u) {
809 target = stream->EnsureSpace(target);
810 target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_select_by_default(), target);
811 }
812
813 // repeated .perfetto.protos.GpuCounterDescriptor.GpuCounterGroup groups = 10;
814 for (int i = 0, n = this->_internal_groups_size(); i < n; i++) {
815 target = stream->EnsureSpace(target);
816 target = ::_pbi::WireFormatLite::WriteEnumToArray(
817 10, this->_internal_groups(i), target);
818 }
819
820 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
821 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
822 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
823 }
824 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.GpuCounterDescriptor.GpuCounterSpec)
825 return target;
826 }
827
ByteSizeLong() const828 size_t GpuCounterDescriptor_GpuCounterSpec::ByteSizeLong() const {
829 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.GpuCounterDescriptor.GpuCounterSpec)
830 size_t total_size = 0;
831
832 ::uint32_t cached_has_bits = 0;
833 // Prevent compiler warnings about cached_has_bits being unused
834 (void) cached_has_bits;
835
836 // repeated .perfetto.protos.GpuCounterDescriptor.MeasureUnit numerator_units = 7;
837 {
838 size_t data_size = 0;
839 unsigned int count = static_cast<unsigned int>(this->_internal_numerator_units_size());for (unsigned int i = 0; i < count; i++) {
840 data_size += ::_pbi::WireFormatLite::EnumSize(
841 this->_internal_numerator_units(static_cast<int>(i)));
842 }
843 total_size += (1UL * count) + data_size;
844 }
845
846 // repeated .perfetto.protos.GpuCounterDescriptor.MeasureUnit denominator_units = 8;
847 {
848 size_t data_size = 0;
849 unsigned int count = static_cast<unsigned int>(this->_internal_denominator_units_size());for (unsigned int i = 0; i < count; i++) {
850 data_size += ::_pbi::WireFormatLite::EnumSize(
851 this->_internal_denominator_units(static_cast<int>(i)));
852 }
853 total_size += (1UL * count) + data_size;
854 }
855
856 // repeated .perfetto.protos.GpuCounterDescriptor.GpuCounterGroup groups = 10;
857 {
858 size_t data_size = 0;
859 unsigned int count = static_cast<unsigned int>(this->_internal_groups_size());for (unsigned int i = 0; i < count; i++) {
860 data_size += ::_pbi::WireFormatLite::EnumSize(
861 this->_internal_groups(static_cast<int>(i)));
862 }
863 total_size += (1UL * count) + data_size;
864 }
865
866 cached_has_bits = _impl_._has_bits_[0];
867 if (cached_has_bits & 0x0000000fu) {
868 // optional string name = 2;
869 if (cached_has_bits & 0x00000001u) {
870 total_size += 1 +
871 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
872 this->_internal_name());
873 }
874
875 // optional string description = 3;
876 if (cached_has_bits & 0x00000002u) {
877 total_size += 1 +
878 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
879 this->_internal_description());
880 }
881
882 // optional uint32 counter_id = 1;
883 if (cached_has_bits & 0x00000004u) {
884 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_counter_id());
885 }
886
887 // optional bool select_by_default = 9;
888 if (cached_has_bits & 0x00000008u) {
889 total_size += 1 + 1;
890 }
891
892 }
893 switch (peak_value_case()) {
894 // int64 int_peak_value = 5;
895 case kIntPeakValue: {
896 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_int_peak_value());
897 break;
898 }
899 // double double_peak_value = 6;
900 case kDoublePeakValue: {
901 total_size += 1 + 8;
902 break;
903 }
904 case PEAK_VALUE_NOT_SET: {
905 break;
906 }
907 }
908 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
909 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
910 }
911 int cached_size = ::_pbi::ToCachedSize(total_size);
912 SetCachedSize(cached_size);
913 return total_size;
914 }
915
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)916 void GpuCounterDescriptor_GpuCounterSpec::CheckTypeAndMergeFrom(
917 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
918 MergeFrom(*::_pbi::DownCast<const GpuCounterDescriptor_GpuCounterSpec*>(
919 &from));
920 }
921
MergeFrom(const GpuCounterDescriptor_GpuCounterSpec & from)922 void GpuCounterDescriptor_GpuCounterSpec::MergeFrom(const GpuCounterDescriptor_GpuCounterSpec& from) {
923 GpuCounterDescriptor_GpuCounterSpec* const _this = this;
924 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.GpuCounterDescriptor.GpuCounterSpec)
925 GOOGLE_DCHECK_NE(&from, _this);
926 ::uint32_t cached_has_bits = 0;
927 (void) cached_has_bits;
928
929 _this->_impl_.numerator_units_.MergeFrom(from._impl_.numerator_units_);
930 _this->_impl_.denominator_units_.MergeFrom(from._impl_.denominator_units_);
931 _this->_impl_.groups_.MergeFrom(from._impl_.groups_);
932 cached_has_bits = from._impl_._has_bits_[0];
933 if (cached_has_bits & 0x0000000fu) {
934 if (cached_has_bits & 0x00000001u) {
935 _this->_internal_set_name(from._internal_name());
936 }
937 if (cached_has_bits & 0x00000002u) {
938 _this->_internal_set_description(from._internal_description());
939 }
940 if (cached_has_bits & 0x00000004u) {
941 _this->_impl_.counter_id_ = from._impl_.counter_id_;
942 }
943 if (cached_has_bits & 0x00000008u) {
944 _this->_impl_.select_by_default_ = from._impl_.select_by_default_;
945 }
946 _this->_impl_._has_bits_[0] |= cached_has_bits;
947 }
948 switch (from.peak_value_case()) {
949 case kIntPeakValue: {
950 _this->_internal_set_int_peak_value(from._internal_int_peak_value());
951 break;
952 }
953 case kDoublePeakValue: {
954 _this->_internal_set_double_peak_value(from._internal_double_peak_value());
955 break;
956 }
957 case PEAK_VALUE_NOT_SET: {
958 break;
959 }
960 }
961 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
962 }
963
CopyFrom(const GpuCounterDescriptor_GpuCounterSpec & from)964 void GpuCounterDescriptor_GpuCounterSpec::CopyFrom(const GpuCounterDescriptor_GpuCounterSpec& from) {
965 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.GpuCounterDescriptor.GpuCounterSpec)
966 if (&from == this) return;
967 Clear();
968 MergeFrom(from);
969 }
970
IsInitialized() const971 bool GpuCounterDescriptor_GpuCounterSpec::IsInitialized() const {
972 return true;
973 }
974
InternalSwap(GpuCounterDescriptor_GpuCounterSpec * other)975 void GpuCounterDescriptor_GpuCounterSpec::InternalSwap(GpuCounterDescriptor_GpuCounterSpec* other) {
976 using std::swap;
977 auto* lhs_arena = GetArenaForAllocation();
978 auto* rhs_arena = other->GetArenaForAllocation();
979 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
980 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
981 _impl_.numerator_units_.InternalSwap(&other->_impl_.numerator_units_);
982 _impl_.denominator_units_.InternalSwap(&other->_impl_.denominator_units_);
983 _impl_.groups_.InternalSwap(&other->_impl_.groups_);
984 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
985 &_impl_.name_, lhs_arena,
986 &other->_impl_.name_, rhs_arena
987 );
988 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
989 &_impl_.description_, lhs_arena,
990 &other->_impl_.description_, rhs_arena
991 );
992 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
993 PROTOBUF_FIELD_OFFSET(GpuCounterDescriptor_GpuCounterSpec, _impl_.select_by_default_)
994 + sizeof(GpuCounterDescriptor_GpuCounterSpec::_impl_.select_by_default_) // NOLINT
995 - PROTOBUF_FIELD_OFFSET(GpuCounterDescriptor_GpuCounterSpec, _impl_.counter_id_)>(
996 reinterpret_cast<char*>(&_impl_.counter_id_),
997 reinterpret_cast<char*>(&other->_impl_.counter_id_));
998 swap(_impl_.peak_value_, other->_impl_.peak_value_);
999 swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
1000 }
1001
GetTypeName() const1002 std::string GpuCounterDescriptor_GpuCounterSpec::GetTypeName() const {
1003 return "perfetto.protos.GpuCounterDescriptor.GpuCounterSpec";
1004 }
1005
1006
1007 // ===================================================================
1008
1009 class GpuCounterDescriptor_GpuCounterBlock::_Internal {
1010 public:
1011 using HasBits = decltype(std::declval<GpuCounterDescriptor_GpuCounterBlock>()._impl_._has_bits_);
set_has_block_id(HasBits * has_bits)1012 static void set_has_block_id(HasBits* has_bits) {
1013 (*has_bits)[0] |= 4u;
1014 }
set_has_block_capacity(HasBits * has_bits)1015 static void set_has_block_capacity(HasBits* has_bits) {
1016 (*has_bits)[0] |= 8u;
1017 }
set_has_name(HasBits * has_bits)1018 static void set_has_name(HasBits* has_bits) {
1019 (*has_bits)[0] |= 1u;
1020 }
set_has_description(HasBits * has_bits)1021 static void set_has_description(HasBits* has_bits) {
1022 (*has_bits)[0] |= 2u;
1023 }
1024 };
1025
GpuCounterDescriptor_GpuCounterBlock(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1026 GpuCounterDescriptor_GpuCounterBlock::GpuCounterDescriptor_GpuCounterBlock(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1027 bool is_message_owned)
1028 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1029 SharedCtor(arena, is_message_owned);
1030 // @@protoc_insertion_point(arena_constructor:perfetto.protos.GpuCounterDescriptor.GpuCounterBlock)
1031 }
GpuCounterDescriptor_GpuCounterBlock(const GpuCounterDescriptor_GpuCounterBlock & from)1032 GpuCounterDescriptor_GpuCounterBlock::GpuCounterDescriptor_GpuCounterBlock(const GpuCounterDescriptor_GpuCounterBlock& from)
1033 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1034 GpuCounterDescriptor_GpuCounterBlock* const _this = this; (void)_this;
1035 new (&_impl_) Impl_{
1036 decltype(_impl_._has_bits_){from._impl_._has_bits_}
1037 , /*decltype(_impl_._cached_size_)*/{}
1038 , decltype(_impl_.counter_ids_){from._impl_.counter_ids_}
1039 , decltype(_impl_.name_){}
1040 , decltype(_impl_.description_){}
1041 , decltype(_impl_.block_id_){}
1042 , decltype(_impl_.block_capacity_){}};
1043
1044 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1045 _impl_.name_.InitDefault();
1046 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1047 _impl_.name_.Set("", GetArenaForAllocation());
1048 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1049 if (from._internal_has_name()) {
1050 _this->_impl_.name_.Set(from._internal_name(),
1051 _this->GetArenaForAllocation());
1052 }
1053 _impl_.description_.InitDefault();
1054 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1055 _impl_.description_.Set("", GetArenaForAllocation());
1056 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1057 if (from._internal_has_description()) {
1058 _this->_impl_.description_.Set(from._internal_description(),
1059 _this->GetArenaForAllocation());
1060 }
1061 ::memcpy(&_impl_.block_id_, &from._impl_.block_id_,
1062 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.block_capacity_) -
1063 reinterpret_cast<char*>(&_impl_.block_id_)) + sizeof(_impl_.block_capacity_));
1064 // @@protoc_insertion_point(copy_constructor:perfetto.protos.GpuCounterDescriptor.GpuCounterBlock)
1065 }
1066
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1067 inline void GpuCounterDescriptor_GpuCounterBlock::SharedCtor(
1068 ::_pb::Arena* arena, bool is_message_owned) {
1069 (void)arena;
1070 (void)is_message_owned;
1071 new (&_impl_) Impl_{
1072 decltype(_impl_._has_bits_){}
1073 , /*decltype(_impl_._cached_size_)*/{}
1074 , decltype(_impl_.counter_ids_){arena}
1075 , decltype(_impl_.name_){}
1076 , decltype(_impl_.description_){}
1077 , decltype(_impl_.block_id_){0u}
1078 , decltype(_impl_.block_capacity_){0u}
1079 };
1080 _impl_.name_.InitDefault();
1081 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1082 _impl_.name_.Set("", GetArenaForAllocation());
1083 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1084 _impl_.description_.InitDefault();
1085 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
1086 _impl_.description_.Set("", GetArenaForAllocation());
1087 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
1088 }
1089
~GpuCounterDescriptor_GpuCounterBlock()1090 GpuCounterDescriptor_GpuCounterBlock::~GpuCounterDescriptor_GpuCounterBlock() {
1091 // @@protoc_insertion_point(destructor:perfetto.protos.GpuCounterDescriptor.GpuCounterBlock)
1092 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1093 (void)arena;
1094 return;
1095 }
1096 SharedDtor();
1097 }
1098
SharedDtor()1099 inline void GpuCounterDescriptor_GpuCounterBlock::SharedDtor() {
1100 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1101 _impl_.counter_ids_.~RepeatedField();
1102 _impl_.name_.Destroy();
1103 _impl_.description_.Destroy();
1104 }
1105
SetCachedSize(int size) const1106 void GpuCounterDescriptor_GpuCounterBlock::SetCachedSize(int size) const {
1107 _impl_._cached_size_.Set(size);
1108 }
1109
Clear()1110 void GpuCounterDescriptor_GpuCounterBlock::Clear() {
1111 // @@protoc_insertion_point(message_clear_start:perfetto.protos.GpuCounterDescriptor.GpuCounterBlock)
1112 ::uint32_t cached_has_bits = 0;
1113 // Prevent compiler warnings about cached_has_bits being unused
1114 (void) cached_has_bits;
1115
1116 _impl_.counter_ids_.Clear();
1117 cached_has_bits = _impl_._has_bits_[0];
1118 if (cached_has_bits & 0x00000003u) {
1119 if (cached_has_bits & 0x00000001u) {
1120 _impl_.name_.ClearNonDefaultToEmpty();
1121 }
1122 if (cached_has_bits & 0x00000002u) {
1123 _impl_.description_.ClearNonDefaultToEmpty();
1124 }
1125 }
1126 if (cached_has_bits & 0x0000000cu) {
1127 ::memset(&_impl_.block_id_, 0, static_cast<size_t>(
1128 reinterpret_cast<char*>(&_impl_.block_capacity_) -
1129 reinterpret_cast<char*>(&_impl_.block_id_)) + sizeof(_impl_.block_capacity_));
1130 }
1131 _impl_._has_bits_.Clear();
1132 _internal_metadata_.Clear<std::string>();
1133 }
1134
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1135 const char* GpuCounterDescriptor_GpuCounterBlock::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1136 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1137 _Internal::HasBits has_bits{};
1138 while (!ctx->Done(&ptr)) {
1139 ::uint32_t tag;
1140 ptr = ::_pbi::ReadTag(ptr, &tag);
1141 switch (tag >> 3) {
1142 // optional uint32 block_id = 1;
1143 case 1:
1144 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
1145 _Internal::set_has_block_id(&has_bits);
1146 _impl_.block_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1147 CHK_(ptr);
1148 } else {
1149 goto handle_unusual;
1150 }
1151 continue;
1152 // optional uint32 block_capacity = 2;
1153 case 2:
1154 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
1155 _Internal::set_has_block_capacity(&has_bits);
1156 _impl_.block_capacity_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
1157 CHK_(ptr);
1158 } else {
1159 goto handle_unusual;
1160 }
1161 continue;
1162 // optional string name = 3;
1163 case 3:
1164 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
1165 auto str = _internal_mutable_name();
1166 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
1167 CHK_(ptr);
1168 } else {
1169 goto handle_unusual;
1170 }
1171 continue;
1172 // optional string description = 4;
1173 case 4:
1174 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
1175 auto str = _internal_mutable_description();
1176 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
1177 CHK_(ptr);
1178 } else {
1179 goto handle_unusual;
1180 }
1181 continue;
1182 // repeated uint32 counter_ids = 5;
1183 case 5:
1184 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
1185 ptr -= 1;
1186 do {
1187 ptr += 1;
1188 _internal_add_counter_ids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr));
1189 CHK_(ptr);
1190 if (!ctx->DataAvailable(ptr)) break;
1191 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<40>(ptr));
1192 } else if (static_cast<::uint8_t>(tag) == 42) {
1193 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt32Parser(_internal_mutable_counter_ids(), ptr, ctx);
1194 CHK_(ptr);
1195 } else {
1196 goto handle_unusual;
1197 }
1198 continue;
1199 default:
1200 goto handle_unusual;
1201 } // switch
1202 handle_unusual:
1203 if ((tag == 0) || ((tag & 7) == 4)) {
1204 CHK_(ptr);
1205 ctx->SetLastTag(tag);
1206 goto message_done;
1207 }
1208 ptr = UnknownFieldParse(
1209 tag,
1210 _internal_metadata_.mutable_unknown_fields<std::string>(),
1211 ptr, ctx);
1212 CHK_(ptr != nullptr);
1213 } // while
1214 message_done:
1215 _impl_._has_bits_.Or(has_bits);
1216 return ptr;
1217 failure:
1218 ptr = nullptr;
1219 goto message_done;
1220 #undef CHK_
1221 }
1222
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1223 ::uint8_t* GpuCounterDescriptor_GpuCounterBlock::_InternalSerialize(
1224 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1225 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.GpuCounterDescriptor.GpuCounterBlock)
1226 ::uint32_t cached_has_bits = 0;
1227 (void) cached_has_bits;
1228
1229 cached_has_bits = _impl_._has_bits_[0];
1230 // optional uint32 block_id = 1;
1231 if (cached_has_bits & 0x00000004u) {
1232 target = stream->EnsureSpace(target);
1233 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(1, this->_internal_block_id(), target);
1234 }
1235
1236 // optional uint32 block_capacity = 2;
1237 if (cached_has_bits & 0x00000008u) {
1238 target = stream->EnsureSpace(target);
1239 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(2, this->_internal_block_capacity(), target);
1240 }
1241
1242 // optional string name = 3;
1243 if (cached_has_bits & 0x00000001u) {
1244 target = stream->WriteStringMaybeAliased(
1245 3, this->_internal_name(), target);
1246 }
1247
1248 // optional string description = 4;
1249 if (cached_has_bits & 0x00000002u) {
1250 target = stream->WriteStringMaybeAliased(
1251 4, this->_internal_description(), target);
1252 }
1253
1254 // repeated uint32 counter_ids = 5;
1255 for (int i = 0, n = this->_internal_counter_ids_size(); i < n; i++) {
1256 target = stream->EnsureSpace(target);
1257 target = ::_pbi::WireFormatLite::WriteUInt32ToArray(5, this->_internal_counter_ids(i), target);
1258 }
1259
1260 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1261 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1262 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1263 }
1264 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.GpuCounterDescriptor.GpuCounterBlock)
1265 return target;
1266 }
1267
ByteSizeLong() const1268 size_t GpuCounterDescriptor_GpuCounterBlock::ByteSizeLong() const {
1269 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.GpuCounterDescriptor.GpuCounterBlock)
1270 size_t total_size = 0;
1271
1272 ::uint32_t cached_has_bits = 0;
1273 // Prevent compiler warnings about cached_has_bits being unused
1274 (void) cached_has_bits;
1275
1276 // repeated uint32 counter_ids = 5;
1277 {
1278 size_t data_size = ::_pbi::WireFormatLite::
1279 UInt32Size(this->_impl_.counter_ids_);
1280 total_size += 1 *
1281 ::_pbi::FromIntSize(this->_internal_counter_ids_size());
1282 total_size += data_size;
1283 }
1284
1285 cached_has_bits = _impl_._has_bits_[0];
1286 if (cached_has_bits & 0x0000000fu) {
1287 // optional string name = 3;
1288 if (cached_has_bits & 0x00000001u) {
1289 total_size += 1 +
1290 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1291 this->_internal_name());
1292 }
1293
1294 // optional string description = 4;
1295 if (cached_has_bits & 0x00000002u) {
1296 total_size += 1 +
1297 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
1298 this->_internal_description());
1299 }
1300
1301 // optional uint32 block_id = 1;
1302 if (cached_has_bits & 0x00000004u) {
1303 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_block_id());
1304 }
1305
1306 // optional uint32 block_capacity = 2;
1307 if (cached_has_bits & 0x00000008u) {
1308 total_size += ::_pbi::WireFormatLite::UInt32SizePlusOne(this->_internal_block_capacity());
1309 }
1310
1311 }
1312 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1313 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1314 }
1315 int cached_size = ::_pbi::ToCachedSize(total_size);
1316 SetCachedSize(cached_size);
1317 return total_size;
1318 }
1319
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1320 void GpuCounterDescriptor_GpuCounterBlock::CheckTypeAndMergeFrom(
1321 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1322 MergeFrom(*::_pbi::DownCast<const GpuCounterDescriptor_GpuCounterBlock*>(
1323 &from));
1324 }
1325
MergeFrom(const GpuCounterDescriptor_GpuCounterBlock & from)1326 void GpuCounterDescriptor_GpuCounterBlock::MergeFrom(const GpuCounterDescriptor_GpuCounterBlock& from) {
1327 GpuCounterDescriptor_GpuCounterBlock* const _this = this;
1328 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.GpuCounterDescriptor.GpuCounterBlock)
1329 GOOGLE_DCHECK_NE(&from, _this);
1330 ::uint32_t cached_has_bits = 0;
1331 (void) cached_has_bits;
1332
1333 _this->_impl_.counter_ids_.MergeFrom(from._impl_.counter_ids_);
1334 cached_has_bits = from._impl_._has_bits_[0];
1335 if (cached_has_bits & 0x0000000fu) {
1336 if (cached_has_bits & 0x00000001u) {
1337 _this->_internal_set_name(from._internal_name());
1338 }
1339 if (cached_has_bits & 0x00000002u) {
1340 _this->_internal_set_description(from._internal_description());
1341 }
1342 if (cached_has_bits & 0x00000004u) {
1343 _this->_impl_.block_id_ = from._impl_.block_id_;
1344 }
1345 if (cached_has_bits & 0x00000008u) {
1346 _this->_impl_.block_capacity_ = from._impl_.block_capacity_;
1347 }
1348 _this->_impl_._has_bits_[0] |= cached_has_bits;
1349 }
1350 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1351 }
1352
CopyFrom(const GpuCounterDescriptor_GpuCounterBlock & from)1353 void GpuCounterDescriptor_GpuCounterBlock::CopyFrom(const GpuCounterDescriptor_GpuCounterBlock& from) {
1354 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.GpuCounterDescriptor.GpuCounterBlock)
1355 if (&from == this) return;
1356 Clear();
1357 MergeFrom(from);
1358 }
1359
IsInitialized() const1360 bool GpuCounterDescriptor_GpuCounterBlock::IsInitialized() const {
1361 return true;
1362 }
1363
InternalSwap(GpuCounterDescriptor_GpuCounterBlock * other)1364 void GpuCounterDescriptor_GpuCounterBlock::InternalSwap(GpuCounterDescriptor_GpuCounterBlock* other) {
1365 using std::swap;
1366 auto* lhs_arena = GetArenaForAllocation();
1367 auto* rhs_arena = other->GetArenaForAllocation();
1368 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1369 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1370 _impl_.counter_ids_.InternalSwap(&other->_impl_.counter_ids_);
1371 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1372 &_impl_.name_, lhs_arena,
1373 &other->_impl_.name_, rhs_arena
1374 );
1375 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1376 &_impl_.description_, lhs_arena,
1377 &other->_impl_.description_, rhs_arena
1378 );
1379 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1380 PROTOBUF_FIELD_OFFSET(GpuCounterDescriptor_GpuCounterBlock, _impl_.block_capacity_)
1381 + sizeof(GpuCounterDescriptor_GpuCounterBlock::_impl_.block_capacity_) // NOLINT
1382 - PROTOBUF_FIELD_OFFSET(GpuCounterDescriptor_GpuCounterBlock, _impl_.block_id_)>(
1383 reinterpret_cast<char*>(&_impl_.block_id_),
1384 reinterpret_cast<char*>(&other->_impl_.block_id_));
1385 }
1386
GetTypeName() const1387 std::string GpuCounterDescriptor_GpuCounterBlock::GetTypeName() const {
1388 return "perfetto.protos.GpuCounterDescriptor.GpuCounterBlock";
1389 }
1390
1391
1392 // ===================================================================
1393
1394 class GpuCounterDescriptor::_Internal {
1395 public:
1396 using HasBits = decltype(std::declval<GpuCounterDescriptor>()._impl_._has_bits_);
set_has_min_sampling_period_ns(HasBits * has_bits)1397 static void set_has_min_sampling_period_ns(HasBits* has_bits) {
1398 (*has_bits)[0] |= 1u;
1399 }
set_has_max_sampling_period_ns(HasBits * has_bits)1400 static void set_has_max_sampling_period_ns(HasBits* has_bits) {
1401 (*has_bits)[0] |= 2u;
1402 }
set_has_supports_instrumented_sampling(HasBits * has_bits)1403 static void set_has_supports_instrumented_sampling(HasBits* has_bits) {
1404 (*has_bits)[0] |= 4u;
1405 }
1406 };
1407
GpuCounterDescriptor(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1408 GpuCounterDescriptor::GpuCounterDescriptor(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1409 bool is_message_owned)
1410 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1411 SharedCtor(arena, is_message_owned);
1412 // @@protoc_insertion_point(arena_constructor:perfetto.protos.GpuCounterDescriptor)
1413 }
GpuCounterDescriptor(const GpuCounterDescriptor & from)1414 GpuCounterDescriptor::GpuCounterDescriptor(const GpuCounterDescriptor& from)
1415 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1416 GpuCounterDescriptor* const _this = this; (void)_this;
1417 new (&_impl_) Impl_{
1418 decltype(_impl_._has_bits_){from._impl_._has_bits_}
1419 , /*decltype(_impl_._cached_size_)*/{}
1420 , decltype(_impl_.specs_){from._impl_.specs_}
1421 , decltype(_impl_.blocks_){from._impl_.blocks_}
1422 , decltype(_impl_.min_sampling_period_ns_){}
1423 , decltype(_impl_.max_sampling_period_ns_){}
1424 , decltype(_impl_.supports_instrumented_sampling_){}};
1425
1426 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1427 ::memcpy(&_impl_.min_sampling_period_ns_, &from._impl_.min_sampling_period_ns_,
1428 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.supports_instrumented_sampling_) -
1429 reinterpret_cast<char*>(&_impl_.min_sampling_period_ns_)) + sizeof(_impl_.supports_instrumented_sampling_));
1430 // @@protoc_insertion_point(copy_constructor:perfetto.protos.GpuCounterDescriptor)
1431 }
1432
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1433 inline void GpuCounterDescriptor::SharedCtor(
1434 ::_pb::Arena* arena, bool is_message_owned) {
1435 (void)arena;
1436 (void)is_message_owned;
1437 new (&_impl_) Impl_{
1438 decltype(_impl_._has_bits_){}
1439 , /*decltype(_impl_._cached_size_)*/{}
1440 , decltype(_impl_.specs_){arena}
1441 , decltype(_impl_.blocks_){arena}
1442 , decltype(_impl_.min_sampling_period_ns_){::uint64_t{0u}}
1443 , decltype(_impl_.max_sampling_period_ns_){::uint64_t{0u}}
1444 , decltype(_impl_.supports_instrumented_sampling_){false}
1445 };
1446 }
1447
~GpuCounterDescriptor()1448 GpuCounterDescriptor::~GpuCounterDescriptor() {
1449 // @@protoc_insertion_point(destructor:perfetto.protos.GpuCounterDescriptor)
1450 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1451 (void)arena;
1452 return;
1453 }
1454 SharedDtor();
1455 }
1456
SharedDtor()1457 inline void GpuCounterDescriptor::SharedDtor() {
1458 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1459 _impl_.specs_.~RepeatedPtrField();
1460 _impl_.blocks_.~RepeatedPtrField();
1461 }
1462
SetCachedSize(int size) const1463 void GpuCounterDescriptor::SetCachedSize(int size) const {
1464 _impl_._cached_size_.Set(size);
1465 }
1466
Clear()1467 void GpuCounterDescriptor::Clear() {
1468 // @@protoc_insertion_point(message_clear_start:perfetto.protos.GpuCounterDescriptor)
1469 ::uint32_t cached_has_bits = 0;
1470 // Prevent compiler warnings about cached_has_bits being unused
1471 (void) cached_has_bits;
1472
1473 _impl_.specs_.Clear();
1474 _impl_.blocks_.Clear();
1475 cached_has_bits = _impl_._has_bits_[0];
1476 if (cached_has_bits & 0x00000007u) {
1477 ::memset(&_impl_.min_sampling_period_ns_, 0, static_cast<size_t>(
1478 reinterpret_cast<char*>(&_impl_.supports_instrumented_sampling_) -
1479 reinterpret_cast<char*>(&_impl_.min_sampling_period_ns_)) + sizeof(_impl_.supports_instrumented_sampling_));
1480 }
1481 _impl_._has_bits_.Clear();
1482 _internal_metadata_.Clear<std::string>();
1483 }
1484
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1485 const char* GpuCounterDescriptor::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1486 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1487 _Internal::HasBits has_bits{};
1488 while (!ctx->Done(&ptr)) {
1489 ::uint32_t tag;
1490 ptr = ::_pbi::ReadTag(ptr, &tag);
1491 switch (tag >> 3) {
1492 // repeated .perfetto.protos.GpuCounterDescriptor.GpuCounterSpec specs = 1;
1493 case 1:
1494 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
1495 ptr -= 1;
1496 do {
1497 ptr += 1;
1498 ptr = ctx->ParseMessage(_internal_add_specs(), ptr);
1499 CHK_(ptr);
1500 if (!ctx->DataAvailable(ptr)) break;
1501 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<10>(ptr));
1502 } else {
1503 goto handle_unusual;
1504 }
1505 continue;
1506 // repeated .perfetto.protos.GpuCounterDescriptor.GpuCounterBlock blocks = 2;
1507 case 2:
1508 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
1509 ptr -= 1;
1510 do {
1511 ptr += 1;
1512 ptr = ctx->ParseMessage(_internal_add_blocks(), ptr);
1513 CHK_(ptr);
1514 if (!ctx->DataAvailable(ptr)) break;
1515 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<18>(ptr));
1516 } else {
1517 goto handle_unusual;
1518 }
1519 continue;
1520 // optional uint64 min_sampling_period_ns = 3;
1521 case 3:
1522 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
1523 _Internal::set_has_min_sampling_period_ns(&has_bits);
1524 _impl_.min_sampling_period_ns_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1525 CHK_(ptr);
1526 } else {
1527 goto handle_unusual;
1528 }
1529 continue;
1530 // optional uint64 max_sampling_period_ns = 4;
1531 case 4:
1532 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
1533 _Internal::set_has_max_sampling_period_ns(&has_bits);
1534 _impl_.max_sampling_period_ns_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1535 CHK_(ptr);
1536 } else {
1537 goto handle_unusual;
1538 }
1539 continue;
1540 // optional bool supports_instrumented_sampling = 5;
1541 case 5:
1542 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 40)) {
1543 _Internal::set_has_supports_instrumented_sampling(&has_bits);
1544 _impl_.supports_instrumented_sampling_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1545 CHK_(ptr);
1546 } else {
1547 goto handle_unusual;
1548 }
1549 continue;
1550 default:
1551 goto handle_unusual;
1552 } // switch
1553 handle_unusual:
1554 if ((tag == 0) || ((tag & 7) == 4)) {
1555 CHK_(ptr);
1556 ctx->SetLastTag(tag);
1557 goto message_done;
1558 }
1559 ptr = UnknownFieldParse(
1560 tag,
1561 _internal_metadata_.mutable_unknown_fields<std::string>(),
1562 ptr, ctx);
1563 CHK_(ptr != nullptr);
1564 } // while
1565 message_done:
1566 _impl_._has_bits_.Or(has_bits);
1567 return ptr;
1568 failure:
1569 ptr = nullptr;
1570 goto message_done;
1571 #undef CHK_
1572 }
1573
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const1574 ::uint8_t* GpuCounterDescriptor::_InternalSerialize(
1575 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
1576 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.GpuCounterDescriptor)
1577 ::uint32_t cached_has_bits = 0;
1578 (void) cached_has_bits;
1579
1580 // repeated .perfetto.protos.GpuCounterDescriptor.GpuCounterSpec specs = 1;
1581 for (unsigned i = 0,
1582 n = static_cast<unsigned>(this->_internal_specs_size()); i < n; i++) {
1583 const auto& repfield = this->_internal_specs(i);
1584 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1585 InternalWriteMessage(1, repfield, repfield.GetCachedSize(), target, stream);
1586 }
1587
1588 // repeated .perfetto.protos.GpuCounterDescriptor.GpuCounterBlock blocks = 2;
1589 for (unsigned i = 0,
1590 n = static_cast<unsigned>(this->_internal_blocks_size()); i < n; i++) {
1591 const auto& repfield = this->_internal_blocks(i);
1592 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
1593 InternalWriteMessage(2, repfield, repfield.GetCachedSize(), target, stream);
1594 }
1595
1596 cached_has_bits = _impl_._has_bits_[0];
1597 // optional uint64 min_sampling_period_ns = 3;
1598 if (cached_has_bits & 0x00000001u) {
1599 target = stream->EnsureSpace(target);
1600 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_min_sampling_period_ns(), target);
1601 }
1602
1603 // optional uint64 max_sampling_period_ns = 4;
1604 if (cached_has_bits & 0x00000002u) {
1605 target = stream->EnsureSpace(target);
1606 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(4, this->_internal_max_sampling_period_ns(), target);
1607 }
1608
1609 // optional bool supports_instrumented_sampling = 5;
1610 if (cached_has_bits & 0x00000004u) {
1611 target = stream->EnsureSpace(target);
1612 target = ::_pbi::WireFormatLite::WriteBoolToArray(5, this->_internal_supports_instrumented_sampling(), target);
1613 }
1614
1615 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1616 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
1617 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
1618 }
1619 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.GpuCounterDescriptor)
1620 return target;
1621 }
1622
ByteSizeLong() const1623 size_t GpuCounterDescriptor::ByteSizeLong() const {
1624 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.GpuCounterDescriptor)
1625 size_t total_size = 0;
1626
1627 ::uint32_t cached_has_bits = 0;
1628 // Prevent compiler warnings about cached_has_bits being unused
1629 (void) cached_has_bits;
1630
1631 // repeated .perfetto.protos.GpuCounterDescriptor.GpuCounterSpec specs = 1;
1632 total_size += 1UL * this->_internal_specs_size();
1633 for (const auto& msg : this->_impl_.specs_) {
1634 total_size +=
1635 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1636 }
1637
1638 // repeated .perfetto.protos.GpuCounterDescriptor.GpuCounterBlock blocks = 2;
1639 total_size += 1UL * this->_internal_blocks_size();
1640 for (const auto& msg : this->_impl_.blocks_) {
1641 total_size +=
1642 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
1643 }
1644
1645 cached_has_bits = _impl_._has_bits_[0];
1646 if (cached_has_bits & 0x00000007u) {
1647 // optional uint64 min_sampling_period_ns = 3;
1648 if (cached_has_bits & 0x00000001u) {
1649 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_min_sampling_period_ns());
1650 }
1651
1652 // optional uint64 max_sampling_period_ns = 4;
1653 if (cached_has_bits & 0x00000002u) {
1654 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_max_sampling_period_ns());
1655 }
1656
1657 // optional bool supports_instrumented_sampling = 5;
1658 if (cached_has_bits & 0x00000004u) {
1659 total_size += 1 + 1;
1660 }
1661
1662 }
1663 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
1664 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
1665 }
1666 int cached_size = ::_pbi::ToCachedSize(total_size);
1667 SetCachedSize(cached_size);
1668 return total_size;
1669 }
1670
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)1671 void GpuCounterDescriptor::CheckTypeAndMergeFrom(
1672 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
1673 MergeFrom(*::_pbi::DownCast<const GpuCounterDescriptor*>(
1674 &from));
1675 }
1676
MergeFrom(const GpuCounterDescriptor & from)1677 void GpuCounterDescriptor::MergeFrom(const GpuCounterDescriptor& from) {
1678 GpuCounterDescriptor* const _this = this;
1679 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.GpuCounterDescriptor)
1680 GOOGLE_DCHECK_NE(&from, _this);
1681 ::uint32_t cached_has_bits = 0;
1682 (void) cached_has_bits;
1683
1684 _this->_impl_.specs_.MergeFrom(from._impl_.specs_);
1685 _this->_impl_.blocks_.MergeFrom(from._impl_.blocks_);
1686 cached_has_bits = from._impl_._has_bits_[0];
1687 if (cached_has_bits & 0x00000007u) {
1688 if (cached_has_bits & 0x00000001u) {
1689 _this->_impl_.min_sampling_period_ns_ = from._impl_.min_sampling_period_ns_;
1690 }
1691 if (cached_has_bits & 0x00000002u) {
1692 _this->_impl_.max_sampling_period_ns_ = from._impl_.max_sampling_period_ns_;
1693 }
1694 if (cached_has_bits & 0x00000004u) {
1695 _this->_impl_.supports_instrumented_sampling_ = from._impl_.supports_instrumented_sampling_;
1696 }
1697 _this->_impl_._has_bits_[0] |= cached_has_bits;
1698 }
1699 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1700 }
1701
CopyFrom(const GpuCounterDescriptor & from)1702 void GpuCounterDescriptor::CopyFrom(const GpuCounterDescriptor& from) {
1703 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.GpuCounterDescriptor)
1704 if (&from == this) return;
1705 Clear();
1706 MergeFrom(from);
1707 }
1708
IsInitialized() const1709 bool GpuCounterDescriptor::IsInitialized() const {
1710 return true;
1711 }
1712
InternalSwap(GpuCounterDescriptor * other)1713 void GpuCounterDescriptor::InternalSwap(GpuCounterDescriptor* other) {
1714 using std::swap;
1715 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1716 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1717 _impl_.specs_.InternalSwap(&other->_impl_.specs_);
1718 _impl_.blocks_.InternalSwap(&other->_impl_.blocks_);
1719 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1720 PROTOBUF_FIELD_OFFSET(GpuCounterDescriptor, _impl_.supports_instrumented_sampling_)
1721 + sizeof(GpuCounterDescriptor::_impl_.supports_instrumented_sampling_) // NOLINT
1722 - PROTOBUF_FIELD_OFFSET(GpuCounterDescriptor, _impl_.min_sampling_period_ns_)>(
1723 reinterpret_cast<char*>(&_impl_.min_sampling_period_ns_),
1724 reinterpret_cast<char*>(&other->_impl_.min_sampling_period_ns_));
1725 }
1726
GetTypeName() const1727 std::string GpuCounterDescriptor::GetTypeName() const {
1728 return "perfetto.protos.GpuCounterDescriptor";
1729 }
1730
1731
1732 // @@protoc_insertion_point(namespace_scope)
1733 } // namespace protos
1734 } // namespace perfetto
1735 PROTOBUF_NAMESPACE_OPEN
1736 template<> PROTOBUF_NOINLINE ::perfetto::protos::GpuCounterDescriptor_GpuCounterSpec*
CreateMaybeMessage(Arena * arena)1737 Arena::CreateMaybeMessage< ::perfetto::protos::GpuCounterDescriptor_GpuCounterSpec >(Arena* arena) {
1738 return Arena::CreateMessageInternal< ::perfetto::protos::GpuCounterDescriptor_GpuCounterSpec >(arena);
1739 }
1740 template<> PROTOBUF_NOINLINE ::perfetto::protos::GpuCounterDescriptor_GpuCounterBlock*
CreateMaybeMessage(Arena * arena)1741 Arena::CreateMaybeMessage< ::perfetto::protos::GpuCounterDescriptor_GpuCounterBlock >(Arena* arena) {
1742 return Arena::CreateMessageInternal< ::perfetto::protos::GpuCounterDescriptor_GpuCounterBlock >(arena);
1743 }
1744 template<> PROTOBUF_NOINLINE ::perfetto::protos::GpuCounterDescriptor*
CreateMaybeMessage(Arena * arena)1745 Arena::CreateMaybeMessage< ::perfetto::protos::GpuCounterDescriptor >(Arena* arena) {
1746 return Arena::CreateMessageInternal< ::perfetto::protos::GpuCounterDescriptor >(arena);
1747 }
1748 PROTOBUF_NAMESPACE_CLOSE
1749
1750 // @@protoc_insertion_point(global_scope)
1751 #include <google/protobuf/port_undef.inc>
1752