1 // Generated by the protocol buffer compiler. DO NOT EDIT!
2 // source: protos/perfetto/trace/track_event/track_event.proto
3
4 #include "protos/perfetto/trace/track_event/track_event.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 {
TrackEvent_LegacyEvent(::_pbi::ConstantInitialized)23 PROTOBUF_CONSTEXPR TrackEvent_LegacyEvent::TrackEvent_LegacyEvent(
24 ::_pbi::ConstantInitialized): _impl_{
25 /*decltype(_impl_._has_bits_)*/{}
26 , /*decltype(_impl_._cached_size_)*/{}
27 , /*decltype(_impl_.id_scope_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
28 , /*decltype(_impl_.name_iid_)*/::uint64_t{0u}
29 , /*decltype(_impl_.duration_us_)*/::int64_t{0}
30 , /*decltype(_impl_.thread_duration_us_)*/::int64_t{0}
31 , /*decltype(_impl_.phase_)*/0
32 , /*decltype(_impl_.use_async_tts_)*/false
33 , /*decltype(_impl_.bind_to_enclosing_)*/false
34 , /*decltype(_impl_.bind_id_)*/::uint64_t{0u}
35 , /*decltype(_impl_.flow_direction_)*/0
36 , /*decltype(_impl_.instant_event_scope_)*/0
37 , /*decltype(_impl_.thread_instruction_delta_)*/::int64_t{0}
38 , /*decltype(_impl_.pid_override_)*/0
39 , /*decltype(_impl_.tid_override_)*/0
40 , /*decltype(_impl_.id_)*/{}
41 , /*decltype(_impl_._oneof_case_)*/{}} {}
42 struct TrackEvent_LegacyEventDefaultTypeInternal {
TrackEvent_LegacyEventDefaultTypeInternalperfetto::protos::TrackEvent_LegacyEventDefaultTypeInternal43 PROTOBUF_CONSTEXPR TrackEvent_LegacyEventDefaultTypeInternal()
44 : _instance(::_pbi::ConstantInitialized{}) {}
~TrackEvent_LegacyEventDefaultTypeInternalperfetto::protos::TrackEvent_LegacyEventDefaultTypeInternal45 ~TrackEvent_LegacyEventDefaultTypeInternal() {}
46 union { // NOLINT(misc-non-private-member-variables-in-classes)
47 TrackEvent_LegacyEvent _instance;
48 };
49 };
50 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TrackEvent_LegacyEventDefaultTypeInternal _TrackEvent_LegacyEvent_default_instance_;
TrackEvent(::_pbi::ConstantInitialized)51 PROTOBUF_CONSTEXPR TrackEvent::TrackEvent(
52 ::_pbi::ConstantInitialized): _impl_{
53 /*decltype(_impl_._extensions_)*/{}
54 , /*decltype(_impl_._has_bits_)*/{}
55 , /*decltype(_impl_._cached_size_)*/{}
56 , /*decltype(_impl_.category_iids_)*/{}
57 , /*decltype(_impl_.debug_annotations_)*/{}
58 , /*decltype(_impl_.extra_counter_values_)*/{}
59 , /*decltype(_impl_.categories_)*/{}
60 , /*decltype(_impl_.extra_counter_track_uuids_)*/{}
61 , /*decltype(_impl_.flow_ids_old_)*/{}
62 , /*decltype(_impl_.terminating_flow_ids_old_)*/{}
63 , /*decltype(_impl_.extra_double_counter_track_uuids_)*/{}
64 , /*decltype(_impl_.extra_double_counter_values_)*/{}
65 , /*decltype(_impl_.flow_ids_)*/{}
66 , /*decltype(_impl_.terminating_flow_ids_)*/{}
67 , /*decltype(_impl_.task_execution_)*/nullptr
68 , /*decltype(_impl_.legacy_event_)*/nullptr
69 , /*decltype(_impl_.log_message_)*/nullptr
70 , /*decltype(_impl_.cc_scheduler_state_)*/nullptr
71 , /*decltype(_impl_.chrome_user_event_)*/nullptr
72 , /*decltype(_impl_.chrome_keyed_service_)*/nullptr
73 , /*decltype(_impl_.chrome_legacy_ipc_)*/nullptr
74 , /*decltype(_impl_.chrome_histogram_sample_)*/nullptr
75 , /*decltype(_impl_.chrome_latency_info_)*/nullptr
76 , /*decltype(_impl_.chrome_frame_reporter_)*/nullptr
77 , /*decltype(_impl_.chrome_message_pump_)*/nullptr
78 , /*decltype(_impl_.chrome_mojo_event_info_)*/nullptr
79 , /*decltype(_impl_.chrome_application_state_info_)*/nullptr
80 , /*decltype(_impl_.chrome_renderer_scheduler_state_)*/nullptr
81 , /*decltype(_impl_.chrome_window_handle_event_info_)*/nullptr
82 , /*decltype(_impl_.chrome_content_settings_event_info_)*/nullptr
83 , /*decltype(_impl_.chrome_active_processes_)*/nullptr
84 , /*decltype(_impl_.screenshot_)*/nullptr
85 , /*decltype(_impl_.track_uuid_)*/::uint64_t{0u}
86 , /*decltype(_impl_.type_)*/0
87 , /*decltype(_impl_.name_field_)*/{}
88 , /*decltype(_impl_.counter_value_field_)*/{}
89 , /*decltype(_impl_.source_location_field_)*/{}
90 , /*decltype(_impl_.timestamp_)*/{}
91 , /*decltype(_impl_.thread_time_)*/{}
92 , /*decltype(_impl_.thread_instruction_count_)*/{}
93 , /*decltype(_impl_._oneof_case_)*/{}} {}
94 struct TrackEventDefaultTypeInternal {
TrackEventDefaultTypeInternalperfetto::protos::TrackEventDefaultTypeInternal95 PROTOBUF_CONSTEXPR TrackEventDefaultTypeInternal()
96 : _instance(::_pbi::ConstantInitialized{}) {}
~TrackEventDefaultTypeInternalperfetto::protos::TrackEventDefaultTypeInternal97 ~TrackEventDefaultTypeInternal() {}
98 union { // NOLINT(misc-non-private-member-variables-in-classes)
99 TrackEvent _instance;
100 };
101 };
102 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TrackEventDefaultTypeInternal _TrackEvent_default_instance_;
TrackEventDefaults(::_pbi::ConstantInitialized)103 PROTOBUF_CONSTEXPR TrackEventDefaults::TrackEventDefaults(
104 ::_pbi::ConstantInitialized): _impl_{
105 /*decltype(_impl_._has_bits_)*/{}
106 , /*decltype(_impl_._cached_size_)*/{}
107 , /*decltype(_impl_.extra_counter_track_uuids_)*/{}
108 , /*decltype(_impl_.extra_double_counter_track_uuids_)*/{}
109 , /*decltype(_impl_.track_uuid_)*/::uint64_t{0u}} {}
110 struct TrackEventDefaultsDefaultTypeInternal {
TrackEventDefaultsDefaultTypeInternalperfetto::protos::TrackEventDefaultsDefaultTypeInternal111 PROTOBUF_CONSTEXPR TrackEventDefaultsDefaultTypeInternal()
112 : _instance(::_pbi::ConstantInitialized{}) {}
~TrackEventDefaultsDefaultTypeInternalperfetto::protos::TrackEventDefaultsDefaultTypeInternal113 ~TrackEventDefaultsDefaultTypeInternal() {}
114 union { // NOLINT(misc-non-private-member-variables-in-classes)
115 TrackEventDefaults _instance;
116 };
117 };
118 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 TrackEventDefaultsDefaultTypeInternal _TrackEventDefaults_default_instance_;
EventCategory(::_pbi::ConstantInitialized)119 PROTOBUF_CONSTEXPR EventCategory::EventCategory(
120 ::_pbi::ConstantInitialized): _impl_{
121 /*decltype(_impl_._has_bits_)*/{}
122 , /*decltype(_impl_._cached_size_)*/{}
123 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
124 , /*decltype(_impl_.iid_)*/::uint64_t{0u}} {}
125 struct EventCategoryDefaultTypeInternal {
EventCategoryDefaultTypeInternalperfetto::protos::EventCategoryDefaultTypeInternal126 PROTOBUF_CONSTEXPR EventCategoryDefaultTypeInternal()
127 : _instance(::_pbi::ConstantInitialized{}) {}
~EventCategoryDefaultTypeInternalperfetto::protos::EventCategoryDefaultTypeInternal128 ~EventCategoryDefaultTypeInternal() {}
129 union { // NOLINT(misc-non-private-member-variables-in-classes)
130 EventCategory _instance;
131 };
132 };
133 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EventCategoryDefaultTypeInternal _EventCategory_default_instance_;
EventName(::_pbi::ConstantInitialized)134 PROTOBUF_CONSTEXPR EventName::EventName(
135 ::_pbi::ConstantInitialized): _impl_{
136 /*decltype(_impl_._has_bits_)*/{}
137 , /*decltype(_impl_._cached_size_)*/{}
138 , /*decltype(_impl_.name_)*/{&::_pbi::fixed_address_empty_string, ::_pbi::ConstantInitialized{}}
139 , /*decltype(_impl_.iid_)*/::uint64_t{0u}} {}
140 struct EventNameDefaultTypeInternal {
EventNameDefaultTypeInternalperfetto::protos::EventNameDefaultTypeInternal141 PROTOBUF_CONSTEXPR EventNameDefaultTypeInternal()
142 : _instance(::_pbi::ConstantInitialized{}) {}
~EventNameDefaultTypeInternalperfetto::protos::EventNameDefaultTypeInternal143 ~EventNameDefaultTypeInternal() {}
144 union { // NOLINT(misc-non-private-member-variables-in-classes)
145 EventName _instance;
146 };
147 };
148 PROTOBUF_ATTRIBUTE_NO_DESTROY PROTOBUF_CONSTINIT PROTOBUF_ATTRIBUTE_INIT_PRIORITY1 EventNameDefaultTypeInternal _EventName_default_instance_;
149 } // namespace protos
150 } // namespace perfetto
151 namespace perfetto {
152 namespace protos {
TrackEvent_LegacyEvent_FlowDirection_IsValid(int value)153 bool TrackEvent_LegacyEvent_FlowDirection_IsValid(int value) {
154 switch (value) {
155 case 0:
156 case 1:
157 case 2:
158 case 3:
159 return true;
160 default:
161 return false;
162 }
163 }
164
165 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> TrackEvent_LegacyEvent_FlowDirection_strings[4] = {};
166
167 static const char TrackEvent_LegacyEvent_FlowDirection_names[] =
168 "FLOW_IN"
169 "FLOW_INOUT"
170 "FLOW_OUT"
171 "FLOW_UNSPECIFIED";
172
173 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry TrackEvent_LegacyEvent_FlowDirection_entries[] = {
174 { {TrackEvent_LegacyEvent_FlowDirection_names + 0, 7}, 1 },
175 { {TrackEvent_LegacyEvent_FlowDirection_names + 7, 10}, 3 },
176 { {TrackEvent_LegacyEvent_FlowDirection_names + 17, 8}, 2 },
177 { {TrackEvent_LegacyEvent_FlowDirection_names + 25, 16}, 0 },
178 };
179
180 static const int TrackEvent_LegacyEvent_FlowDirection_entries_by_number[] = {
181 3, // 0 -> FLOW_UNSPECIFIED
182 0, // 1 -> FLOW_IN
183 2, // 2 -> FLOW_OUT
184 1, // 3 -> FLOW_INOUT
185 };
186
TrackEvent_LegacyEvent_FlowDirection_Name(TrackEvent_LegacyEvent_FlowDirection value)187 const std::string& TrackEvent_LegacyEvent_FlowDirection_Name(
188 TrackEvent_LegacyEvent_FlowDirection value) {
189 static const bool dummy =
190 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
191 TrackEvent_LegacyEvent_FlowDirection_entries,
192 TrackEvent_LegacyEvent_FlowDirection_entries_by_number,
193 4, TrackEvent_LegacyEvent_FlowDirection_strings);
194 (void) dummy;
195 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
196 TrackEvent_LegacyEvent_FlowDirection_entries,
197 TrackEvent_LegacyEvent_FlowDirection_entries_by_number,
198 4, value);
199 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
200 TrackEvent_LegacyEvent_FlowDirection_strings[idx].get();
201 }
TrackEvent_LegacyEvent_FlowDirection_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,TrackEvent_LegacyEvent_FlowDirection * value)202 bool TrackEvent_LegacyEvent_FlowDirection_Parse(
203 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TrackEvent_LegacyEvent_FlowDirection* value) {
204 int int_value;
205 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
206 TrackEvent_LegacyEvent_FlowDirection_entries, 4, name, &int_value);
207 if (success) {
208 *value = static_cast<TrackEvent_LegacyEvent_FlowDirection>(int_value);
209 }
210 return success;
211 }
212 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
213 constexpr TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent::FLOW_UNSPECIFIED;
214 constexpr TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent::FLOW_IN;
215 constexpr TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent::FLOW_OUT;
216 constexpr TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent::FLOW_INOUT;
217 constexpr TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent::FlowDirection_MIN;
218 constexpr TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent::FlowDirection_MAX;
219 constexpr int TrackEvent_LegacyEvent::FlowDirection_ARRAYSIZE;
220 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
TrackEvent_LegacyEvent_InstantEventScope_IsValid(int value)221 bool TrackEvent_LegacyEvent_InstantEventScope_IsValid(int value) {
222 switch (value) {
223 case 0:
224 case 1:
225 case 2:
226 case 3:
227 return true;
228 default:
229 return false;
230 }
231 }
232
233 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> TrackEvent_LegacyEvent_InstantEventScope_strings[4] = {};
234
235 static const char TrackEvent_LegacyEvent_InstantEventScope_names[] =
236 "SCOPE_GLOBAL"
237 "SCOPE_PROCESS"
238 "SCOPE_THREAD"
239 "SCOPE_UNSPECIFIED";
240
241 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry TrackEvent_LegacyEvent_InstantEventScope_entries[] = {
242 { {TrackEvent_LegacyEvent_InstantEventScope_names + 0, 12}, 1 },
243 { {TrackEvent_LegacyEvent_InstantEventScope_names + 12, 13}, 2 },
244 { {TrackEvent_LegacyEvent_InstantEventScope_names + 25, 12}, 3 },
245 { {TrackEvent_LegacyEvent_InstantEventScope_names + 37, 17}, 0 },
246 };
247
248 static const int TrackEvent_LegacyEvent_InstantEventScope_entries_by_number[] = {
249 3, // 0 -> SCOPE_UNSPECIFIED
250 0, // 1 -> SCOPE_GLOBAL
251 1, // 2 -> SCOPE_PROCESS
252 2, // 3 -> SCOPE_THREAD
253 };
254
TrackEvent_LegacyEvent_InstantEventScope_Name(TrackEvent_LegacyEvent_InstantEventScope value)255 const std::string& TrackEvent_LegacyEvent_InstantEventScope_Name(
256 TrackEvent_LegacyEvent_InstantEventScope value) {
257 static const bool dummy =
258 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
259 TrackEvent_LegacyEvent_InstantEventScope_entries,
260 TrackEvent_LegacyEvent_InstantEventScope_entries_by_number,
261 4, TrackEvent_LegacyEvent_InstantEventScope_strings);
262 (void) dummy;
263 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
264 TrackEvent_LegacyEvent_InstantEventScope_entries,
265 TrackEvent_LegacyEvent_InstantEventScope_entries_by_number,
266 4, value);
267 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
268 TrackEvent_LegacyEvent_InstantEventScope_strings[idx].get();
269 }
TrackEvent_LegacyEvent_InstantEventScope_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,TrackEvent_LegacyEvent_InstantEventScope * value)270 bool TrackEvent_LegacyEvent_InstantEventScope_Parse(
271 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TrackEvent_LegacyEvent_InstantEventScope* value) {
272 int int_value;
273 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
274 TrackEvent_LegacyEvent_InstantEventScope_entries, 4, name, &int_value);
275 if (success) {
276 *value = static_cast<TrackEvent_LegacyEvent_InstantEventScope>(int_value);
277 }
278 return success;
279 }
280 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
281 constexpr TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent::SCOPE_UNSPECIFIED;
282 constexpr TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent::SCOPE_GLOBAL;
283 constexpr TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent::SCOPE_PROCESS;
284 constexpr TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent::SCOPE_THREAD;
285 constexpr TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent::InstantEventScope_MIN;
286 constexpr TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent::InstantEventScope_MAX;
287 constexpr int TrackEvent_LegacyEvent::InstantEventScope_ARRAYSIZE;
288 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
TrackEvent_Type_IsValid(int value)289 bool TrackEvent_Type_IsValid(int value) {
290 switch (value) {
291 case 0:
292 case 1:
293 case 2:
294 case 3:
295 case 4:
296 return true;
297 default:
298 return false;
299 }
300 }
301
302 static ::PROTOBUF_NAMESPACE_ID::internal::ExplicitlyConstructed<std::string> TrackEvent_Type_strings[5] = {};
303
304 static const char TrackEvent_Type_names[] =
305 "TYPE_COUNTER"
306 "TYPE_INSTANT"
307 "TYPE_SLICE_BEGIN"
308 "TYPE_SLICE_END"
309 "TYPE_UNSPECIFIED";
310
311 static const ::PROTOBUF_NAMESPACE_ID::internal::EnumEntry TrackEvent_Type_entries[] = {
312 { {TrackEvent_Type_names + 0, 12}, 4 },
313 { {TrackEvent_Type_names + 12, 12}, 3 },
314 { {TrackEvent_Type_names + 24, 16}, 1 },
315 { {TrackEvent_Type_names + 40, 14}, 2 },
316 { {TrackEvent_Type_names + 54, 16}, 0 },
317 };
318
319 static const int TrackEvent_Type_entries_by_number[] = {
320 4, // 0 -> TYPE_UNSPECIFIED
321 2, // 1 -> TYPE_SLICE_BEGIN
322 3, // 2 -> TYPE_SLICE_END
323 1, // 3 -> TYPE_INSTANT
324 0, // 4 -> TYPE_COUNTER
325 };
326
TrackEvent_Type_Name(TrackEvent_Type value)327 const std::string& TrackEvent_Type_Name(
328 TrackEvent_Type value) {
329 static const bool dummy =
330 ::PROTOBUF_NAMESPACE_ID::internal::InitializeEnumStrings(
331 TrackEvent_Type_entries,
332 TrackEvent_Type_entries_by_number,
333 5, TrackEvent_Type_strings);
334 (void) dummy;
335 int idx = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumName(
336 TrackEvent_Type_entries,
337 TrackEvent_Type_entries_by_number,
338 5, value);
339 return idx == -1 ? ::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString() :
340 TrackEvent_Type_strings[idx].get();
341 }
TrackEvent_Type_Parse(::PROTOBUF_NAMESPACE_ID::ConstStringParam name,TrackEvent_Type * value)342 bool TrackEvent_Type_Parse(
343 ::PROTOBUF_NAMESPACE_ID::ConstStringParam name, TrackEvent_Type* value) {
344 int int_value;
345 bool success = ::PROTOBUF_NAMESPACE_ID::internal::LookUpEnumValue(
346 TrackEvent_Type_entries, 5, name, &int_value);
347 if (success) {
348 *value = static_cast<TrackEvent_Type>(int_value);
349 }
350 return success;
351 }
352 #if (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
353 constexpr TrackEvent_Type TrackEvent::TYPE_UNSPECIFIED;
354 constexpr TrackEvent_Type TrackEvent::TYPE_SLICE_BEGIN;
355 constexpr TrackEvent_Type TrackEvent::TYPE_SLICE_END;
356 constexpr TrackEvent_Type TrackEvent::TYPE_INSTANT;
357 constexpr TrackEvent_Type TrackEvent::TYPE_COUNTER;
358 constexpr TrackEvent_Type TrackEvent::Type_MIN;
359 constexpr TrackEvent_Type TrackEvent::Type_MAX;
360 constexpr int TrackEvent::Type_ARRAYSIZE;
361 #endif // (__cplusplus < 201703) && (!defined(_MSC_VER) || (_MSC_VER >= 1900 && _MSC_VER < 1912))
362
363 // ===================================================================
364
365 class TrackEvent_LegacyEvent::_Internal {
366 public:
367 using HasBits = decltype(std::declval<TrackEvent_LegacyEvent>()._impl_._has_bits_);
set_has_name_iid(HasBits * has_bits)368 static void set_has_name_iid(HasBits* has_bits) {
369 (*has_bits)[0] |= 2u;
370 }
set_has_phase(HasBits * has_bits)371 static void set_has_phase(HasBits* has_bits) {
372 (*has_bits)[0] |= 16u;
373 }
set_has_duration_us(HasBits * has_bits)374 static void set_has_duration_us(HasBits* has_bits) {
375 (*has_bits)[0] |= 4u;
376 }
set_has_thread_duration_us(HasBits * has_bits)377 static void set_has_thread_duration_us(HasBits* has_bits) {
378 (*has_bits)[0] |= 8u;
379 }
set_has_thread_instruction_delta(HasBits * has_bits)380 static void set_has_thread_instruction_delta(HasBits* has_bits) {
381 (*has_bits)[0] |= 1024u;
382 }
set_has_id_scope(HasBits * has_bits)383 static void set_has_id_scope(HasBits* has_bits) {
384 (*has_bits)[0] |= 1u;
385 }
set_has_use_async_tts(HasBits * has_bits)386 static void set_has_use_async_tts(HasBits* has_bits) {
387 (*has_bits)[0] |= 32u;
388 }
set_has_bind_id(HasBits * has_bits)389 static void set_has_bind_id(HasBits* has_bits) {
390 (*has_bits)[0] |= 128u;
391 }
set_has_bind_to_enclosing(HasBits * has_bits)392 static void set_has_bind_to_enclosing(HasBits* has_bits) {
393 (*has_bits)[0] |= 64u;
394 }
set_has_flow_direction(HasBits * has_bits)395 static void set_has_flow_direction(HasBits* has_bits) {
396 (*has_bits)[0] |= 256u;
397 }
set_has_instant_event_scope(HasBits * has_bits)398 static void set_has_instant_event_scope(HasBits* has_bits) {
399 (*has_bits)[0] |= 512u;
400 }
set_has_pid_override(HasBits * has_bits)401 static void set_has_pid_override(HasBits* has_bits) {
402 (*has_bits)[0] |= 2048u;
403 }
set_has_tid_override(HasBits * has_bits)404 static void set_has_tid_override(HasBits* has_bits) {
405 (*has_bits)[0] |= 4096u;
406 }
407 };
408
TrackEvent_LegacyEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)409 TrackEvent_LegacyEvent::TrackEvent_LegacyEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
410 bool is_message_owned)
411 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
412 SharedCtor(arena, is_message_owned);
413 // @@protoc_insertion_point(arena_constructor:perfetto.protos.TrackEvent.LegacyEvent)
414 }
TrackEvent_LegacyEvent(const TrackEvent_LegacyEvent & from)415 TrackEvent_LegacyEvent::TrackEvent_LegacyEvent(const TrackEvent_LegacyEvent& from)
416 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
417 TrackEvent_LegacyEvent* const _this = this; (void)_this;
418 new (&_impl_) Impl_{
419 decltype(_impl_._has_bits_){from._impl_._has_bits_}
420 , /*decltype(_impl_._cached_size_)*/{}
421 , decltype(_impl_.id_scope_){}
422 , decltype(_impl_.name_iid_){}
423 , decltype(_impl_.duration_us_){}
424 , decltype(_impl_.thread_duration_us_){}
425 , decltype(_impl_.phase_){}
426 , decltype(_impl_.use_async_tts_){}
427 , decltype(_impl_.bind_to_enclosing_){}
428 , decltype(_impl_.bind_id_){}
429 , decltype(_impl_.flow_direction_){}
430 , decltype(_impl_.instant_event_scope_){}
431 , decltype(_impl_.thread_instruction_delta_){}
432 , decltype(_impl_.pid_override_){}
433 , decltype(_impl_.tid_override_){}
434 , decltype(_impl_.id_){}
435 , /*decltype(_impl_._oneof_case_)*/{}};
436
437 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
438 _impl_.id_scope_.InitDefault();
439 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
440 _impl_.id_scope_.Set("", GetArenaForAllocation());
441 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
442 if (from._internal_has_id_scope()) {
443 _this->_impl_.id_scope_.Set(from._internal_id_scope(),
444 _this->GetArenaForAllocation());
445 }
446 ::memcpy(&_impl_.name_iid_, &from._impl_.name_iid_,
447 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.tid_override_) -
448 reinterpret_cast<char*>(&_impl_.name_iid_)) + sizeof(_impl_.tid_override_));
449 clear_has_id();
450 switch (from.id_case()) {
451 case kUnscopedId: {
452 _this->_internal_set_unscoped_id(from._internal_unscoped_id());
453 break;
454 }
455 case kLocalId: {
456 _this->_internal_set_local_id(from._internal_local_id());
457 break;
458 }
459 case kGlobalId: {
460 _this->_internal_set_global_id(from._internal_global_id());
461 break;
462 }
463 case ID_NOT_SET: {
464 break;
465 }
466 }
467 // @@protoc_insertion_point(copy_constructor:perfetto.protos.TrackEvent.LegacyEvent)
468 }
469
SharedCtor(::_pb::Arena * arena,bool is_message_owned)470 inline void TrackEvent_LegacyEvent::SharedCtor(
471 ::_pb::Arena* arena, bool is_message_owned) {
472 (void)arena;
473 (void)is_message_owned;
474 new (&_impl_) Impl_{
475 decltype(_impl_._has_bits_){}
476 , /*decltype(_impl_._cached_size_)*/{}
477 , decltype(_impl_.id_scope_){}
478 , decltype(_impl_.name_iid_){::uint64_t{0u}}
479 , decltype(_impl_.duration_us_){::int64_t{0}}
480 , decltype(_impl_.thread_duration_us_){::int64_t{0}}
481 , decltype(_impl_.phase_){0}
482 , decltype(_impl_.use_async_tts_){false}
483 , decltype(_impl_.bind_to_enclosing_){false}
484 , decltype(_impl_.bind_id_){::uint64_t{0u}}
485 , decltype(_impl_.flow_direction_){0}
486 , decltype(_impl_.instant_event_scope_){0}
487 , decltype(_impl_.thread_instruction_delta_){::int64_t{0}}
488 , decltype(_impl_.pid_override_){0}
489 , decltype(_impl_.tid_override_){0}
490 , decltype(_impl_.id_){}
491 , /*decltype(_impl_._oneof_case_)*/{}
492 };
493 _impl_.id_scope_.InitDefault();
494 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
495 _impl_.id_scope_.Set("", GetArenaForAllocation());
496 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
497 clear_has_id();
498 }
499
~TrackEvent_LegacyEvent()500 TrackEvent_LegacyEvent::~TrackEvent_LegacyEvent() {
501 // @@protoc_insertion_point(destructor:perfetto.protos.TrackEvent.LegacyEvent)
502 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
503 (void)arena;
504 return;
505 }
506 SharedDtor();
507 }
508
SharedDtor()509 inline void TrackEvent_LegacyEvent::SharedDtor() {
510 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
511 _impl_.id_scope_.Destroy();
512 if (has_id()) {
513 clear_id();
514 }
515 }
516
SetCachedSize(int size) const517 void TrackEvent_LegacyEvent::SetCachedSize(int size) const {
518 _impl_._cached_size_.Set(size);
519 }
520
clear_id()521 void TrackEvent_LegacyEvent::clear_id() {
522 // @@protoc_insertion_point(one_of_clear_start:perfetto.protos.TrackEvent.LegacyEvent)
523 switch (id_case()) {
524 case kUnscopedId: {
525 // No need to clear
526 break;
527 }
528 case kLocalId: {
529 // No need to clear
530 break;
531 }
532 case kGlobalId: {
533 // No need to clear
534 break;
535 }
536 case ID_NOT_SET: {
537 break;
538 }
539 }
540 _impl_._oneof_case_[0] = ID_NOT_SET;
541 }
542
543
Clear()544 void TrackEvent_LegacyEvent::Clear() {
545 // @@protoc_insertion_point(message_clear_start:perfetto.protos.TrackEvent.LegacyEvent)
546 ::uint32_t cached_has_bits = 0;
547 // Prevent compiler warnings about cached_has_bits being unused
548 (void) cached_has_bits;
549
550 cached_has_bits = _impl_._has_bits_[0];
551 if (cached_has_bits & 0x00000001u) {
552 _impl_.id_scope_.ClearNonDefaultToEmpty();
553 }
554 if (cached_has_bits & 0x000000feu) {
555 ::memset(&_impl_.name_iid_, 0, static_cast<size_t>(
556 reinterpret_cast<char*>(&_impl_.bind_id_) -
557 reinterpret_cast<char*>(&_impl_.name_iid_)) + sizeof(_impl_.bind_id_));
558 }
559 if (cached_has_bits & 0x00001f00u) {
560 ::memset(&_impl_.flow_direction_, 0, static_cast<size_t>(
561 reinterpret_cast<char*>(&_impl_.tid_override_) -
562 reinterpret_cast<char*>(&_impl_.flow_direction_)) + sizeof(_impl_.tid_override_));
563 }
564 clear_id();
565 _impl_._has_bits_.Clear();
566 _internal_metadata_.Clear<std::string>();
567 }
568
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)569 const char* TrackEvent_LegacyEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
570 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
571 _Internal::HasBits has_bits{};
572 while (!ctx->Done(&ptr)) {
573 ::uint32_t tag;
574 ptr = ::_pbi::ReadTag(ptr, &tag);
575 switch (tag >> 3) {
576 // optional uint64 name_iid = 1;
577 case 1:
578 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
579 _Internal::set_has_name_iid(&has_bits);
580 _impl_.name_iid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
581 CHK_(ptr);
582 } else {
583 goto handle_unusual;
584 }
585 continue;
586 // optional int32 phase = 2;
587 case 2:
588 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
589 _Internal::set_has_phase(&has_bits);
590 _impl_.phase_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
591 CHK_(ptr);
592 } else {
593 goto handle_unusual;
594 }
595 continue;
596 // optional int64 duration_us = 3;
597 case 3:
598 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
599 _Internal::set_has_duration_us(&has_bits);
600 _impl_.duration_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
601 CHK_(ptr);
602 } else {
603 goto handle_unusual;
604 }
605 continue;
606 // optional int64 thread_duration_us = 4;
607 case 4:
608 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
609 _Internal::set_has_thread_duration_us(&has_bits);
610 _impl_.thread_duration_us_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
611 CHK_(ptr);
612 } else {
613 goto handle_unusual;
614 }
615 continue;
616 // uint64 unscoped_id = 6;
617 case 6:
618 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 48)) {
619 _internal_set_unscoped_id(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
620 CHK_(ptr);
621 } else {
622 goto handle_unusual;
623 }
624 continue;
625 // optional string id_scope = 7;
626 case 7:
627 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
628 auto str = _internal_mutable_id_scope();
629 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
630 CHK_(ptr);
631 } else {
632 goto handle_unusual;
633 }
634 continue;
635 // optional uint64 bind_id = 8;
636 case 8:
637 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
638 _Internal::set_has_bind_id(&has_bits);
639 _impl_.bind_id_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
640 CHK_(ptr);
641 } else {
642 goto handle_unusual;
643 }
644 continue;
645 // optional bool use_async_tts = 9;
646 case 9:
647 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
648 _Internal::set_has_use_async_tts(&has_bits);
649 _impl_.use_async_tts_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
650 CHK_(ptr);
651 } else {
652 goto handle_unusual;
653 }
654 continue;
655 // uint64 local_id = 10;
656 case 10:
657 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
658 _internal_set_local_id(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
659 CHK_(ptr);
660 } else {
661 goto handle_unusual;
662 }
663 continue;
664 // uint64 global_id = 11;
665 case 11:
666 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
667 _internal_set_global_id(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
668 CHK_(ptr);
669 } else {
670 goto handle_unusual;
671 }
672 continue;
673 // optional bool bind_to_enclosing = 12;
674 case 12:
675 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 96)) {
676 _Internal::set_has_bind_to_enclosing(&has_bits);
677 _impl_.bind_to_enclosing_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
678 CHK_(ptr);
679 } else {
680 goto handle_unusual;
681 }
682 continue;
683 // optional .perfetto.protos.TrackEvent.LegacyEvent.FlowDirection flow_direction = 13;
684 case 13:
685 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 104)) {
686 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
687 CHK_(ptr);
688 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::TrackEvent_LegacyEvent_FlowDirection_IsValid(val))) {
689 _internal_set_flow_direction(static_cast<::perfetto::protos::TrackEvent_LegacyEvent_FlowDirection>(val));
690 } else {
691 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(13, val, mutable_unknown_fields());
692 }
693 } else {
694 goto handle_unusual;
695 }
696 continue;
697 // optional .perfetto.protos.TrackEvent.LegacyEvent.InstantEventScope instant_event_scope = 14;
698 case 14:
699 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 112)) {
700 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
701 CHK_(ptr);
702 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::TrackEvent_LegacyEvent_InstantEventScope_IsValid(val))) {
703 _internal_set_instant_event_scope(static_cast<::perfetto::protos::TrackEvent_LegacyEvent_InstantEventScope>(val));
704 } else {
705 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(14, val, mutable_unknown_fields());
706 }
707 } else {
708 goto handle_unusual;
709 }
710 continue;
711 // optional int64 thread_instruction_delta = 15;
712 case 15:
713 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 120)) {
714 _Internal::set_has_thread_instruction_delta(&has_bits);
715 _impl_.thread_instruction_delta_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
716 CHK_(ptr);
717 } else {
718 goto handle_unusual;
719 }
720 continue;
721 // optional int32 pid_override = 18;
722 case 18:
723 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 144)) {
724 _Internal::set_has_pid_override(&has_bits);
725 _impl_.pid_override_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
726 CHK_(ptr);
727 } else {
728 goto handle_unusual;
729 }
730 continue;
731 // optional int32 tid_override = 19;
732 case 19:
733 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 152)) {
734 _Internal::set_has_tid_override(&has_bits);
735 _impl_.tid_override_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint32(&ptr);
736 CHK_(ptr);
737 } else {
738 goto handle_unusual;
739 }
740 continue;
741 default:
742 goto handle_unusual;
743 } // switch
744 handle_unusual:
745 if ((tag == 0) || ((tag & 7) == 4)) {
746 CHK_(ptr);
747 ctx->SetLastTag(tag);
748 goto message_done;
749 }
750 ptr = UnknownFieldParse(
751 tag,
752 _internal_metadata_.mutable_unknown_fields<std::string>(),
753 ptr, ctx);
754 CHK_(ptr != nullptr);
755 } // while
756 message_done:
757 _impl_._has_bits_.Or(has_bits);
758 return ptr;
759 failure:
760 ptr = nullptr;
761 goto message_done;
762 #undef CHK_
763 }
764
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const765 ::uint8_t* TrackEvent_LegacyEvent::_InternalSerialize(
766 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
767 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TrackEvent.LegacyEvent)
768 ::uint32_t cached_has_bits = 0;
769 (void) cached_has_bits;
770
771 cached_has_bits = _impl_._has_bits_[0];
772 // optional uint64 name_iid = 1;
773 if (cached_has_bits & 0x00000002u) {
774 target = stream->EnsureSpace(target);
775 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_name_iid(), target);
776 }
777
778 // optional int32 phase = 2;
779 if (cached_has_bits & 0x00000010u) {
780 target = stream->EnsureSpace(target);
781 target = ::_pbi::WireFormatLite::WriteInt32ToArray(2, this->_internal_phase(), target);
782 }
783
784 // optional int64 duration_us = 3;
785 if (cached_has_bits & 0x00000004u) {
786 target = stream->EnsureSpace(target);
787 target = ::_pbi::WireFormatLite::WriteInt64ToArray(3, this->_internal_duration_us(), target);
788 }
789
790 // optional int64 thread_duration_us = 4;
791 if (cached_has_bits & 0x00000008u) {
792 target = stream->EnsureSpace(target);
793 target = ::_pbi::WireFormatLite::WriteInt64ToArray(4, this->_internal_thread_duration_us(), target);
794 }
795
796 // uint64 unscoped_id = 6;
797 if (_internal_has_unscoped_id()) {
798 target = stream->EnsureSpace(target);
799 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(6, this->_internal_unscoped_id(), target);
800 }
801
802 // optional string id_scope = 7;
803 if (cached_has_bits & 0x00000001u) {
804 target = stream->WriteStringMaybeAliased(
805 7, this->_internal_id_scope(), target);
806 }
807
808 // optional uint64 bind_id = 8;
809 if (cached_has_bits & 0x00000080u) {
810 target = stream->EnsureSpace(target);
811 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(8, this->_internal_bind_id(), target);
812 }
813
814 // optional bool use_async_tts = 9;
815 if (cached_has_bits & 0x00000020u) {
816 target = stream->EnsureSpace(target);
817 target = ::_pbi::WireFormatLite::WriteBoolToArray(9, this->_internal_use_async_tts(), target);
818 }
819
820 switch (id_case()) {
821 case kLocalId: {
822 target = stream->EnsureSpace(target);
823 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(10, this->_internal_local_id(), target);
824 break;
825 }
826 case kGlobalId: {
827 target = stream->EnsureSpace(target);
828 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(11, this->_internal_global_id(), target);
829 break;
830 }
831 default: ;
832 }
833 // optional bool bind_to_enclosing = 12;
834 if (cached_has_bits & 0x00000040u) {
835 target = stream->EnsureSpace(target);
836 target = ::_pbi::WireFormatLite::WriteBoolToArray(12, this->_internal_bind_to_enclosing(), target);
837 }
838
839 // optional .perfetto.protos.TrackEvent.LegacyEvent.FlowDirection flow_direction = 13;
840 if (cached_has_bits & 0x00000100u) {
841 target = stream->EnsureSpace(target);
842 target = ::_pbi::WireFormatLite::WriteEnumToArray(
843 13, this->_internal_flow_direction(), target);
844 }
845
846 // optional .perfetto.protos.TrackEvent.LegacyEvent.InstantEventScope instant_event_scope = 14;
847 if (cached_has_bits & 0x00000200u) {
848 target = stream->EnsureSpace(target);
849 target = ::_pbi::WireFormatLite::WriteEnumToArray(
850 14, this->_internal_instant_event_scope(), target);
851 }
852
853 // optional int64 thread_instruction_delta = 15;
854 if (cached_has_bits & 0x00000400u) {
855 target = stream->EnsureSpace(target);
856 target = ::_pbi::WireFormatLite::WriteInt64ToArray(15, this->_internal_thread_instruction_delta(), target);
857 }
858
859 // optional int32 pid_override = 18;
860 if (cached_has_bits & 0x00000800u) {
861 target = stream->EnsureSpace(target);
862 target = ::_pbi::WireFormatLite::WriteInt32ToArray(18, this->_internal_pid_override(), target);
863 }
864
865 // optional int32 tid_override = 19;
866 if (cached_has_bits & 0x00001000u) {
867 target = stream->EnsureSpace(target);
868 target = ::_pbi::WireFormatLite::WriteInt32ToArray(19, this->_internal_tid_override(), target);
869 }
870
871 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
872 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
873 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
874 }
875 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TrackEvent.LegacyEvent)
876 return target;
877 }
878
ByteSizeLong() const879 size_t TrackEvent_LegacyEvent::ByteSizeLong() const {
880 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TrackEvent.LegacyEvent)
881 size_t total_size = 0;
882
883 ::uint32_t cached_has_bits = 0;
884 // Prevent compiler warnings about cached_has_bits being unused
885 (void) cached_has_bits;
886
887 cached_has_bits = _impl_._has_bits_[0];
888 if (cached_has_bits & 0x000000ffu) {
889 // optional string id_scope = 7;
890 if (cached_has_bits & 0x00000001u) {
891 total_size += 1 +
892 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
893 this->_internal_id_scope());
894 }
895
896 // optional uint64 name_iid = 1;
897 if (cached_has_bits & 0x00000002u) {
898 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_name_iid());
899 }
900
901 // optional int64 duration_us = 3;
902 if (cached_has_bits & 0x00000004u) {
903 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_duration_us());
904 }
905
906 // optional int64 thread_duration_us = 4;
907 if (cached_has_bits & 0x00000008u) {
908 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_thread_duration_us());
909 }
910
911 // optional int32 phase = 2;
912 if (cached_has_bits & 0x00000010u) {
913 total_size += ::_pbi::WireFormatLite::Int32SizePlusOne(this->_internal_phase());
914 }
915
916 // optional bool use_async_tts = 9;
917 if (cached_has_bits & 0x00000020u) {
918 total_size += 1 + 1;
919 }
920
921 // optional bool bind_to_enclosing = 12;
922 if (cached_has_bits & 0x00000040u) {
923 total_size += 1 + 1;
924 }
925
926 // optional uint64 bind_id = 8;
927 if (cached_has_bits & 0x00000080u) {
928 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_bind_id());
929 }
930
931 }
932 if (cached_has_bits & 0x00001f00u) {
933 // optional .perfetto.protos.TrackEvent.LegacyEvent.FlowDirection flow_direction = 13;
934 if (cached_has_bits & 0x00000100u) {
935 total_size += 1 +
936 ::_pbi::WireFormatLite::EnumSize(this->_internal_flow_direction());
937 }
938
939 // optional .perfetto.protos.TrackEvent.LegacyEvent.InstantEventScope instant_event_scope = 14;
940 if (cached_has_bits & 0x00000200u) {
941 total_size += 1 +
942 ::_pbi::WireFormatLite::EnumSize(this->_internal_instant_event_scope());
943 }
944
945 // optional int64 thread_instruction_delta = 15;
946 if (cached_has_bits & 0x00000400u) {
947 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_thread_instruction_delta());
948 }
949
950 // optional int32 pid_override = 18;
951 if (cached_has_bits & 0x00000800u) {
952 total_size += 2 +
953 ::_pbi::WireFormatLite::Int32Size(
954 this->_internal_pid_override());
955 }
956
957 // optional int32 tid_override = 19;
958 if (cached_has_bits & 0x00001000u) {
959 total_size += 2 +
960 ::_pbi::WireFormatLite::Int32Size(
961 this->_internal_tid_override());
962 }
963
964 }
965 switch (id_case()) {
966 // uint64 unscoped_id = 6;
967 case kUnscopedId: {
968 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_unscoped_id());
969 break;
970 }
971 // uint64 local_id = 10;
972 case kLocalId: {
973 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_local_id());
974 break;
975 }
976 // uint64 global_id = 11;
977 case kGlobalId: {
978 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_global_id());
979 break;
980 }
981 case ID_NOT_SET: {
982 break;
983 }
984 }
985 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
986 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
987 }
988 int cached_size = ::_pbi::ToCachedSize(total_size);
989 SetCachedSize(cached_size);
990 return total_size;
991 }
992
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)993 void TrackEvent_LegacyEvent::CheckTypeAndMergeFrom(
994 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
995 MergeFrom(*::_pbi::DownCast<const TrackEvent_LegacyEvent*>(
996 &from));
997 }
998
MergeFrom(const TrackEvent_LegacyEvent & from)999 void TrackEvent_LegacyEvent::MergeFrom(const TrackEvent_LegacyEvent& from) {
1000 TrackEvent_LegacyEvent* const _this = this;
1001 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TrackEvent.LegacyEvent)
1002 GOOGLE_DCHECK_NE(&from, _this);
1003 ::uint32_t cached_has_bits = 0;
1004 (void) cached_has_bits;
1005
1006 cached_has_bits = from._impl_._has_bits_[0];
1007 if (cached_has_bits & 0x000000ffu) {
1008 if (cached_has_bits & 0x00000001u) {
1009 _this->_internal_set_id_scope(from._internal_id_scope());
1010 }
1011 if (cached_has_bits & 0x00000002u) {
1012 _this->_impl_.name_iid_ = from._impl_.name_iid_;
1013 }
1014 if (cached_has_bits & 0x00000004u) {
1015 _this->_impl_.duration_us_ = from._impl_.duration_us_;
1016 }
1017 if (cached_has_bits & 0x00000008u) {
1018 _this->_impl_.thread_duration_us_ = from._impl_.thread_duration_us_;
1019 }
1020 if (cached_has_bits & 0x00000010u) {
1021 _this->_impl_.phase_ = from._impl_.phase_;
1022 }
1023 if (cached_has_bits & 0x00000020u) {
1024 _this->_impl_.use_async_tts_ = from._impl_.use_async_tts_;
1025 }
1026 if (cached_has_bits & 0x00000040u) {
1027 _this->_impl_.bind_to_enclosing_ = from._impl_.bind_to_enclosing_;
1028 }
1029 if (cached_has_bits & 0x00000080u) {
1030 _this->_impl_.bind_id_ = from._impl_.bind_id_;
1031 }
1032 _this->_impl_._has_bits_[0] |= cached_has_bits;
1033 }
1034 if (cached_has_bits & 0x00001f00u) {
1035 if (cached_has_bits & 0x00000100u) {
1036 _this->_impl_.flow_direction_ = from._impl_.flow_direction_;
1037 }
1038 if (cached_has_bits & 0x00000200u) {
1039 _this->_impl_.instant_event_scope_ = from._impl_.instant_event_scope_;
1040 }
1041 if (cached_has_bits & 0x00000400u) {
1042 _this->_impl_.thread_instruction_delta_ = from._impl_.thread_instruction_delta_;
1043 }
1044 if (cached_has_bits & 0x00000800u) {
1045 _this->_impl_.pid_override_ = from._impl_.pid_override_;
1046 }
1047 if (cached_has_bits & 0x00001000u) {
1048 _this->_impl_.tid_override_ = from._impl_.tid_override_;
1049 }
1050 _this->_impl_._has_bits_[0] |= cached_has_bits;
1051 }
1052 switch (from.id_case()) {
1053 case kUnscopedId: {
1054 _this->_internal_set_unscoped_id(from._internal_unscoped_id());
1055 break;
1056 }
1057 case kLocalId: {
1058 _this->_internal_set_local_id(from._internal_local_id());
1059 break;
1060 }
1061 case kGlobalId: {
1062 _this->_internal_set_global_id(from._internal_global_id());
1063 break;
1064 }
1065 case ID_NOT_SET: {
1066 break;
1067 }
1068 }
1069 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1070 }
1071
CopyFrom(const TrackEvent_LegacyEvent & from)1072 void TrackEvent_LegacyEvent::CopyFrom(const TrackEvent_LegacyEvent& from) {
1073 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TrackEvent.LegacyEvent)
1074 if (&from == this) return;
1075 Clear();
1076 MergeFrom(from);
1077 }
1078
IsInitialized() const1079 bool TrackEvent_LegacyEvent::IsInitialized() const {
1080 return true;
1081 }
1082
InternalSwap(TrackEvent_LegacyEvent * other)1083 void TrackEvent_LegacyEvent::InternalSwap(TrackEvent_LegacyEvent* other) {
1084 using std::swap;
1085 auto* lhs_arena = GetArenaForAllocation();
1086 auto* rhs_arena = other->GetArenaForAllocation();
1087 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
1088 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
1089 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
1090 &_impl_.id_scope_, lhs_arena,
1091 &other->_impl_.id_scope_, rhs_arena
1092 );
1093 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
1094 PROTOBUF_FIELD_OFFSET(TrackEvent_LegacyEvent, _impl_.tid_override_)
1095 + sizeof(TrackEvent_LegacyEvent::_impl_.tid_override_) // NOLINT
1096 - PROTOBUF_FIELD_OFFSET(TrackEvent_LegacyEvent, _impl_.name_iid_)>(
1097 reinterpret_cast<char*>(&_impl_.name_iid_),
1098 reinterpret_cast<char*>(&other->_impl_.name_iid_));
1099 swap(_impl_.id_, other->_impl_.id_);
1100 swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
1101 }
1102
GetTypeName() const1103 std::string TrackEvent_LegacyEvent::GetTypeName() const {
1104 return "perfetto.protos.TrackEvent.LegacyEvent";
1105 }
1106
1107
1108 // ===================================================================
1109
1110 class TrackEvent::_Internal {
1111 public:
1112 using HasBits = decltype(std::declval<TrackEvent>()._impl_._has_bits_);
set_has_type(HasBits * has_bits)1113 static void set_has_type(HasBits* has_bits) {
1114 (*has_bits)[0] |= 524288u;
1115 }
set_has_track_uuid(HasBits * has_bits)1116 static void set_has_track_uuid(HasBits* has_bits) {
1117 (*has_bits)[0] |= 262144u;
1118 }
1119 static const ::perfetto::protos::TaskExecution& task_execution(const TrackEvent* msg);
set_has_task_execution(HasBits * has_bits)1120 static void set_has_task_execution(HasBits* has_bits) {
1121 (*has_bits)[0] |= 1u;
1122 }
1123 static const ::perfetto::protos::LogMessage& log_message(const TrackEvent* msg);
set_has_log_message(HasBits * has_bits)1124 static void set_has_log_message(HasBits* has_bits) {
1125 (*has_bits)[0] |= 4u;
1126 }
1127 static const ::perfetto::protos::ChromeCompositorSchedulerState& cc_scheduler_state(const TrackEvent* msg);
set_has_cc_scheduler_state(HasBits * has_bits)1128 static void set_has_cc_scheduler_state(HasBits* has_bits) {
1129 (*has_bits)[0] |= 8u;
1130 }
1131 static const ::perfetto::protos::ChromeUserEvent& chrome_user_event(const TrackEvent* msg);
set_has_chrome_user_event(HasBits * has_bits)1132 static void set_has_chrome_user_event(HasBits* has_bits) {
1133 (*has_bits)[0] |= 16u;
1134 }
1135 static const ::perfetto::protos::ChromeKeyedService& chrome_keyed_service(const TrackEvent* msg);
set_has_chrome_keyed_service(HasBits * has_bits)1136 static void set_has_chrome_keyed_service(HasBits* has_bits) {
1137 (*has_bits)[0] |= 32u;
1138 }
1139 static const ::perfetto::protos::ChromeLegacyIpc& chrome_legacy_ipc(const TrackEvent* msg);
set_has_chrome_legacy_ipc(HasBits * has_bits)1140 static void set_has_chrome_legacy_ipc(HasBits* has_bits) {
1141 (*has_bits)[0] |= 64u;
1142 }
1143 static const ::perfetto::protos::ChromeHistogramSample& chrome_histogram_sample(const TrackEvent* msg);
set_has_chrome_histogram_sample(HasBits * has_bits)1144 static void set_has_chrome_histogram_sample(HasBits* has_bits) {
1145 (*has_bits)[0] |= 128u;
1146 }
1147 static const ::perfetto::protos::ChromeLatencyInfo& chrome_latency_info(const TrackEvent* msg);
set_has_chrome_latency_info(HasBits * has_bits)1148 static void set_has_chrome_latency_info(HasBits* has_bits) {
1149 (*has_bits)[0] |= 256u;
1150 }
1151 static const ::perfetto::protos::ChromeFrameReporter& chrome_frame_reporter(const TrackEvent* msg);
set_has_chrome_frame_reporter(HasBits * has_bits)1152 static void set_has_chrome_frame_reporter(HasBits* has_bits) {
1153 (*has_bits)[0] |= 512u;
1154 }
1155 static const ::perfetto::protos::ChromeApplicationStateInfo& chrome_application_state_info(const TrackEvent* msg);
set_has_chrome_application_state_info(HasBits * has_bits)1156 static void set_has_chrome_application_state_info(HasBits* has_bits) {
1157 (*has_bits)[0] |= 4096u;
1158 }
1159 static const ::perfetto::protos::ChromeRendererSchedulerState& chrome_renderer_scheduler_state(const TrackEvent* msg);
set_has_chrome_renderer_scheduler_state(HasBits * has_bits)1160 static void set_has_chrome_renderer_scheduler_state(HasBits* has_bits) {
1161 (*has_bits)[0] |= 8192u;
1162 }
1163 static const ::perfetto::protos::ChromeWindowHandleEventInfo& chrome_window_handle_event_info(const TrackEvent* msg);
set_has_chrome_window_handle_event_info(HasBits * has_bits)1164 static void set_has_chrome_window_handle_event_info(HasBits* has_bits) {
1165 (*has_bits)[0] |= 16384u;
1166 }
1167 static const ::perfetto::protos::ChromeContentSettingsEventInfo& chrome_content_settings_event_info(const TrackEvent* msg);
set_has_chrome_content_settings_event_info(HasBits * has_bits)1168 static void set_has_chrome_content_settings_event_info(HasBits* has_bits) {
1169 (*has_bits)[0] |= 32768u;
1170 }
1171 static const ::perfetto::protos::ChromeActiveProcesses& chrome_active_processes(const TrackEvent* msg);
set_has_chrome_active_processes(HasBits * has_bits)1172 static void set_has_chrome_active_processes(HasBits* has_bits) {
1173 (*has_bits)[0] |= 65536u;
1174 }
1175 static const ::perfetto::protos::Screenshot& screenshot(const TrackEvent* msg);
set_has_screenshot(HasBits * has_bits)1176 static void set_has_screenshot(HasBits* has_bits) {
1177 (*has_bits)[0] |= 131072u;
1178 }
1179 static const ::perfetto::protos::SourceLocation& source_location(const TrackEvent* msg);
1180 static const ::perfetto::protos::ChromeMessagePump& chrome_message_pump(const TrackEvent* msg);
set_has_chrome_message_pump(HasBits * has_bits)1181 static void set_has_chrome_message_pump(HasBits* has_bits) {
1182 (*has_bits)[0] |= 1024u;
1183 }
1184 static const ::perfetto::protos::ChromeMojoEventInfo& chrome_mojo_event_info(const TrackEvent* msg);
set_has_chrome_mojo_event_info(HasBits * has_bits)1185 static void set_has_chrome_mojo_event_info(HasBits* has_bits) {
1186 (*has_bits)[0] |= 2048u;
1187 }
1188 static const ::perfetto::protos::TrackEvent_LegacyEvent& legacy_event(const TrackEvent* msg);
set_has_legacy_event(HasBits * has_bits)1189 static void set_has_legacy_event(HasBits* has_bits) {
1190 (*has_bits)[0] |= 2u;
1191 }
1192 };
1193
1194 const ::perfetto::protos::TaskExecution&
task_execution(const TrackEvent * msg)1195 TrackEvent::_Internal::task_execution(const TrackEvent* msg) {
1196 return *msg->_impl_.task_execution_;
1197 }
1198 const ::perfetto::protos::LogMessage&
log_message(const TrackEvent * msg)1199 TrackEvent::_Internal::log_message(const TrackEvent* msg) {
1200 return *msg->_impl_.log_message_;
1201 }
1202 const ::perfetto::protos::ChromeCompositorSchedulerState&
cc_scheduler_state(const TrackEvent * msg)1203 TrackEvent::_Internal::cc_scheduler_state(const TrackEvent* msg) {
1204 return *msg->_impl_.cc_scheduler_state_;
1205 }
1206 const ::perfetto::protos::ChromeUserEvent&
chrome_user_event(const TrackEvent * msg)1207 TrackEvent::_Internal::chrome_user_event(const TrackEvent* msg) {
1208 return *msg->_impl_.chrome_user_event_;
1209 }
1210 const ::perfetto::protos::ChromeKeyedService&
chrome_keyed_service(const TrackEvent * msg)1211 TrackEvent::_Internal::chrome_keyed_service(const TrackEvent* msg) {
1212 return *msg->_impl_.chrome_keyed_service_;
1213 }
1214 const ::perfetto::protos::ChromeLegacyIpc&
chrome_legacy_ipc(const TrackEvent * msg)1215 TrackEvent::_Internal::chrome_legacy_ipc(const TrackEvent* msg) {
1216 return *msg->_impl_.chrome_legacy_ipc_;
1217 }
1218 const ::perfetto::protos::ChromeHistogramSample&
chrome_histogram_sample(const TrackEvent * msg)1219 TrackEvent::_Internal::chrome_histogram_sample(const TrackEvent* msg) {
1220 return *msg->_impl_.chrome_histogram_sample_;
1221 }
1222 const ::perfetto::protos::ChromeLatencyInfo&
chrome_latency_info(const TrackEvent * msg)1223 TrackEvent::_Internal::chrome_latency_info(const TrackEvent* msg) {
1224 return *msg->_impl_.chrome_latency_info_;
1225 }
1226 const ::perfetto::protos::ChromeFrameReporter&
chrome_frame_reporter(const TrackEvent * msg)1227 TrackEvent::_Internal::chrome_frame_reporter(const TrackEvent* msg) {
1228 return *msg->_impl_.chrome_frame_reporter_;
1229 }
1230 const ::perfetto::protos::ChromeApplicationStateInfo&
chrome_application_state_info(const TrackEvent * msg)1231 TrackEvent::_Internal::chrome_application_state_info(const TrackEvent* msg) {
1232 return *msg->_impl_.chrome_application_state_info_;
1233 }
1234 const ::perfetto::protos::ChromeRendererSchedulerState&
chrome_renderer_scheduler_state(const TrackEvent * msg)1235 TrackEvent::_Internal::chrome_renderer_scheduler_state(const TrackEvent* msg) {
1236 return *msg->_impl_.chrome_renderer_scheduler_state_;
1237 }
1238 const ::perfetto::protos::ChromeWindowHandleEventInfo&
chrome_window_handle_event_info(const TrackEvent * msg)1239 TrackEvent::_Internal::chrome_window_handle_event_info(const TrackEvent* msg) {
1240 return *msg->_impl_.chrome_window_handle_event_info_;
1241 }
1242 const ::perfetto::protos::ChromeContentSettingsEventInfo&
chrome_content_settings_event_info(const TrackEvent * msg)1243 TrackEvent::_Internal::chrome_content_settings_event_info(const TrackEvent* msg) {
1244 return *msg->_impl_.chrome_content_settings_event_info_;
1245 }
1246 const ::perfetto::protos::ChromeActiveProcesses&
chrome_active_processes(const TrackEvent * msg)1247 TrackEvent::_Internal::chrome_active_processes(const TrackEvent* msg) {
1248 return *msg->_impl_.chrome_active_processes_;
1249 }
1250 const ::perfetto::protos::Screenshot&
screenshot(const TrackEvent * msg)1251 TrackEvent::_Internal::screenshot(const TrackEvent* msg) {
1252 return *msg->_impl_.screenshot_;
1253 }
1254 const ::perfetto::protos::SourceLocation&
source_location(const TrackEvent * msg)1255 TrackEvent::_Internal::source_location(const TrackEvent* msg) {
1256 return *msg->_impl_.source_location_field_.source_location_;
1257 }
1258 const ::perfetto::protos::ChromeMessagePump&
chrome_message_pump(const TrackEvent * msg)1259 TrackEvent::_Internal::chrome_message_pump(const TrackEvent* msg) {
1260 return *msg->_impl_.chrome_message_pump_;
1261 }
1262 const ::perfetto::protos::ChromeMojoEventInfo&
chrome_mojo_event_info(const TrackEvent * msg)1263 TrackEvent::_Internal::chrome_mojo_event_info(const TrackEvent* msg) {
1264 return *msg->_impl_.chrome_mojo_event_info_;
1265 }
1266 const ::perfetto::protos::TrackEvent_LegacyEvent&
legacy_event(const TrackEvent * msg)1267 TrackEvent::_Internal::legacy_event(const TrackEvent* msg) {
1268 return *msg->_impl_.legacy_event_;
1269 }
clear_debug_annotations()1270 void TrackEvent::clear_debug_annotations() {
1271 _impl_.debug_annotations_.Clear();
1272 }
clear_task_execution()1273 void TrackEvent::clear_task_execution() {
1274 if (_impl_.task_execution_ != nullptr) _impl_.task_execution_->Clear();
1275 _impl_._has_bits_[0] &= ~0x00000001u;
1276 }
clear_log_message()1277 void TrackEvent::clear_log_message() {
1278 if (_impl_.log_message_ != nullptr) _impl_.log_message_->Clear();
1279 _impl_._has_bits_[0] &= ~0x00000004u;
1280 }
clear_cc_scheduler_state()1281 void TrackEvent::clear_cc_scheduler_state() {
1282 if (_impl_.cc_scheduler_state_ != nullptr) _impl_.cc_scheduler_state_->Clear();
1283 _impl_._has_bits_[0] &= ~0x00000008u;
1284 }
clear_chrome_user_event()1285 void TrackEvent::clear_chrome_user_event() {
1286 if (_impl_.chrome_user_event_ != nullptr) _impl_.chrome_user_event_->Clear();
1287 _impl_._has_bits_[0] &= ~0x00000010u;
1288 }
clear_chrome_keyed_service()1289 void TrackEvent::clear_chrome_keyed_service() {
1290 if (_impl_.chrome_keyed_service_ != nullptr) _impl_.chrome_keyed_service_->Clear();
1291 _impl_._has_bits_[0] &= ~0x00000020u;
1292 }
clear_chrome_legacy_ipc()1293 void TrackEvent::clear_chrome_legacy_ipc() {
1294 if (_impl_.chrome_legacy_ipc_ != nullptr) _impl_.chrome_legacy_ipc_->Clear();
1295 _impl_._has_bits_[0] &= ~0x00000040u;
1296 }
clear_chrome_histogram_sample()1297 void TrackEvent::clear_chrome_histogram_sample() {
1298 if (_impl_.chrome_histogram_sample_ != nullptr) _impl_.chrome_histogram_sample_->Clear();
1299 _impl_._has_bits_[0] &= ~0x00000080u;
1300 }
clear_chrome_latency_info()1301 void TrackEvent::clear_chrome_latency_info() {
1302 if (_impl_.chrome_latency_info_ != nullptr) _impl_.chrome_latency_info_->Clear();
1303 _impl_._has_bits_[0] &= ~0x00000100u;
1304 }
clear_chrome_frame_reporter()1305 void TrackEvent::clear_chrome_frame_reporter() {
1306 if (_impl_.chrome_frame_reporter_ != nullptr) _impl_.chrome_frame_reporter_->Clear();
1307 _impl_._has_bits_[0] &= ~0x00000200u;
1308 }
clear_chrome_application_state_info()1309 void TrackEvent::clear_chrome_application_state_info() {
1310 if (_impl_.chrome_application_state_info_ != nullptr) _impl_.chrome_application_state_info_->Clear();
1311 _impl_._has_bits_[0] &= ~0x00001000u;
1312 }
clear_chrome_renderer_scheduler_state()1313 void TrackEvent::clear_chrome_renderer_scheduler_state() {
1314 if (_impl_.chrome_renderer_scheduler_state_ != nullptr) _impl_.chrome_renderer_scheduler_state_->Clear();
1315 _impl_._has_bits_[0] &= ~0x00002000u;
1316 }
clear_chrome_window_handle_event_info()1317 void TrackEvent::clear_chrome_window_handle_event_info() {
1318 if (_impl_.chrome_window_handle_event_info_ != nullptr) _impl_.chrome_window_handle_event_info_->Clear();
1319 _impl_._has_bits_[0] &= ~0x00004000u;
1320 }
clear_chrome_content_settings_event_info()1321 void TrackEvent::clear_chrome_content_settings_event_info() {
1322 if (_impl_.chrome_content_settings_event_info_ != nullptr) _impl_.chrome_content_settings_event_info_->Clear();
1323 _impl_._has_bits_[0] &= ~0x00008000u;
1324 }
clear_chrome_active_processes()1325 void TrackEvent::clear_chrome_active_processes() {
1326 if (_impl_.chrome_active_processes_ != nullptr) _impl_.chrome_active_processes_->Clear();
1327 _impl_._has_bits_[0] &= ~0x00010000u;
1328 }
clear_screenshot()1329 void TrackEvent::clear_screenshot() {
1330 if (_impl_.screenshot_ != nullptr) _impl_.screenshot_->Clear();
1331 _impl_._has_bits_[0] &= ~0x00020000u;
1332 }
set_allocated_source_location(::perfetto::protos::SourceLocation * source_location)1333 void TrackEvent::set_allocated_source_location(::perfetto::protos::SourceLocation* source_location) {
1334 ::PROTOBUF_NAMESPACE_ID::Arena* message_arena = GetArenaForAllocation();
1335 clear_source_location_field();
1336 if (source_location) {
1337 ::PROTOBUF_NAMESPACE_ID::Arena* submessage_arena =
1338 ::PROTOBUF_NAMESPACE_ID::Arena::InternalGetOwningArena(
1339 reinterpret_cast<::PROTOBUF_NAMESPACE_ID::MessageLite*>(source_location));
1340 if (message_arena != submessage_arena) {
1341 source_location = ::PROTOBUF_NAMESPACE_ID::internal::GetOwnedMessage(
1342 message_arena, source_location, submessage_arena);
1343 }
1344 set_has_source_location();
1345 _impl_.source_location_field_.source_location_ = source_location;
1346 }
1347 // @@protoc_insertion_point(field_set_allocated:perfetto.protos.TrackEvent.source_location)
1348 }
clear_source_location()1349 void TrackEvent::clear_source_location() {
1350 if (_internal_has_source_location()) {
1351 if (GetArenaForAllocation() == nullptr) {
1352 delete _impl_.source_location_field_.source_location_;
1353 }
1354 clear_has_source_location_field();
1355 }
1356 }
clear_chrome_message_pump()1357 void TrackEvent::clear_chrome_message_pump() {
1358 if (_impl_.chrome_message_pump_ != nullptr) _impl_.chrome_message_pump_->Clear();
1359 _impl_._has_bits_[0] &= ~0x00000400u;
1360 }
clear_chrome_mojo_event_info()1361 void TrackEvent::clear_chrome_mojo_event_info() {
1362 if (_impl_.chrome_mojo_event_info_ != nullptr) _impl_.chrome_mojo_event_info_->Clear();
1363 _impl_._has_bits_[0] &= ~0x00000800u;
1364 }
TrackEvent(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)1365 TrackEvent::TrackEvent(::PROTOBUF_NAMESPACE_ID::Arena* arena,
1366 bool is_message_owned)
1367 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
1368 SharedCtor(arena, is_message_owned);
1369 // @@protoc_insertion_point(arena_constructor:perfetto.protos.TrackEvent)
1370 }
TrackEvent(const TrackEvent & from)1371 TrackEvent::TrackEvent(const TrackEvent& from)
1372 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
1373 TrackEvent* const _this = this; (void)_this;
1374 new (&_impl_) Impl_{
1375 /*decltype(_impl_._extensions_)*/{}
1376 , decltype(_impl_._has_bits_){from._impl_._has_bits_}
1377 , /*decltype(_impl_._cached_size_)*/{}
1378 , decltype(_impl_.category_iids_){from._impl_.category_iids_}
1379 , decltype(_impl_.debug_annotations_){from._impl_.debug_annotations_}
1380 , decltype(_impl_.extra_counter_values_){from._impl_.extra_counter_values_}
1381 , decltype(_impl_.categories_){from._impl_.categories_}
1382 , decltype(_impl_.extra_counter_track_uuids_){from._impl_.extra_counter_track_uuids_}
1383 , decltype(_impl_.flow_ids_old_){from._impl_.flow_ids_old_}
1384 , decltype(_impl_.terminating_flow_ids_old_){from._impl_.terminating_flow_ids_old_}
1385 , decltype(_impl_.extra_double_counter_track_uuids_){from._impl_.extra_double_counter_track_uuids_}
1386 , decltype(_impl_.extra_double_counter_values_){from._impl_.extra_double_counter_values_}
1387 , decltype(_impl_.flow_ids_){from._impl_.flow_ids_}
1388 , decltype(_impl_.terminating_flow_ids_){from._impl_.terminating_flow_ids_}
1389 , decltype(_impl_.task_execution_){nullptr}
1390 , decltype(_impl_.legacy_event_){nullptr}
1391 , decltype(_impl_.log_message_){nullptr}
1392 , decltype(_impl_.cc_scheduler_state_){nullptr}
1393 , decltype(_impl_.chrome_user_event_){nullptr}
1394 , decltype(_impl_.chrome_keyed_service_){nullptr}
1395 , decltype(_impl_.chrome_legacy_ipc_){nullptr}
1396 , decltype(_impl_.chrome_histogram_sample_){nullptr}
1397 , decltype(_impl_.chrome_latency_info_){nullptr}
1398 , decltype(_impl_.chrome_frame_reporter_){nullptr}
1399 , decltype(_impl_.chrome_message_pump_){nullptr}
1400 , decltype(_impl_.chrome_mojo_event_info_){nullptr}
1401 , decltype(_impl_.chrome_application_state_info_){nullptr}
1402 , decltype(_impl_.chrome_renderer_scheduler_state_){nullptr}
1403 , decltype(_impl_.chrome_window_handle_event_info_){nullptr}
1404 , decltype(_impl_.chrome_content_settings_event_info_){nullptr}
1405 , decltype(_impl_.chrome_active_processes_){nullptr}
1406 , decltype(_impl_.screenshot_){nullptr}
1407 , decltype(_impl_.track_uuid_){}
1408 , decltype(_impl_.type_){}
1409 , decltype(_impl_.name_field_){}
1410 , decltype(_impl_.counter_value_field_){}
1411 , decltype(_impl_.source_location_field_){}
1412 , decltype(_impl_.timestamp_){}
1413 , decltype(_impl_.thread_time_){}
1414 , decltype(_impl_.thread_instruction_count_){}
1415 , /*decltype(_impl_._oneof_case_)*/{}};
1416
1417 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
1418 _impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
1419 if (from._internal_has_task_execution()) {
1420 _this->_impl_.task_execution_ = new ::perfetto::protos::TaskExecution(*from._impl_.task_execution_);
1421 }
1422 if (from._internal_has_legacy_event()) {
1423 _this->_impl_.legacy_event_ = new ::perfetto::protos::TrackEvent_LegacyEvent(*from._impl_.legacy_event_);
1424 }
1425 if (from._internal_has_log_message()) {
1426 _this->_impl_.log_message_ = new ::perfetto::protos::LogMessage(*from._impl_.log_message_);
1427 }
1428 if (from._internal_has_cc_scheduler_state()) {
1429 _this->_impl_.cc_scheduler_state_ = new ::perfetto::protos::ChromeCompositorSchedulerState(*from._impl_.cc_scheduler_state_);
1430 }
1431 if (from._internal_has_chrome_user_event()) {
1432 _this->_impl_.chrome_user_event_ = new ::perfetto::protos::ChromeUserEvent(*from._impl_.chrome_user_event_);
1433 }
1434 if (from._internal_has_chrome_keyed_service()) {
1435 _this->_impl_.chrome_keyed_service_ = new ::perfetto::protos::ChromeKeyedService(*from._impl_.chrome_keyed_service_);
1436 }
1437 if (from._internal_has_chrome_legacy_ipc()) {
1438 _this->_impl_.chrome_legacy_ipc_ = new ::perfetto::protos::ChromeLegacyIpc(*from._impl_.chrome_legacy_ipc_);
1439 }
1440 if (from._internal_has_chrome_histogram_sample()) {
1441 _this->_impl_.chrome_histogram_sample_ = new ::perfetto::protos::ChromeHistogramSample(*from._impl_.chrome_histogram_sample_);
1442 }
1443 if (from._internal_has_chrome_latency_info()) {
1444 _this->_impl_.chrome_latency_info_ = new ::perfetto::protos::ChromeLatencyInfo(*from._impl_.chrome_latency_info_);
1445 }
1446 if (from._internal_has_chrome_frame_reporter()) {
1447 _this->_impl_.chrome_frame_reporter_ = new ::perfetto::protos::ChromeFrameReporter(*from._impl_.chrome_frame_reporter_);
1448 }
1449 if (from._internal_has_chrome_message_pump()) {
1450 _this->_impl_.chrome_message_pump_ = new ::perfetto::protos::ChromeMessagePump(*from._impl_.chrome_message_pump_);
1451 }
1452 if (from._internal_has_chrome_mojo_event_info()) {
1453 _this->_impl_.chrome_mojo_event_info_ = new ::perfetto::protos::ChromeMojoEventInfo(*from._impl_.chrome_mojo_event_info_);
1454 }
1455 if (from._internal_has_chrome_application_state_info()) {
1456 _this->_impl_.chrome_application_state_info_ = new ::perfetto::protos::ChromeApplicationStateInfo(*from._impl_.chrome_application_state_info_);
1457 }
1458 if (from._internal_has_chrome_renderer_scheduler_state()) {
1459 _this->_impl_.chrome_renderer_scheduler_state_ = new ::perfetto::protos::ChromeRendererSchedulerState(*from._impl_.chrome_renderer_scheduler_state_);
1460 }
1461 if (from._internal_has_chrome_window_handle_event_info()) {
1462 _this->_impl_.chrome_window_handle_event_info_ = new ::perfetto::protos::ChromeWindowHandleEventInfo(*from._impl_.chrome_window_handle_event_info_);
1463 }
1464 if (from._internal_has_chrome_content_settings_event_info()) {
1465 _this->_impl_.chrome_content_settings_event_info_ = new ::perfetto::protos::ChromeContentSettingsEventInfo(*from._impl_.chrome_content_settings_event_info_);
1466 }
1467 if (from._internal_has_chrome_active_processes()) {
1468 _this->_impl_.chrome_active_processes_ = new ::perfetto::protos::ChromeActiveProcesses(*from._impl_.chrome_active_processes_);
1469 }
1470 if (from._internal_has_screenshot()) {
1471 _this->_impl_.screenshot_ = new ::perfetto::protos::Screenshot(*from._impl_.screenshot_);
1472 }
1473 ::memcpy(&_impl_.track_uuid_, &from._impl_.track_uuid_,
1474 static_cast<size_t>(reinterpret_cast<char*>(&_impl_.type_) -
1475 reinterpret_cast<char*>(&_impl_.track_uuid_)) + sizeof(_impl_.type_));
1476 clear_has_name_field();
1477 switch (from.name_field_case()) {
1478 case kNameIid: {
1479 _this->_internal_set_name_iid(from._internal_name_iid());
1480 break;
1481 }
1482 case kName: {
1483 _this->_internal_set_name(from._internal_name());
1484 break;
1485 }
1486 case NAME_FIELD_NOT_SET: {
1487 break;
1488 }
1489 }
1490 clear_has_counter_value_field();
1491 switch (from.counter_value_field_case()) {
1492 case kCounterValue: {
1493 _this->_internal_set_counter_value(from._internal_counter_value());
1494 break;
1495 }
1496 case kDoubleCounterValue: {
1497 _this->_internal_set_double_counter_value(from._internal_double_counter_value());
1498 break;
1499 }
1500 case COUNTER_VALUE_FIELD_NOT_SET: {
1501 break;
1502 }
1503 }
1504 clear_has_source_location_field();
1505 switch (from.source_location_field_case()) {
1506 case kSourceLocation: {
1507 _this->_internal_mutable_source_location()->::perfetto::protos::SourceLocation::MergeFrom(
1508 from._internal_source_location());
1509 break;
1510 }
1511 case kSourceLocationIid: {
1512 _this->_internal_set_source_location_iid(from._internal_source_location_iid());
1513 break;
1514 }
1515 case SOURCE_LOCATION_FIELD_NOT_SET: {
1516 break;
1517 }
1518 }
1519 clear_has_timestamp();
1520 switch (from.timestamp_case()) {
1521 case kTimestampDeltaUs: {
1522 _this->_internal_set_timestamp_delta_us(from._internal_timestamp_delta_us());
1523 break;
1524 }
1525 case kTimestampAbsoluteUs: {
1526 _this->_internal_set_timestamp_absolute_us(from._internal_timestamp_absolute_us());
1527 break;
1528 }
1529 case TIMESTAMP_NOT_SET: {
1530 break;
1531 }
1532 }
1533 clear_has_thread_time();
1534 switch (from.thread_time_case()) {
1535 case kThreadTimeDeltaUs: {
1536 _this->_internal_set_thread_time_delta_us(from._internal_thread_time_delta_us());
1537 break;
1538 }
1539 case kThreadTimeAbsoluteUs: {
1540 _this->_internal_set_thread_time_absolute_us(from._internal_thread_time_absolute_us());
1541 break;
1542 }
1543 case THREAD_TIME_NOT_SET: {
1544 break;
1545 }
1546 }
1547 clear_has_thread_instruction_count();
1548 switch (from.thread_instruction_count_case()) {
1549 case kThreadInstructionCountDelta: {
1550 _this->_internal_set_thread_instruction_count_delta(from._internal_thread_instruction_count_delta());
1551 break;
1552 }
1553 case kThreadInstructionCountAbsolute: {
1554 _this->_internal_set_thread_instruction_count_absolute(from._internal_thread_instruction_count_absolute());
1555 break;
1556 }
1557 case THREAD_INSTRUCTION_COUNT_NOT_SET: {
1558 break;
1559 }
1560 }
1561 // @@protoc_insertion_point(copy_constructor:perfetto.protos.TrackEvent)
1562 }
1563
SharedCtor(::_pb::Arena * arena,bool is_message_owned)1564 inline void TrackEvent::SharedCtor(
1565 ::_pb::Arena* arena, bool is_message_owned) {
1566 (void)arena;
1567 (void)is_message_owned;
1568 new (&_impl_) Impl_{
1569 /*decltype(_impl_._extensions_)*/{::_pbi::ArenaInitialized(), arena}
1570 , decltype(_impl_._has_bits_){}
1571 , /*decltype(_impl_._cached_size_)*/{}
1572 , decltype(_impl_.category_iids_){arena}
1573 , decltype(_impl_.debug_annotations_){arena}
1574 , decltype(_impl_.extra_counter_values_){arena}
1575 , decltype(_impl_.categories_){arena}
1576 , decltype(_impl_.extra_counter_track_uuids_){arena}
1577 , decltype(_impl_.flow_ids_old_){arena}
1578 , decltype(_impl_.terminating_flow_ids_old_){arena}
1579 , decltype(_impl_.extra_double_counter_track_uuids_){arena}
1580 , decltype(_impl_.extra_double_counter_values_){arena}
1581 , decltype(_impl_.flow_ids_){arena}
1582 , decltype(_impl_.terminating_flow_ids_){arena}
1583 , decltype(_impl_.task_execution_){nullptr}
1584 , decltype(_impl_.legacy_event_){nullptr}
1585 , decltype(_impl_.log_message_){nullptr}
1586 , decltype(_impl_.cc_scheduler_state_){nullptr}
1587 , decltype(_impl_.chrome_user_event_){nullptr}
1588 , decltype(_impl_.chrome_keyed_service_){nullptr}
1589 , decltype(_impl_.chrome_legacy_ipc_){nullptr}
1590 , decltype(_impl_.chrome_histogram_sample_){nullptr}
1591 , decltype(_impl_.chrome_latency_info_){nullptr}
1592 , decltype(_impl_.chrome_frame_reporter_){nullptr}
1593 , decltype(_impl_.chrome_message_pump_){nullptr}
1594 , decltype(_impl_.chrome_mojo_event_info_){nullptr}
1595 , decltype(_impl_.chrome_application_state_info_){nullptr}
1596 , decltype(_impl_.chrome_renderer_scheduler_state_){nullptr}
1597 , decltype(_impl_.chrome_window_handle_event_info_){nullptr}
1598 , decltype(_impl_.chrome_content_settings_event_info_){nullptr}
1599 , decltype(_impl_.chrome_active_processes_){nullptr}
1600 , decltype(_impl_.screenshot_){nullptr}
1601 , decltype(_impl_.track_uuid_){::uint64_t{0u}}
1602 , decltype(_impl_.type_){0}
1603 , decltype(_impl_.name_field_){}
1604 , decltype(_impl_.counter_value_field_){}
1605 , decltype(_impl_.source_location_field_){}
1606 , decltype(_impl_.timestamp_){}
1607 , decltype(_impl_.thread_time_){}
1608 , decltype(_impl_.thread_instruction_count_){}
1609 , /*decltype(_impl_._oneof_case_)*/{}
1610 };
1611 clear_has_name_field();
1612 clear_has_counter_value_field();
1613 clear_has_source_location_field();
1614 clear_has_timestamp();
1615 clear_has_thread_time();
1616 clear_has_thread_instruction_count();
1617 }
1618
~TrackEvent()1619 TrackEvent::~TrackEvent() {
1620 // @@protoc_insertion_point(destructor:perfetto.protos.TrackEvent)
1621 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
1622 (void)arena;
1623 return;
1624 }
1625 SharedDtor();
1626 }
1627
SharedDtor()1628 inline void TrackEvent::SharedDtor() {
1629 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
1630 _impl_._extensions_.~ExtensionSet();
1631 _impl_.category_iids_.~RepeatedField();
1632 _impl_.debug_annotations_.~RepeatedPtrField();
1633 _impl_.extra_counter_values_.~RepeatedField();
1634 _impl_.categories_.~RepeatedPtrField();
1635 _impl_.extra_counter_track_uuids_.~RepeatedField();
1636 _impl_.flow_ids_old_.~RepeatedField();
1637 _impl_.terminating_flow_ids_old_.~RepeatedField();
1638 _impl_.extra_double_counter_track_uuids_.~RepeatedField();
1639 _impl_.extra_double_counter_values_.~RepeatedField();
1640 _impl_.flow_ids_.~RepeatedField();
1641 _impl_.terminating_flow_ids_.~RepeatedField();
1642 if (this != internal_default_instance()) delete _impl_.task_execution_;
1643 if (this != internal_default_instance()) delete _impl_.legacy_event_;
1644 if (this != internal_default_instance()) delete _impl_.log_message_;
1645 if (this != internal_default_instance()) delete _impl_.cc_scheduler_state_;
1646 if (this != internal_default_instance()) delete _impl_.chrome_user_event_;
1647 if (this != internal_default_instance()) delete _impl_.chrome_keyed_service_;
1648 if (this != internal_default_instance()) delete _impl_.chrome_legacy_ipc_;
1649 if (this != internal_default_instance()) delete _impl_.chrome_histogram_sample_;
1650 if (this != internal_default_instance()) delete _impl_.chrome_latency_info_;
1651 if (this != internal_default_instance()) delete _impl_.chrome_frame_reporter_;
1652 if (this != internal_default_instance()) delete _impl_.chrome_message_pump_;
1653 if (this != internal_default_instance()) delete _impl_.chrome_mojo_event_info_;
1654 if (this != internal_default_instance()) delete _impl_.chrome_application_state_info_;
1655 if (this != internal_default_instance()) delete _impl_.chrome_renderer_scheduler_state_;
1656 if (this != internal_default_instance()) delete _impl_.chrome_window_handle_event_info_;
1657 if (this != internal_default_instance()) delete _impl_.chrome_content_settings_event_info_;
1658 if (this != internal_default_instance()) delete _impl_.chrome_active_processes_;
1659 if (this != internal_default_instance()) delete _impl_.screenshot_;
1660 if (has_name_field()) {
1661 clear_name_field();
1662 }
1663 if (has_counter_value_field()) {
1664 clear_counter_value_field();
1665 }
1666 if (has_source_location_field()) {
1667 clear_source_location_field();
1668 }
1669 if (has_timestamp()) {
1670 clear_timestamp();
1671 }
1672 if (has_thread_time()) {
1673 clear_thread_time();
1674 }
1675 if (has_thread_instruction_count()) {
1676 clear_thread_instruction_count();
1677 }
1678 }
1679
SetCachedSize(int size) const1680 void TrackEvent::SetCachedSize(int size) const {
1681 _impl_._cached_size_.Set(size);
1682 }
1683
clear_name_field()1684 void TrackEvent::clear_name_field() {
1685 // @@protoc_insertion_point(one_of_clear_start:perfetto.protos.TrackEvent)
1686 switch (name_field_case()) {
1687 case kNameIid: {
1688 // No need to clear
1689 break;
1690 }
1691 case kName: {
1692 _impl_.name_field_.name_.Destroy();
1693 break;
1694 }
1695 case NAME_FIELD_NOT_SET: {
1696 break;
1697 }
1698 }
1699 _impl_._oneof_case_[0] = NAME_FIELD_NOT_SET;
1700 }
1701
clear_counter_value_field()1702 void TrackEvent::clear_counter_value_field() {
1703 // @@protoc_insertion_point(one_of_clear_start:perfetto.protos.TrackEvent)
1704 switch (counter_value_field_case()) {
1705 case kCounterValue: {
1706 // No need to clear
1707 break;
1708 }
1709 case kDoubleCounterValue: {
1710 // No need to clear
1711 break;
1712 }
1713 case COUNTER_VALUE_FIELD_NOT_SET: {
1714 break;
1715 }
1716 }
1717 _impl_._oneof_case_[1] = COUNTER_VALUE_FIELD_NOT_SET;
1718 }
1719
clear_source_location_field()1720 void TrackEvent::clear_source_location_field() {
1721 // @@protoc_insertion_point(one_of_clear_start:perfetto.protos.TrackEvent)
1722 switch (source_location_field_case()) {
1723 case kSourceLocation: {
1724 if (GetArenaForAllocation() == nullptr) {
1725 delete _impl_.source_location_field_.source_location_;
1726 }
1727 break;
1728 }
1729 case kSourceLocationIid: {
1730 // No need to clear
1731 break;
1732 }
1733 case SOURCE_LOCATION_FIELD_NOT_SET: {
1734 break;
1735 }
1736 }
1737 _impl_._oneof_case_[2] = SOURCE_LOCATION_FIELD_NOT_SET;
1738 }
1739
clear_timestamp()1740 void TrackEvent::clear_timestamp() {
1741 // @@protoc_insertion_point(one_of_clear_start:perfetto.protos.TrackEvent)
1742 switch (timestamp_case()) {
1743 case kTimestampDeltaUs: {
1744 // No need to clear
1745 break;
1746 }
1747 case kTimestampAbsoluteUs: {
1748 // No need to clear
1749 break;
1750 }
1751 case TIMESTAMP_NOT_SET: {
1752 break;
1753 }
1754 }
1755 _impl_._oneof_case_[3] = TIMESTAMP_NOT_SET;
1756 }
1757
clear_thread_time()1758 void TrackEvent::clear_thread_time() {
1759 // @@protoc_insertion_point(one_of_clear_start:perfetto.protos.TrackEvent)
1760 switch (thread_time_case()) {
1761 case kThreadTimeDeltaUs: {
1762 // No need to clear
1763 break;
1764 }
1765 case kThreadTimeAbsoluteUs: {
1766 // No need to clear
1767 break;
1768 }
1769 case THREAD_TIME_NOT_SET: {
1770 break;
1771 }
1772 }
1773 _impl_._oneof_case_[4] = THREAD_TIME_NOT_SET;
1774 }
1775
clear_thread_instruction_count()1776 void TrackEvent::clear_thread_instruction_count() {
1777 // @@protoc_insertion_point(one_of_clear_start:perfetto.protos.TrackEvent)
1778 switch (thread_instruction_count_case()) {
1779 case kThreadInstructionCountDelta: {
1780 // No need to clear
1781 break;
1782 }
1783 case kThreadInstructionCountAbsolute: {
1784 // No need to clear
1785 break;
1786 }
1787 case THREAD_INSTRUCTION_COUNT_NOT_SET: {
1788 break;
1789 }
1790 }
1791 _impl_._oneof_case_[5] = THREAD_INSTRUCTION_COUNT_NOT_SET;
1792 }
1793
1794
Clear()1795 void TrackEvent::Clear() {
1796 // @@protoc_insertion_point(message_clear_start:perfetto.protos.TrackEvent)
1797 ::uint32_t cached_has_bits = 0;
1798 // Prevent compiler warnings about cached_has_bits being unused
1799 (void) cached_has_bits;
1800
1801 _impl_._extensions_.Clear();
1802 _impl_.category_iids_.Clear();
1803 _impl_.debug_annotations_.Clear();
1804 _impl_.extra_counter_values_.Clear();
1805 _impl_.categories_.Clear();
1806 _impl_.extra_counter_track_uuids_.Clear();
1807 _impl_.flow_ids_old_.Clear();
1808 _impl_.terminating_flow_ids_old_.Clear();
1809 _impl_.extra_double_counter_track_uuids_.Clear();
1810 _impl_.extra_double_counter_values_.Clear();
1811 _impl_.flow_ids_.Clear();
1812 _impl_.terminating_flow_ids_.Clear();
1813 cached_has_bits = _impl_._has_bits_[0];
1814 if (cached_has_bits & 0x000000ffu) {
1815 if (cached_has_bits & 0x00000001u) {
1816 GOOGLE_DCHECK(_impl_.task_execution_ != nullptr);
1817 _impl_.task_execution_->Clear();
1818 }
1819 if (cached_has_bits & 0x00000002u) {
1820 GOOGLE_DCHECK(_impl_.legacy_event_ != nullptr);
1821 _impl_.legacy_event_->Clear();
1822 }
1823 if (cached_has_bits & 0x00000004u) {
1824 GOOGLE_DCHECK(_impl_.log_message_ != nullptr);
1825 _impl_.log_message_->Clear();
1826 }
1827 if (cached_has_bits & 0x00000008u) {
1828 GOOGLE_DCHECK(_impl_.cc_scheduler_state_ != nullptr);
1829 _impl_.cc_scheduler_state_->Clear();
1830 }
1831 if (cached_has_bits & 0x00000010u) {
1832 GOOGLE_DCHECK(_impl_.chrome_user_event_ != nullptr);
1833 _impl_.chrome_user_event_->Clear();
1834 }
1835 if (cached_has_bits & 0x00000020u) {
1836 GOOGLE_DCHECK(_impl_.chrome_keyed_service_ != nullptr);
1837 _impl_.chrome_keyed_service_->Clear();
1838 }
1839 if (cached_has_bits & 0x00000040u) {
1840 GOOGLE_DCHECK(_impl_.chrome_legacy_ipc_ != nullptr);
1841 _impl_.chrome_legacy_ipc_->Clear();
1842 }
1843 if (cached_has_bits & 0x00000080u) {
1844 GOOGLE_DCHECK(_impl_.chrome_histogram_sample_ != nullptr);
1845 _impl_.chrome_histogram_sample_->Clear();
1846 }
1847 }
1848 if (cached_has_bits & 0x0000ff00u) {
1849 if (cached_has_bits & 0x00000100u) {
1850 GOOGLE_DCHECK(_impl_.chrome_latency_info_ != nullptr);
1851 _impl_.chrome_latency_info_->Clear();
1852 }
1853 if (cached_has_bits & 0x00000200u) {
1854 GOOGLE_DCHECK(_impl_.chrome_frame_reporter_ != nullptr);
1855 _impl_.chrome_frame_reporter_->Clear();
1856 }
1857 if (cached_has_bits & 0x00000400u) {
1858 GOOGLE_DCHECK(_impl_.chrome_message_pump_ != nullptr);
1859 _impl_.chrome_message_pump_->Clear();
1860 }
1861 if (cached_has_bits & 0x00000800u) {
1862 GOOGLE_DCHECK(_impl_.chrome_mojo_event_info_ != nullptr);
1863 _impl_.chrome_mojo_event_info_->Clear();
1864 }
1865 if (cached_has_bits & 0x00001000u) {
1866 GOOGLE_DCHECK(_impl_.chrome_application_state_info_ != nullptr);
1867 _impl_.chrome_application_state_info_->Clear();
1868 }
1869 if (cached_has_bits & 0x00002000u) {
1870 GOOGLE_DCHECK(_impl_.chrome_renderer_scheduler_state_ != nullptr);
1871 _impl_.chrome_renderer_scheduler_state_->Clear();
1872 }
1873 if (cached_has_bits & 0x00004000u) {
1874 GOOGLE_DCHECK(_impl_.chrome_window_handle_event_info_ != nullptr);
1875 _impl_.chrome_window_handle_event_info_->Clear();
1876 }
1877 if (cached_has_bits & 0x00008000u) {
1878 GOOGLE_DCHECK(_impl_.chrome_content_settings_event_info_ != nullptr);
1879 _impl_.chrome_content_settings_event_info_->Clear();
1880 }
1881 }
1882 if (cached_has_bits & 0x00030000u) {
1883 if (cached_has_bits & 0x00010000u) {
1884 GOOGLE_DCHECK(_impl_.chrome_active_processes_ != nullptr);
1885 _impl_.chrome_active_processes_->Clear();
1886 }
1887 if (cached_has_bits & 0x00020000u) {
1888 GOOGLE_DCHECK(_impl_.screenshot_ != nullptr);
1889 _impl_.screenshot_->Clear();
1890 }
1891 }
1892 if (cached_has_bits & 0x000c0000u) {
1893 ::memset(&_impl_.track_uuid_, 0, static_cast<size_t>(
1894 reinterpret_cast<char*>(&_impl_.type_) -
1895 reinterpret_cast<char*>(&_impl_.track_uuid_)) + sizeof(_impl_.type_));
1896 }
1897 clear_name_field();
1898 clear_counter_value_field();
1899 clear_source_location_field();
1900 clear_timestamp();
1901 clear_thread_time();
1902 clear_thread_instruction_count();
1903 _impl_._has_bits_.Clear();
1904 _internal_metadata_.Clear<std::string>();
1905 }
1906
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)1907 const char* TrackEvent::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
1908 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
1909 _Internal::HasBits has_bits{};
1910 while (!ctx->Done(&ptr)) {
1911 ::uint32_t tag;
1912 ptr = ::_pbi::ReadTag(ptr, &tag);
1913 switch (tag >> 3) {
1914 // int64 timestamp_delta_us = 1;
1915 case 1:
1916 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
1917 _internal_set_timestamp_delta_us(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
1918 CHK_(ptr);
1919 } else {
1920 goto handle_unusual;
1921 }
1922 continue;
1923 // int64 thread_time_delta_us = 2;
1924 case 2:
1925 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
1926 _internal_set_thread_time_delta_us(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
1927 CHK_(ptr);
1928 } else {
1929 goto handle_unusual;
1930 }
1931 continue;
1932 // repeated uint64 category_iids = 3;
1933 case 3:
1934 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 24)) {
1935 ptr -= 1;
1936 do {
1937 ptr += 1;
1938 _internal_add_category_iids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
1939 CHK_(ptr);
1940 if (!ctx->DataAvailable(ptr)) break;
1941 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<24>(ptr));
1942 } else if (static_cast<::uint8_t>(tag) == 26) {
1943 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_category_iids(), ptr, ctx);
1944 CHK_(ptr);
1945 } else {
1946 goto handle_unusual;
1947 }
1948 continue;
1949 // repeated .perfetto.protos.DebugAnnotation debug_annotations = 4;
1950 case 4:
1951 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 34)) {
1952 ptr -= 1;
1953 do {
1954 ptr += 1;
1955 ptr = ctx->ParseMessage(_internal_add_debug_annotations(), ptr);
1956 CHK_(ptr);
1957 if (!ctx->DataAvailable(ptr)) break;
1958 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<34>(ptr));
1959 } else {
1960 goto handle_unusual;
1961 }
1962 continue;
1963 // optional .perfetto.protos.TaskExecution task_execution = 5;
1964 case 5:
1965 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 42)) {
1966 ptr = ctx->ParseMessage(_internal_mutable_task_execution(), ptr);
1967 CHK_(ptr);
1968 } else {
1969 goto handle_unusual;
1970 }
1971 continue;
1972 // optional .perfetto.protos.TrackEvent.LegacyEvent legacy_event = 6;
1973 case 6:
1974 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
1975 ptr = ctx->ParseMessage(_internal_mutable_legacy_event(), ptr);
1976 CHK_(ptr);
1977 } else {
1978 goto handle_unusual;
1979 }
1980 continue;
1981 // int64 thread_instruction_count_delta = 8;
1982 case 8:
1983 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 64)) {
1984 _internal_set_thread_instruction_count_delta(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
1985 CHK_(ptr);
1986 } else {
1987 goto handle_unusual;
1988 }
1989 continue;
1990 // optional .perfetto.protos.TrackEvent.Type type = 9;
1991 case 9:
1992 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 72)) {
1993 ::uint64_t val = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
1994 CHK_(ptr);
1995 if (PROTOBUF_PREDICT_TRUE(::perfetto::protos::TrackEvent_Type_IsValid(val))) {
1996 _internal_set_type(static_cast<::perfetto::protos::TrackEvent_Type>(val));
1997 } else {
1998 ::PROTOBUF_NAMESPACE_ID::internal::WriteVarint(9, val, mutable_unknown_fields());
1999 }
2000 } else {
2001 goto handle_unusual;
2002 }
2003 continue;
2004 // uint64 name_iid = 10;
2005 case 10:
2006 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
2007 _internal_set_name_iid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
2008 CHK_(ptr);
2009 } else {
2010 goto handle_unusual;
2011 }
2012 continue;
2013 // optional uint64 track_uuid = 11;
2014 case 11:
2015 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
2016 _Internal::set_has_track_uuid(&has_bits);
2017 _impl_.track_uuid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
2018 CHK_(ptr);
2019 } else {
2020 goto handle_unusual;
2021 }
2022 continue;
2023 // repeated int64 extra_counter_values = 12;
2024 case 12:
2025 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 96)) {
2026 ptr -= 1;
2027 do {
2028 ptr += 1;
2029 _internal_add_extra_counter_values(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
2030 CHK_(ptr);
2031 if (!ctx->DataAvailable(ptr)) break;
2032 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<96>(ptr));
2033 } else if (static_cast<::uint8_t>(tag) == 98) {
2034 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedInt64Parser(_internal_mutable_extra_counter_values(), ptr, ctx);
2035 CHK_(ptr);
2036 } else {
2037 goto handle_unusual;
2038 }
2039 continue;
2040 // int64 timestamp_absolute_us = 16;
2041 case 16:
2042 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 128)) {
2043 _internal_set_timestamp_absolute_us(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
2044 CHK_(ptr);
2045 } else {
2046 goto handle_unusual;
2047 }
2048 continue;
2049 // int64 thread_time_absolute_us = 17;
2050 case 17:
2051 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 136)) {
2052 _internal_set_thread_time_absolute_us(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
2053 CHK_(ptr);
2054 } else {
2055 goto handle_unusual;
2056 }
2057 continue;
2058 // int64 thread_instruction_count_absolute = 20;
2059 case 20:
2060 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 160)) {
2061 _internal_set_thread_instruction_count_absolute(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
2062 CHK_(ptr);
2063 } else {
2064 goto handle_unusual;
2065 }
2066 continue;
2067 // optional .perfetto.protos.LogMessage log_message = 21;
2068 case 21:
2069 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 170)) {
2070 ptr = ctx->ParseMessage(_internal_mutable_log_message(), ptr);
2071 CHK_(ptr);
2072 } else {
2073 goto handle_unusual;
2074 }
2075 continue;
2076 // repeated string categories = 22;
2077 case 22:
2078 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 178)) {
2079 ptr -= 2;
2080 do {
2081 ptr += 2;
2082 auto str = _internal_add_categories();
2083 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
2084 CHK_(ptr);
2085 if (!ctx->DataAvailable(ptr)) break;
2086 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<178>(ptr));
2087 } else {
2088 goto handle_unusual;
2089 }
2090 continue;
2091 // string name = 23;
2092 case 23:
2093 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 186)) {
2094 auto str = _internal_mutable_name();
2095 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
2096 CHK_(ptr);
2097 } else {
2098 goto handle_unusual;
2099 }
2100 continue;
2101 // optional .perfetto.protos.ChromeCompositorSchedulerState cc_scheduler_state = 24;
2102 case 24:
2103 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 194)) {
2104 ptr = ctx->ParseMessage(_internal_mutable_cc_scheduler_state(), ptr);
2105 CHK_(ptr);
2106 } else {
2107 goto handle_unusual;
2108 }
2109 continue;
2110 // optional .perfetto.protos.ChromeUserEvent chrome_user_event = 25;
2111 case 25:
2112 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 202)) {
2113 ptr = ctx->ParseMessage(_internal_mutable_chrome_user_event(), ptr);
2114 CHK_(ptr);
2115 } else {
2116 goto handle_unusual;
2117 }
2118 continue;
2119 // optional .perfetto.protos.ChromeKeyedService chrome_keyed_service = 26;
2120 case 26:
2121 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 210)) {
2122 ptr = ctx->ParseMessage(_internal_mutable_chrome_keyed_service(), ptr);
2123 CHK_(ptr);
2124 } else {
2125 goto handle_unusual;
2126 }
2127 continue;
2128 // optional .perfetto.protos.ChromeLegacyIpc chrome_legacy_ipc = 27;
2129 case 27:
2130 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 218)) {
2131 ptr = ctx->ParseMessage(_internal_mutable_chrome_legacy_ipc(), ptr);
2132 CHK_(ptr);
2133 } else {
2134 goto handle_unusual;
2135 }
2136 continue;
2137 // optional .perfetto.protos.ChromeHistogramSample chrome_histogram_sample = 28;
2138 case 28:
2139 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 226)) {
2140 ptr = ctx->ParseMessage(_internal_mutable_chrome_histogram_sample(), ptr);
2141 CHK_(ptr);
2142 } else {
2143 goto handle_unusual;
2144 }
2145 continue;
2146 // optional .perfetto.protos.ChromeLatencyInfo chrome_latency_info = 29;
2147 case 29:
2148 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 234)) {
2149 ptr = ctx->ParseMessage(_internal_mutable_chrome_latency_info(), ptr);
2150 CHK_(ptr);
2151 } else {
2152 goto handle_unusual;
2153 }
2154 continue;
2155 // int64 counter_value = 30;
2156 case 30:
2157 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 240)) {
2158 _internal_set_counter_value(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
2159 CHK_(ptr);
2160 } else {
2161 goto handle_unusual;
2162 }
2163 continue;
2164 // repeated uint64 extra_counter_track_uuids = 31;
2165 case 31:
2166 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 248)) {
2167 ptr -= 2;
2168 do {
2169 ptr += 2;
2170 _internal_add_extra_counter_track_uuids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
2171 CHK_(ptr);
2172 if (!ctx->DataAvailable(ptr)) break;
2173 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<248>(ptr));
2174 } else if (static_cast<::uint8_t>(tag) == 250) {
2175 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_extra_counter_track_uuids(), ptr, ctx);
2176 CHK_(ptr);
2177 } else {
2178 goto handle_unusual;
2179 }
2180 continue;
2181 // optional .perfetto.protos.ChromeFrameReporter chrome_frame_reporter = 32;
2182 case 32:
2183 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 2)) {
2184 ptr = ctx->ParseMessage(_internal_mutable_chrome_frame_reporter(), ptr);
2185 CHK_(ptr);
2186 } else {
2187 goto handle_unusual;
2188 }
2189 continue;
2190 // .perfetto.protos.SourceLocation source_location = 33;
2191 case 33:
2192 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 10)) {
2193 ptr = ctx->ParseMessage(_internal_mutable_source_location(), ptr);
2194 CHK_(ptr);
2195 } else {
2196 goto handle_unusual;
2197 }
2198 continue;
2199 // uint64 source_location_iid = 34;
2200 case 34:
2201 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 16)) {
2202 _internal_set_source_location_iid(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
2203 CHK_(ptr);
2204 } else {
2205 goto handle_unusual;
2206 }
2207 continue;
2208 // optional .perfetto.protos.ChromeMessagePump chrome_message_pump = 35;
2209 case 35:
2210 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 26)) {
2211 ptr = ctx->ParseMessage(_internal_mutable_chrome_message_pump(), ptr);
2212 CHK_(ptr);
2213 } else {
2214 goto handle_unusual;
2215 }
2216 continue;
2217 // repeated uint64 flow_ids_old = 36 [deprecated = true];
2218 case 36:
2219 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 32)) {
2220 ptr -= 2;
2221 do {
2222 ptr += 2;
2223 _internal_add_flow_ids_old(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
2224 CHK_(ptr);
2225 if (!ctx->DataAvailable(ptr)) break;
2226 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<288>(ptr));
2227 } else if (static_cast<::uint8_t>(tag) == 34) {
2228 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_flow_ids_old(), ptr, ctx);
2229 CHK_(ptr);
2230 } else {
2231 goto handle_unusual;
2232 }
2233 continue;
2234 // optional .perfetto.protos.ChromeMojoEventInfo chrome_mojo_event_info = 38;
2235 case 38:
2236 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 50)) {
2237 ptr = ctx->ParseMessage(_internal_mutable_chrome_mojo_event_info(), ptr);
2238 CHK_(ptr);
2239 } else {
2240 goto handle_unusual;
2241 }
2242 continue;
2243 // optional .perfetto.protos.ChromeApplicationStateInfo chrome_application_state_info = 39;
2244 case 39:
2245 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 58)) {
2246 ptr = ctx->ParseMessage(_internal_mutable_chrome_application_state_info(), ptr);
2247 CHK_(ptr);
2248 } else {
2249 goto handle_unusual;
2250 }
2251 continue;
2252 // optional .perfetto.protos.ChromeRendererSchedulerState chrome_renderer_scheduler_state = 40;
2253 case 40:
2254 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 66)) {
2255 ptr = ctx->ParseMessage(_internal_mutable_chrome_renderer_scheduler_state(), ptr);
2256 CHK_(ptr);
2257 } else {
2258 goto handle_unusual;
2259 }
2260 continue;
2261 // optional .perfetto.protos.ChromeWindowHandleEventInfo chrome_window_handle_event_info = 41;
2262 case 41:
2263 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 74)) {
2264 ptr = ctx->ParseMessage(_internal_mutable_chrome_window_handle_event_info(), ptr);
2265 CHK_(ptr);
2266 } else {
2267 goto handle_unusual;
2268 }
2269 continue;
2270 // repeated uint64 terminating_flow_ids_old = 42 [deprecated = true];
2271 case 42:
2272 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 80)) {
2273 ptr -= 2;
2274 do {
2275 ptr += 2;
2276 _internal_add_terminating_flow_ids_old(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
2277 CHK_(ptr);
2278 if (!ctx->DataAvailable(ptr)) break;
2279 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<336>(ptr));
2280 } else if (static_cast<::uint8_t>(tag) == 82) {
2281 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_terminating_flow_ids_old(), ptr, ctx);
2282 CHK_(ptr);
2283 } else {
2284 goto handle_unusual;
2285 }
2286 continue;
2287 // optional .perfetto.protos.ChromeContentSettingsEventInfo chrome_content_settings_event_info = 43;
2288 case 43:
2289 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 90)) {
2290 ptr = ctx->ParseMessage(_internal_mutable_chrome_content_settings_event_info(), ptr);
2291 CHK_(ptr);
2292 } else {
2293 goto handle_unusual;
2294 }
2295 continue;
2296 // double double_counter_value = 44;
2297 case 44:
2298 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 97)) {
2299 _internal_set_double_counter_value(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
2300 ptr += sizeof(double);
2301 } else {
2302 goto handle_unusual;
2303 }
2304 continue;
2305 // repeated uint64 extra_double_counter_track_uuids = 45;
2306 case 45:
2307 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 104)) {
2308 ptr -= 2;
2309 do {
2310 ptr += 2;
2311 _internal_add_extra_double_counter_track_uuids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
2312 CHK_(ptr);
2313 if (!ctx->DataAvailable(ptr)) break;
2314 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<360>(ptr));
2315 } else if (static_cast<::uint8_t>(tag) == 106) {
2316 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_extra_double_counter_track_uuids(), ptr, ctx);
2317 CHK_(ptr);
2318 } else {
2319 goto handle_unusual;
2320 }
2321 continue;
2322 // repeated double extra_double_counter_values = 46;
2323 case 46:
2324 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 113)) {
2325 ptr -= 2;
2326 do {
2327 ptr += 2;
2328 _internal_add_extra_double_counter_values(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<double>(ptr));
2329 ptr += sizeof(double);
2330 if (!ctx->DataAvailable(ptr)) break;
2331 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<369>(ptr));
2332 } else if (static_cast<::uint8_t>(tag) == 114) {
2333 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedDoubleParser(_internal_mutable_extra_double_counter_values(), ptr, ctx);
2334 CHK_(ptr);
2335 } else {
2336 goto handle_unusual;
2337 }
2338 continue;
2339 // repeated fixed64 flow_ids = 47;
2340 case 47:
2341 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 121)) {
2342 ptr -= 2;
2343 do {
2344 ptr += 2;
2345 _internal_add_flow_ids(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::uint64_t>(ptr));
2346 ptr += sizeof(::uint64_t);
2347 if (!ctx->DataAvailable(ptr)) break;
2348 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<377>(ptr));
2349 } else if (static_cast<::uint8_t>(tag) == 122) {
2350 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFixed64Parser(_internal_mutable_flow_ids(), ptr, ctx);
2351 CHK_(ptr);
2352 } else {
2353 goto handle_unusual;
2354 }
2355 continue;
2356 // repeated fixed64 terminating_flow_ids = 48;
2357 case 48:
2358 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 129)) {
2359 ptr -= 2;
2360 do {
2361 ptr += 2;
2362 _internal_add_terminating_flow_ids(::PROTOBUF_NAMESPACE_ID::internal::UnalignedLoad<::uint64_t>(ptr));
2363 ptr += sizeof(::uint64_t);
2364 if (!ctx->DataAvailable(ptr)) break;
2365 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<385>(ptr));
2366 } else if (static_cast<::uint8_t>(tag) == 130) {
2367 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedFixed64Parser(_internal_mutable_terminating_flow_ids(), ptr, ctx);
2368 CHK_(ptr);
2369 } else {
2370 goto handle_unusual;
2371 }
2372 continue;
2373 // optional .perfetto.protos.ChromeActiveProcesses chrome_active_processes = 49;
2374 case 49:
2375 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 138)) {
2376 ptr = ctx->ParseMessage(_internal_mutable_chrome_active_processes(), ptr);
2377 CHK_(ptr);
2378 } else {
2379 goto handle_unusual;
2380 }
2381 continue;
2382 // optional .perfetto.protos.Screenshot screenshot = 50;
2383 case 50:
2384 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 146)) {
2385 ptr = ctx->ParseMessage(_internal_mutable_screenshot(), ptr);
2386 CHK_(ptr);
2387 } else {
2388 goto handle_unusual;
2389 }
2390 continue;
2391 default:
2392 goto handle_unusual;
2393 } // switch
2394 handle_unusual:
2395 if ((tag == 0) || ((tag & 7) == 4)) {
2396 CHK_(ptr);
2397 ctx->SetLastTag(tag);
2398 goto message_done;
2399 }
2400 if ((8000u <= tag && tag < 16000u) ||
2401 (16000u <= tag && tag < 16008u) ||
2402 (16008u <= tag && tag < 24000u) ||
2403 (24000u <= tag && tag < 79200u) ||
2404 (79200u <= tag && tag < 80008u)) {
2405 ptr = _impl_._extensions_.ParseField(tag, ptr, internal_default_instance(), &_internal_metadata_, ctx);
2406 CHK_(ptr != nullptr);
2407 continue;
2408 }
2409 ptr = UnknownFieldParse(
2410 tag,
2411 _internal_metadata_.mutable_unknown_fields<std::string>(),
2412 ptr, ctx);
2413 CHK_(ptr != nullptr);
2414 } // while
2415 message_done:
2416 _impl_._has_bits_.Or(has_bits);
2417 return ptr;
2418 failure:
2419 ptr = nullptr;
2420 goto message_done;
2421 #undef CHK_
2422 }
2423
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const2424 ::uint8_t* TrackEvent::_InternalSerialize(
2425 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
2426 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TrackEvent)
2427 ::uint32_t cached_has_bits = 0;
2428 (void) cached_has_bits;
2429
2430 // int64 timestamp_delta_us = 1;
2431 if (_internal_has_timestamp_delta_us()) {
2432 target = stream->EnsureSpace(target);
2433 target = ::_pbi::WireFormatLite::WriteInt64ToArray(1, this->_internal_timestamp_delta_us(), target);
2434 }
2435
2436 // int64 thread_time_delta_us = 2;
2437 if (_internal_has_thread_time_delta_us()) {
2438 target = stream->EnsureSpace(target);
2439 target = ::_pbi::WireFormatLite::WriteInt64ToArray(2, this->_internal_thread_time_delta_us(), target);
2440 }
2441
2442 // repeated uint64 category_iids = 3;
2443 for (int i = 0, n = this->_internal_category_iids_size(); i < n; i++) {
2444 target = stream->EnsureSpace(target);
2445 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(3, this->_internal_category_iids(i), target);
2446 }
2447
2448 // repeated .perfetto.protos.DebugAnnotation debug_annotations = 4;
2449 for (unsigned i = 0,
2450 n = static_cast<unsigned>(this->_internal_debug_annotations_size()); i < n; i++) {
2451 const auto& repfield = this->_internal_debug_annotations(i);
2452 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2453 InternalWriteMessage(4, repfield, repfield.GetCachedSize(), target, stream);
2454 }
2455
2456 cached_has_bits = _impl_._has_bits_[0];
2457 // optional .perfetto.protos.TaskExecution task_execution = 5;
2458 if (cached_has_bits & 0x00000001u) {
2459 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2460 InternalWriteMessage(5, _Internal::task_execution(this),
2461 _Internal::task_execution(this).GetCachedSize(), target, stream);
2462 }
2463
2464 // optional .perfetto.protos.TrackEvent.LegacyEvent legacy_event = 6;
2465 if (cached_has_bits & 0x00000002u) {
2466 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2467 InternalWriteMessage(6, _Internal::legacy_event(this),
2468 _Internal::legacy_event(this).GetCachedSize(), target, stream);
2469 }
2470
2471 // int64 thread_instruction_count_delta = 8;
2472 if (_internal_has_thread_instruction_count_delta()) {
2473 target = stream->EnsureSpace(target);
2474 target = ::_pbi::WireFormatLite::WriteInt64ToArray(8, this->_internal_thread_instruction_count_delta(), target);
2475 }
2476
2477 // optional .perfetto.protos.TrackEvent.Type type = 9;
2478 if (cached_has_bits & 0x00080000u) {
2479 target = stream->EnsureSpace(target);
2480 target = ::_pbi::WireFormatLite::WriteEnumToArray(
2481 9, this->_internal_type(), target);
2482 }
2483
2484 // uint64 name_iid = 10;
2485 if (_internal_has_name_iid()) {
2486 target = stream->EnsureSpace(target);
2487 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(10, this->_internal_name_iid(), target);
2488 }
2489
2490 // optional uint64 track_uuid = 11;
2491 if (cached_has_bits & 0x00040000u) {
2492 target = stream->EnsureSpace(target);
2493 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(11, this->_internal_track_uuid(), target);
2494 }
2495
2496 // repeated int64 extra_counter_values = 12;
2497 for (int i = 0, n = this->_internal_extra_counter_values_size(); i < n; i++) {
2498 target = stream->EnsureSpace(target);
2499 target = ::_pbi::WireFormatLite::WriteInt64ToArray(12, this->_internal_extra_counter_values(i), target);
2500 }
2501
2502 // int64 timestamp_absolute_us = 16;
2503 if (_internal_has_timestamp_absolute_us()) {
2504 target = stream->EnsureSpace(target);
2505 target = ::_pbi::WireFormatLite::WriteInt64ToArray(16, this->_internal_timestamp_absolute_us(), target);
2506 }
2507
2508 // int64 thread_time_absolute_us = 17;
2509 if (_internal_has_thread_time_absolute_us()) {
2510 target = stream->EnsureSpace(target);
2511 target = ::_pbi::WireFormatLite::WriteInt64ToArray(17, this->_internal_thread_time_absolute_us(), target);
2512 }
2513
2514 // int64 thread_instruction_count_absolute = 20;
2515 if (_internal_has_thread_instruction_count_absolute()) {
2516 target = stream->EnsureSpace(target);
2517 target = ::_pbi::WireFormatLite::WriteInt64ToArray(20, this->_internal_thread_instruction_count_absolute(), target);
2518 }
2519
2520 // optional .perfetto.protos.LogMessage log_message = 21;
2521 if (cached_has_bits & 0x00000004u) {
2522 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2523 InternalWriteMessage(21, _Internal::log_message(this),
2524 _Internal::log_message(this).GetCachedSize(), target, stream);
2525 }
2526
2527 // repeated string categories = 22;
2528 for (int i = 0, n = this->_internal_categories_size(); i < n; i++) {
2529 const auto& s = this->_internal_categories(i);
2530 target = stream->WriteString(22, s, target);
2531 }
2532
2533 // string name = 23;
2534 if (_internal_has_name()) {
2535 target = stream->WriteStringMaybeAliased(
2536 23, this->_internal_name(), target);
2537 }
2538
2539 // optional .perfetto.protos.ChromeCompositorSchedulerState cc_scheduler_state = 24;
2540 if (cached_has_bits & 0x00000008u) {
2541 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2542 InternalWriteMessage(24, _Internal::cc_scheduler_state(this),
2543 _Internal::cc_scheduler_state(this).GetCachedSize(), target, stream);
2544 }
2545
2546 // optional .perfetto.protos.ChromeUserEvent chrome_user_event = 25;
2547 if (cached_has_bits & 0x00000010u) {
2548 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2549 InternalWriteMessage(25, _Internal::chrome_user_event(this),
2550 _Internal::chrome_user_event(this).GetCachedSize(), target, stream);
2551 }
2552
2553 // optional .perfetto.protos.ChromeKeyedService chrome_keyed_service = 26;
2554 if (cached_has_bits & 0x00000020u) {
2555 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2556 InternalWriteMessage(26, _Internal::chrome_keyed_service(this),
2557 _Internal::chrome_keyed_service(this).GetCachedSize(), target, stream);
2558 }
2559
2560 // optional .perfetto.protos.ChromeLegacyIpc chrome_legacy_ipc = 27;
2561 if (cached_has_bits & 0x00000040u) {
2562 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2563 InternalWriteMessage(27, _Internal::chrome_legacy_ipc(this),
2564 _Internal::chrome_legacy_ipc(this).GetCachedSize(), target, stream);
2565 }
2566
2567 // optional .perfetto.protos.ChromeHistogramSample chrome_histogram_sample = 28;
2568 if (cached_has_bits & 0x00000080u) {
2569 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2570 InternalWriteMessage(28, _Internal::chrome_histogram_sample(this),
2571 _Internal::chrome_histogram_sample(this).GetCachedSize(), target, stream);
2572 }
2573
2574 // optional .perfetto.protos.ChromeLatencyInfo chrome_latency_info = 29;
2575 if (cached_has_bits & 0x00000100u) {
2576 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2577 InternalWriteMessage(29, _Internal::chrome_latency_info(this),
2578 _Internal::chrome_latency_info(this).GetCachedSize(), target, stream);
2579 }
2580
2581 // int64 counter_value = 30;
2582 if (_internal_has_counter_value()) {
2583 target = stream->EnsureSpace(target);
2584 target = ::_pbi::WireFormatLite::WriteInt64ToArray(30, this->_internal_counter_value(), target);
2585 }
2586
2587 // repeated uint64 extra_counter_track_uuids = 31;
2588 for (int i = 0, n = this->_internal_extra_counter_track_uuids_size(); i < n; i++) {
2589 target = stream->EnsureSpace(target);
2590 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(31, this->_internal_extra_counter_track_uuids(i), target);
2591 }
2592
2593 // optional .perfetto.protos.ChromeFrameReporter chrome_frame_reporter = 32;
2594 if (cached_has_bits & 0x00000200u) {
2595 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2596 InternalWriteMessage(32, _Internal::chrome_frame_reporter(this),
2597 _Internal::chrome_frame_reporter(this).GetCachedSize(), target, stream);
2598 }
2599
2600 switch (source_location_field_case()) {
2601 case kSourceLocation: {
2602 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2603 InternalWriteMessage(33, _Internal::source_location(this),
2604 _Internal::source_location(this).GetCachedSize(), target, stream);
2605 break;
2606 }
2607 case kSourceLocationIid: {
2608 target = stream->EnsureSpace(target);
2609 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(34, this->_internal_source_location_iid(), target);
2610 break;
2611 }
2612 default: ;
2613 }
2614 // optional .perfetto.protos.ChromeMessagePump chrome_message_pump = 35;
2615 if (cached_has_bits & 0x00000400u) {
2616 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2617 InternalWriteMessage(35, _Internal::chrome_message_pump(this),
2618 _Internal::chrome_message_pump(this).GetCachedSize(), target, stream);
2619 }
2620
2621 // repeated uint64 flow_ids_old = 36 [deprecated = true];
2622 for (int i = 0, n = this->_internal_flow_ids_old_size(); i < n; i++) {
2623 target = stream->EnsureSpace(target);
2624 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(36, this->_internal_flow_ids_old(i), target);
2625 }
2626
2627 // optional .perfetto.protos.ChromeMojoEventInfo chrome_mojo_event_info = 38;
2628 if (cached_has_bits & 0x00000800u) {
2629 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2630 InternalWriteMessage(38, _Internal::chrome_mojo_event_info(this),
2631 _Internal::chrome_mojo_event_info(this).GetCachedSize(), target, stream);
2632 }
2633
2634 // optional .perfetto.protos.ChromeApplicationStateInfo chrome_application_state_info = 39;
2635 if (cached_has_bits & 0x00001000u) {
2636 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2637 InternalWriteMessage(39, _Internal::chrome_application_state_info(this),
2638 _Internal::chrome_application_state_info(this).GetCachedSize(), target, stream);
2639 }
2640
2641 // optional .perfetto.protos.ChromeRendererSchedulerState chrome_renderer_scheduler_state = 40;
2642 if (cached_has_bits & 0x00002000u) {
2643 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2644 InternalWriteMessage(40, _Internal::chrome_renderer_scheduler_state(this),
2645 _Internal::chrome_renderer_scheduler_state(this).GetCachedSize(), target, stream);
2646 }
2647
2648 // optional .perfetto.protos.ChromeWindowHandleEventInfo chrome_window_handle_event_info = 41;
2649 if (cached_has_bits & 0x00004000u) {
2650 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2651 InternalWriteMessage(41, _Internal::chrome_window_handle_event_info(this),
2652 _Internal::chrome_window_handle_event_info(this).GetCachedSize(), target, stream);
2653 }
2654
2655 // repeated uint64 terminating_flow_ids_old = 42 [deprecated = true];
2656 for (int i = 0, n = this->_internal_terminating_flow_ids_old_size(); i < n; i++) {
2657 target = stream->EnsureSpace(target);
2658 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(42, this->_internal_terminating_flow_ids_old(i), target);
2659 }
2660
2661 // optional .perfetto.protos.ChromeContentSettingsEventInfo chrome_content_settings_event_info = 43;
2662 if (cached_has_bits & 0x00008000u) {
2663 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2664 InternalWriteMessage(43, _Internal::chrome_content_settings_event_info(this),
2665 _Internal::chrome_content_settings_event_info(this).GetCachedSize(), target, stream);
2666 }
2667
2668 // double double_counter_value = 44;
2669 if (_internal_has_double_counter_value()) {
2670 target = stream->EnsureSpace(target);
2671 target = ::_pbi::WireFormatLite::WriteDoubleToArray(44, this->_internal_double_counter_value(), target);
2672 }
2673
2674 // repeated uint64 extra_double_counter_track_uuids = 45;
2675 for (int i = 0, n = this->_internal_extra_double_counter_track_uuids_size(); i < n; i++) {
2676 target = stream->EnsureSpace(target);
2677 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(45, this->_internal_extra_double_counter_track_uuids(i), target);
2678 }
2679
2680 // repeated double extra_double_counter_values = 46;
2681 for (int i = 0, n = this->_internal_extra_double_counter_values_size(); i < n; i++) {
2682 target = stream->EnsureSpace(target);
2683 target = ::_pbi::WireFormatLite::WriteDoubleToArray(46, this->_internal_extra_double_counter_values(i), target);
2684 }
2685
2686 // repeated fixed64 flow_ids = 47;
2687 for (int i = 0, n = this->_internal_flow_ids_size(); i < n; i++) {
2688 target = stream->EnsureSpace(target);
2689 target = ::_pbi::WireFormatLite::WriteFixed64ToArray(47, this->_internal_flow_ids(i), target);
2690 }
2691
2692 // repeated fixed64 terminating_flow_ids = 48;
2693 for (int i = 0, n = this->_internal_terminating_flow_ids_size(); i < n; i++) {
2694 target = stream->EnsureSpace(target);
2695 target = ::_pbi::WireFormatLite::WriteFixed64ToArray(48, this->_internal_terminating_flow_ids(i), target);
2696 }
2697
2698 // optional .perfetto.protos.ChromeActiveProcesses chrome_active_processes = 49;
2699 if (cached_has_bits & 0x00010000u) {
2700 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2701 InternalWriteMessage(49, _Internal::chrome_active_processes(this),
2702 _Internal::chrome_active_processes(this).GetCachedSize(), target, stream);
2703 }
2704
2705 // optional .perfetto.protos.Screenshot screenshot = 50;
2706 if (cached_has_bits & 0x00020000u) {
2707 target = ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::
2708 InternalWriteMessage(50, _Internal::screenshot(this),
2709 _Internal::screenshot(this).GetCachedSize(), target, stream);
2710 }
2711
2712 // Extension range [1000, 10001)
2713 target = _impl_._extensions_._InternalSerialize(
2714 internal_default_instance(), 1000, 10001, target, stream);
2715
2716 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
2717 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
2718 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
2719 }
2720 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TrackEvent)
2721 return target;
2722 }
2723
ByteSizeLong() const2724 size_t TrackEvent::ByteSizeLong() const {
2725 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TrackEvent)
2726 size_t total_size = 0;
2727
2728 total_size += _impl_._extensions_.ByteSize();
2729
2730 ::uint32_t cached_has_bits = 0;
2731 // Prevent compiler warnings about cached_has_bits being unused
2732 (void) cached_has_bits;
2733
2734 // repeated uint64 category_iids = 3;
2735 {
2736 size_t data_size = ::_pbi::WireFormatLite::
2737 UInt64Size(this->_impl_.category_iids_);
2738 total_size += 1 *
2739 ::_pbi::FromIntSize(this->_internal_category_iids_size());
2740 total_size += data_size;
2741 }
2742
2743 // repeated .perfetto.protos.DebugAnnotation debug_annotations = 4;
2744 total_size += 1UL * this->_internal_debug_annotations_size();
2745 for (const auto& msg : this->_impl_.debug_annotations_) {
2746 total_size +=
2747 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(msg);
2748 }
2749
2750 // repeated int64 extra_counter_values = 12;
2751 {
2752 size_t data_size = ::_pbi::WireFormatLite::
2753 Int64Size(this->_impl_.extra_counter_values_);
2754 total_size += 1 *
2755 ::_pbi::FromIntSize(this->_internal_extra_counter_values_size());
2756 total_size += data_size;
2757 }
2758
2759 // repeated string categories = 22;
2760 total_size += 2 *
2761 ::PROTOBUF_NAMESPACE_ID::internal::FromIntSize(_impl_.categories_.size());
2762 for (int i = 0, n = _impl_.categories_.size(); i < n; i++) {
2763 total_size += ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2764 _impl_.categories_.Get(i));
2765 }
2766
2767 // repeated uint64 extra_counter_track_uuids = 31;
2768 {
2769 size_t data_size = ::_pbi::WireFormatLite::
2770 UInt64Size(this->_impl_.extra_counter_track_uuids_);
2771 total_size += 2 *
2772 ::_pbi::FromIntSize(this->_internal_extra_counter_track_uuids_size());
2773 total_size += data_size;
2774 }
2775
2776 // repeated uint64 flow_ids_old = 36 [deprecated = true];
2777 {
2778 size_t data_size = ::_pbi::WireFormatLite::
2779 UInt64Size(this->_impl_.flow_ids_old_);
2780 total_size += 2 *
2781 ::_pbi::FromIntSize(this->_internal_flow_ids_old_size());
2782 total_size += data_size;
2783 }
2784
2785 // repeated uint64 terminating_flow_ids_old = 42 [deprecated = true];
2786 {
2787 size_t data_size = ::_pbi::WireFormatLite::
2788 UInt64Size(this->_impl_.terminating_flow_ids_old_);
2789 total_size += 2 *
2790 ::_pbi::FromIntSize(this->_internal_terminating_flow_ids_old_size());
2791 total_size += data_size;
2792 }
2793
2794 // repeated uint64 extra_double_counter_track_uuids = 45;
2795 {
2796 size_t data_size = ::_pbi::WireFormatLite::
2797 UInt64Size(this->_impl_.extra_double_counter_track_uuids_);
2798 total_size += 2 *
2799 ::_pbi::FromIntSize(this->_internal_extra_double_counter_track_uuids_size());
2800 total_size += data_size;
2801 }
2802
2803 // repeated double extra_double_counter_values = 46;
2804 {
2805 unsigned int count = static_cast<unsigned int>(this->_internal_extra_double_counter_values_size());
2806 size_t data_size = 8UL * count;
2807 total_size += 2 *
2808 ::_pbi::FromIntSize(this->_internal_extra_double_counter_values_size());
2809 total_size += data_size;
2810 }
2811
2812 // repeated fixed64 flow_ids = 47;
2813 {
2814 unsigned int count = static_cast<unsigned int>(this->_internal_flow_ids_size());
2815 size_t data_size = 8UL * count;
2816 total_size += 2 *
2817 ::_pbi::FromIntSize(this->_internal_flow_ids_size());
2818 total_size += data_size;
2819 }
2820
2821 // repeated fixed64 terminating_flow_ids = 48;
2822 {
2823 unsigned int count = static_cast<unsigned int>(this->_internal_terminating_flow_ids_size());
2824 size_t data_size = 8UL * count;
2825 total_size += 2 *
2826 ::_pbi::FromIntSize(this->_internal_terminating_flow_ids_size());
2827 total_size += data_size;
2828 }
2829
2830 cached_has_bits = _impl_._has_bits_[0];
2831 if (cached_has_bits & 0x000000ffu) {
2832 // optional .perfetto.protos.TaskExecution task_execution = 5;
2833 if (cached_has_bits & 0x00000001u) {
2834 total_size += 1 +
2835 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2836 *_impl_.task_execution_);
2837 }
2838
2839 // optional .perfetto.protos.TrackEvent.LegacyEvent legacy_event = 6;
2840 if (cached_has_bits & 0x00000002u) {
2841 total_size += 1 +
2842 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2843 *_impl_.legacy_event_);
2844 }
2845
2846 // optional .perfetto.protos.LogMessage log_message = 21;
2847 if (cached_has_bits & 0x00000004u) {
2848 total_size += 2 +
2849 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2850 *_impl_.log_message_);
2851 }
2852
2853 // optional .perfetto.protos.ChromeCompositorSchedulerState cc_scheduler_state = 24;
2854 if (cached_has_bits & 0x00000008u) {
2855 total_size += 2 +
2856 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2857 *_impl_.cc_scheduler_state_);
2858 }
2859
2860 // optional .perfetto.protos.ChromeUserEvent chrome_user_event = 25;
2861 if (cached_has_bits & 0x00000010u) {
2862 total_size += 2 +
2863 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2864 *_impl_.chrome_user_event_);
2865 }
2866
2867 // optional .perfetto.protos.ChromeKeyedService chrome_keyed_service = 26;
2868 if (cached_has_bits & 0x00000020u) {
2869 total_size += 2 +
2870 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2871 *_impl_.chrome_keyed_service_);
2872 }
2873
2874 // optional .perfetto.protos.ChromeLegacyIpc chrome_legacy_ipc = 27;
2875 if (cached_has_bits & 0x00000040u) {
2876 total_size += 2 +
2877 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2878 *_impl_.chrome_legacy_ipc_);
2879 }
2880
2881 // optional .perfetto.protos.ChromeHistogramSample chrome_histogram_sample = 28;
2882 if (cached_has_bits & 0x00000080u) {
2883 total_size += 2 +
2884 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2885 *_impl_.chrome_histogram_sample_);
2886 }
2887
2888 }
2889 if (cached_has_bits & 0x0000ff00u) {
2890 // optional .perfetto.protos.ChromeLatencyInfo chrome_latency_info = 29;
2891 if (cached_has_bits & 0x00000100u) {
2892 total_size += 2 +
2893 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2894 *_impl_.chrome_latency_info_);
2895 }
2896
2897 // optional .perfetto.protos.ChromeFrameReporter chrome_frame_reporter = 32;
2898 if (cached_has_bits & 0x00000200u) {
2899 total_size += 2 +
2900 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2901 *_impl_.chrome_frame_reporter_);
2902 }
2903
2904 // optional .perfetto.protos.ChromeMessagePump chrome_message_pump = 35;
2905 if (cached_has_bits & 0x00000400u) {
2906 total_size += 2 +
2907 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2908 *_impl_.chrome_message_pump_);
2909 }
2910
2911 // optional .perfetto.protos.ChromeMojoEventInfo chrome_mojo_event_info = 38;
2912 if (cached_has_bits & 0x00000800u) {
2913 total_size += 2 +
2914 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2915 *_impl_.chrome_mojo_event_info_);
2916 }
2917
2918 // optional .perfetto.protos.ChromeApplicationStateInfo chrome_application_state_info = 39;
2919 if (cached_has_bits & 0x00001000u) {
2920 total_size += 2 +
2921 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2922 *_impl_.chrome_application_state_info_);
2923 }
2924
2925 // optional .perfetto.protos.ChromeRendererSchedulerState chrome_renderer_scheduler_state = 40;
2926 if (cached_has_bits & 0x00002000u) {
2927 total_size += 2 +
2928 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2929 *_impl_.chrome_renderer_scheduler_state_);
2930 }
2931
2932 // optional .perfetto.protos.ChromeWindowHandleEventInfo chrome_window_handle_event_info = 41;
2933 if (cached_has_bits & 0x00004000u) {
2934 total_size += 2 +
2935 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2936 *_impl_.chrome_window_handle_event_info_);
2937 }
2938
2939 // optional .perfetto.protos.ChromeContentSettingsEventInfo chrome_content_settings_event_info = 43;
2940 if (cached_has_bits & 0x00008000u) {
2941 total_size += 2 +
2942 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2943 *_impl_.chrome_content_settings_event_info_);
2944 }
2945
2946 }
2947 if (cached_has_bits & 0x000f0000u) {
2948 // optional .perfetto.protos.ChromeActiveProcesses chrome_active_processes = 49;
2949 if (cached_has_bits & 0x00010000u) {
2950 total_size += 2 +
2951 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2952 *_impl_.chrome_active_processes_);
2953 }
2954
2955 // optional .perfetto.protos.Screenshot screenshot = 50;
2956 if (cached_has_bits & 0x00020000u) {
2957 total_size += 2 +
2958 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
2959 *_impl_.screenshot_);
2960 }
2961
2962 // optional uint64 track_uuid = 11;
2963 if (cached_has_bits & 0x00040000u) {
2964 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_track_uuid());
2965 }
2966
2967 // optional .perfetto.protos.TrackEvent.Type type = 9;
2968 if (cached_has_bits & 0x00080000u) {
2969 total_size += 1 +
2970 ::_pbi::WireFormatLite::EnumSize(this->_internal_type());
2971 }
2972
2973 }
2974 switch (name_field_case()) {
2975 // uint64 name_iid = 10;
2976 case kNameIid: {
2977 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_name_iid());
2978 break;
2979 }
2980 // string name = 23;
2981 case kName: {
2982 total_size += 2 +
2983 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
2984 this->_internal_name());
2985 break;
2986 }
2987 case NAME_FIELD_NOT_SET: {
2988 break;
2989 }
2990 }
2991 switch (counter_value_field_case()) {
2992 // int64 counter_value = 30;
2993 case kCounterValue: {
2994 total_size += 2 +
2995 ::_pbi::WireFormatLite::Int64Size(
2996 this->_internal_counter_value());
2997 break;
2998 }
2999 // double double_counter_value = 44;
3000 case kDoubleCounterValue: {
3001 total_size += 2 + 8;
3002 break;
3003 }
3004 case COUNTER_VALUE_FIELD_NOT_SET: {
3005 break;
3006 }
3007 }
3008 switch (source_location_field_case()) {
3009 // .perfetto.protos.SourceLocation source_location = 33;
3010 case kSourceLocation: {
3011 total_size += 2 +
3012 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::MessageSize(
3013 *_impl_.source_location_field_.source_location_);
3014 break;
3015 }
3016 // uint64 source_location_iid = 34;
3017 case kSourceLocationIid: {
3018 total_size += 2 +
3019 ::_pbi::WireFormatLite::UInt64Size(
3020 this->_internal_source_location_iid());
3021 break;
3022 }
3023 case SOURCE_LOCATION_FIELD_NOT_SET: {
3024 break;
3025 }
3026 }
3027 switch (timestamp_case()) {
3028 // int64 timestamp_delta_us = 1;
3029 case kTimestampDeltaUs: {
3030 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_timestamp_delta_us());
3031 break;
3032 }
3033 // int64 timestamp_absolute_us = 16;
3034 case kTimestampAbsoluteUs: {
3035 total_size += 2 +
3036 ::_pbi::WireFormatLite::Int64Size(
3037 this->_internal_timestamp_absolute_us());
3038 break;
3039 }
3040 case TIMESTAMP_NOT_SET: {
3041 break;
3042 }
3043 }
3044 switch (thread_time_case()) {
3045 // int64 thread_time_delta_us = 2;
3046 case kThreadTimeDeltaUs: {
3047 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_thread_time_delta_us());
3048 break;
3049 }
3050 // int64 thread_time_absolute_us = 17;
3051 case kThreadTimeAbsoluteUs: {
3052 total_size += 2 +
3053 ::_pbi::WireFormatLite::Int64Size(
3054 this->_internal_thread_time_absolute_us());
3055 break;
3056 }
3057 case THREAD_TIME_NOT_SET: {
3058 break;
3059 }
3060 }
3061 switch (thread_instruction_count_case()) {
3062 // int64 thread_instruction_count_delta = 8;
3063 case kThreadInstructionCountDelta: {
3064 total_size += ::_pbi::WireFormatLite::Int64SizePlusOne(this->_internal_thread_instruction_count_delta());
3065 break;
3066 }
3067 // int64 thread_instruction_count_absolute = 20;
3068 case kThreadInstructionCountAbsolute: {
3069 total_size += 2 +
3070 ::_pbi::WireFormatLite::Int64Size(
3071 this->_internal_thread_instruction_count_absolute());
3072 break;
3073 }
3074 case THREAD_INSTRUCTION_COUNT_NOT_SET: {
3075 break;
3076 }
3077 }
3078 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
3079 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
3080 }
3081 int cached_size = ::_pbi::ToCachedSize(total_size);
3082 SetCachedSize(cached_size);
3083 return total_size;
3084 }
3085
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)3086 void TrackEvent::CheckTypeAndMergeFrom(
3087 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
3088 MergeFrom(*::_pbi::DownCast<const TrackEvent*>(
3089 &from));
3090 }
3091
MergeFrom(const TrackEvent & from)3092 void TrackEvent::MergeFrom(const TrackEvent& from) {
3093 TrackEvent* const _this = this;
3094 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TrackEvent)
3095 GOOGLE_DCHECK_NE(&from, _this);
3096 ::uint32_t cached_has_bits = 0;
3097 (void) cached_has_bits;
3098
3099 _this->_impl_.category_iids_.MergeFrom(from._impl_.category_iids_);
3100 _this->_impl_.debug_annotations_.MergeFrom(from._impl_.debug_annotations_);
3101 _this->_impl_.extra_counter_values_.MergeFrom(from._impl_.extra_counter_values_);
3102 _this->_impl_.categories_.MergeFrom(from._impl_.categories_);
3103 _this->_impl_.extra_counter_track_uuids_.MergeFrom(from._impl_.extra_counter_track_uuids_);
3104 _this->_impl_.flow_ids_old_.MergeFrom(from._impl_.flow_ids_old_);
3105 _this->_impl_.terminating_flow_ids_old_.MergeFrom(from._impl_.terminating_flow_ids_old_);
3106 _this->_impl_.extra_double_counter_track_uuids_.MergeFrom(from._impl_.extra_double_counter_track_uuids_);
3107 _this->_impl_.extra_double_counter_values_.MergeFrom(from._impl_.extra_double_counter_values_);
3108 _this->_impl_.flow_ids_.MergeFrom(from._impl_.flow_ids_);
3109 _this->_impl_.terminating_flow_ids_.MergeFrom(from._impl_.terminating_flow_ids_);
3110 cached_has_bits = from._impl_._has_bits_[0];
3111 if (cached_has_bits & 0x000000ffu) {
3112 if (cached_has_bits & 0x00000001u) {
3113 _this->_internal_mutable_task_execution()->::perfetto::protos::TaskExecution::MergeFrom(
3114 from._internal_task_execution());
3115 }
3116 if (cached_has_bits & 0x00000002u) {
3117 _this->_internal_mutable_legacy_event()->::perfetto::protos::TrackEvent_LegacyEvent::MergeFrom(
3118 from._internal_legacy_event());
3119 }
3120 if (cached_has_bits & 0x00000004u) {
3121 _this->_internal_mutable_log_message()->::perfetto::protos::LogMessage::MergeFrom(
3122 from._internal_log_message());
3123 }
3124 if (cached_has_bits & 0x00000008u) {
3125 _this->_internal_mutable_cc_scheduler_state()->::perfetto::protos::ChromeCompositorSchedulerState::MergeFrom(
3126 from._internal_cc_scheduler_state());
3127 }
3128 if (cached_has_bits & 0x00000010u) {
3129 _this->_internal_mutable_chrome_user_event()->::perfetto::protos::ChromeUserEvent::MergeFrom(
3130 from._internal_chrome_user_event());
3131 }
3132 if (cached_has_bits & 0x00000020u) {
3133 _this->_internal_mutable_chrome_keyed_service()->::perfetto::protos::ChromeKeyedService::MergeFrom(
3134 from._internal_chrome_keyed_service());
3135 }
3136 if (cached_has_bits & 0x00000040u) {
3137 _this->_internal_mutable_chrome_legacy_ipc()->::perfetto::protos::ChromeLegacyIpc::MergeFrom(
3138 from._internal_chrome_legacy_ipc());
3139 }
3140 if (cached_has_bits & 0x00000080u) {
3141 _this->_internal_mutable_chrome_histogram_sample()->::perfetto::protos::ChromeHistogramSample::MergeFrom(
3142 from._internal_chrome_histogram_sample());
3143 }
3144 }
3145 if (cached_has_bits & 0x0000ff00u) {
3146 if (cached_has_bits & 0x00000100u) {
3147 _this->_internal_mutable_chrome_latency_info()->::perfetto::protos::ChromeLatencyInfo::MergeFrom(
3148 from._internal_chrome_latency_info());
3149 }
3150 if (cached_has_bits & 0x00000200u) {
3151 _this->_internal_mutable_chrome_frame_reporter()->::perfetto::protos::ChromeFrameReporter::MergeFrom(
3152 from._internal_chrome_frame_reporter());
3153 }
3154 if (cached_has_bits & 0x00000400u) {
3155 _this->_internal_mutable_chrome_message_pump()->::perfetto::protos::ChromeMessagePump::MergeFrom(
3156 from._internal_chrome_message_pump());
3157 }
3158 if (cached_has_bits & 0x00000800u) {
3159 _this->_internal_mutable_chrome_mojo_event_info()->::perfetto::protos::ChromeMojoEventInfo::MergeFrom(
3160 from._internal_chrome_mojo_event_info());
3161 }
3162 if (cached_has_bits & 0x00001000u) {
3163 _this->_internal_mutable_chrome_application_state_info()->::perfetto::protos::ChromeApplicationStateInfo::MergeFrom(
3164 from._internal_chrome_application_state_info());
3165 }
3166 if (cached_has_bits & 0x00002000u) {
3167 _this->_internal_mutable_chrome_renderer_scheduler_state()->::perfetto::protos::ChromeRendererSchedulerState::MergeFrom(
3168 from._internal_chrome_renderer_scheduler_state());
3169 }
3170 if (cached_has_bits & 0x00004000u) {
3171 _this->_internal_mutable_chrome_window_handle_event_info()->::perfetto::protos::ChromeWindowHandleEventInfo::MergeFrom(
3172 from._internal_chrome_window_handle_event_info());
3173 }
3174 if (cached_has_bits & 0x00008000u) {
3175 _this->_internal_mutable_chrome_content_settings_event_info()->::perfetto::protos::ChromeContentSettingsEventInfo::MergeFrom(
3176 from._internal_chrome_content_settings_event_info());
3177 }
3178 }
3179 if (cached_has_bits & 0x000f0000u) {
3180 if (cached_has_bits & 0x00010000u) {
3181 _this->_internal_mutable_chrome_active_processes()->::perfetto::protos::ChromeActiveProcesses::MergeFrom(
3182 from._internal_chrome_active_processes());
3183 }
3184 if (cached_has_bits & 0x00020000u) {
3185 _this->_internal_mutable_screenshot()->::perfetto::protos::Screenshot::MergeFrom(
3186 from._internal_screenshot());
3187 }
3188 if (cached_has_bits & 0x00040000u) {
3189 _this->_impl_.track_uuid_ = from._impl_.track_uuid_;
3190 }
3191 if (cached_has_bits & 0x00080000u) {
3192 _this->_impl_.type_ = from._impl_.type_;
3193 }
3194 _this->_impl_._has_bits_[0] |= cached_has_bits;
3195 }
3196 switch (from.name_field_case()) {
3197 case kNameIid: {
3198 _this->_internal_set_name_iid(from._internal_name_iid());
3199 break;
3200 }
3201 case kName: {
3202 _this->_internal_set_name(from._internal_name());
3203 break;
3204 }
3205 case NAME_FIELD_NOT_SET: {
3206 break;
3207 }
3208 }
3209 switch (from.counter_value_field_case()) {
3210 case kCounterValue: {
3211 _this->_internal_set_counter_value(from._internal_counter_value());
3212 break;
3213 }
3214 case kDoubleCounterValue: {
3215 _this->_internal_set_double_counter_value(from._internal_double_counter_value());
3216 break;
3217 }
3218 case COUNTER_VALUE_FIELD_NOT_SET: {
3219 break;
3220 }
3221 }
3222 switch (from.source_location_field_case()) {
3223 case kSourceLocation: {
3224 _this->_internal_mutable_source_location()->::perfetto::protos::SourceLocation::MergeFrom(
3225 from._internal_source_location());
3226 break;
3227 }
3228 case kSourceLocationIid: {
3229 _this->_internal_set_source_location_iid(from._internal_source_location_iid());
3230 break;
3231 }
3232 case SOURCE_LOCATION_FIELD_NOT_SET: {
3233 break;
3234 }
3235 }
3236 switch (from.timestamp_case()) {
3237 case kTimestampDeltaUs: {
3238 _this->_internal_set_timestamp_delta_us(from._internal_timestamp_delta_us());
3239 break;
3240 }
3241 case kTimestampAbsoluteUs: {
3242 _this->_internal_set_timestamp_absolute_us(from._internal_timestamp_absolute_us());
3243 break;
3244 }
3245 case TIMESTAMP_NOT_SET: {
3246 break;
3247 }
3248 }
3249 switch (from.thread_time_case()) {
3250 case kThreadTimeDeltaUs: {
3251 _this->_internal_set_thread_time_delta_us(from._internal_thread_time_delta_us());
3252 break;
3253 }
3254 case kThreadTimeAbsoluteUs: {
3255 _this->_internal_set_thread_time_absolute_us(from._internal_thread_time_absolute_us());
3256 break;
3257 }
3258 case THREAD_TIME_NOT_SET: {
3259 break;
3260 }
3261 }
3262 switch (from.thread_instruction_count_case()) {
3263 case kThreadInstructionCountDelta: {
3264 _this->_internal_set_thread_instruction_count_delta(from._internal_thread_instruction_count_delta());
3265 break;
3266 }
3267 case kThreadInstructionCountAbsolute: {
3268 _this->_internal_set_thread_instruction_count_absolute(from._internal_thread_instruction_count_absolute());
3269 break;
3270 }
3271 case THREAD_INSTRUCTION_COUNT_NOT_SET: {
3272 break;
3273 }
3274 }
3275 _this->_impl_._extensions_.MergeFrom(internal_default_instance(), from._impl_._extensions_);
3276 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
3277 }
3278
CopyFrom(const TrackEvent & from)3279 void TrackEvent::CopyFrom(const TrackEvent& from) {
3280 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TrackEvent)
3281 if (&from == this) return;
3282 Clear();
3283 MergeFrom(from);
3284 }
3285
IsInitialized() const3286 bool TrackEvent::IsInitialized() const {
3287 if (!_impl_._extensions_.IsInitialized()) {
3288 return false;
3289 }
3290
3291 return true;
3292 }
3293
InternalSwap(TrackEvent * other)3294 void TrackEvent::InternalSwap(TrackEvent* other) {
3295 using std::swap;
3296 _impl_._extensions_.InternalSwap(&other->_impl_._extensions_);
3297 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
3298 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
3299 _impl_.category_iids_.InternalSwap(&other->_impl_.category_iids_);
3300 _impl_.debug_annotations_.InternalSwap(&other->_impl_.debug_annotations_);
3301 _impl_.extra_counter_values_.InternalSwap(&other->_impl_.extra_counter_values_);
3302 _impl_.categories_.InternalSwap(&other->_impl_.categories_);
3303 _impl_.extra_counter_track_uuids_.InternalSwap(&other->_impl_.extra_counter_track_uuids_);
3304 _impl_.flow_ids_old_.InternalSwap(&other->_impl_.flow_ids_old_);
3305 _impl_.terminating_flow_ids_old_.InternalSwap(&other->_impl_.terminating_flow_ids_old_);
3306 _impl_.extra_double_counter_track_uuids_.InternalSwap(&other->_impl_.extra_double_counter_track_uuids_);
3307 _impl_.extra_double_counter_values_.InternalSwap(&other->_impl_.extra_double_counter_values_);
3308 _impl_.flow_ids_.InternalSwap(&other->_impl_.flow_ids_);
3309 _impl_.terminating_flow_ids_.InternalSwap(&other->_impl_.terminating_flow_ids_);
3310 ::PROTOBUF_NAMESPACE_ID::internal::memswap<
3311 PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.type_)
3312 + sizeof(TrackEvent::_impl_.type_) // NOLINT
3313 - PROTOBUF_FIELD_OFFSET(TrackEvent, _impl_.task_execution_)>(
3314 reinterpret_cast<char*>(&_impl_.task_execution_),
3315 reinterpret_cast<char*>(&other->_impl_.task_execution_));
3316 swap(_impl_.name_field_, other->_impl_.name_field_);
3317 swap(_impl_.counter_value_field_, other->_impl_.counter_value_field_);
3318 swap(_impl_.source_location_field_, other->_impl_.source_location_field_);
3319 swap(_impl_.timestamp_, other->_impl_.timestamp_);
3320 swap(_impl_.thread_time_, other->_impl_.thread_time_);
3321 swap(_impl_.thread_instruction_count_, other->_impl_.thread_instruction_count_);
3322 swap(_impl_._oneof_case_[0], other->_impl_._oneof_case_[0]);
3323 swap(_impl_._oneof_case_[1], other->_impl_._oneof_case_[1]);
3324 swap(_impl_._oneof_case_[2], other->_impl_._oneof_case_[2]);
3325 swap(_impl_._oneof_case_[3], other->_impl_._oneof_case_[3]);
3326 swap(_impl_._oneof_case_[4], other->_impl_._oneof_case_[4]);
3327 swap(_impl_._oneof_case_[5], other->_impl_._oneof_case_[5]);
3328 }
3329
GetTypeName() const3330 std::string TrackEvent::GetTypeName() const {
3331 return "perfetto.protos.TrackEvent";
3332 }
3333
3334
3335 // ===================================================================
3336
3337 class TrackEventDefaults::_Internal {
3338 public:
3339 using HasBits = decltype(std::declval<TrackEventDefaults>()._impl_._has_bits_);
set_has_track_uuid(HasBits * has_bits)3340 static void set_has_track_uuid(HasBits* has_bits) {
3341 (*has_bits)[0] |= 1u;
3342 }
3343 };
3344
TrackEventDefaults(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)3345 TrackEventDefaults::TrackEventDefaults(::PROTOBUF_NAMESPACE_ID::Arena* arena,
3346 bool is_message_owned)
3347 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
3348 SharedCtor(arena, is_message_owned);
3349 // @@protoc_insertion_point(arena_constructor:perfetto.protos.TrackEventDefaults)
3350 }
TrackEventDefaults(const TrackEventDefaults & from)3351 TrackEventDefaults::TrackEventDefaults(const TrackEventDefaults& from)
3352 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
3353 TrackEventDefaults* const _this = this; (void)_this;
3354 new (&_impl_) Impl_{
3355 decltype(_impl_._has_bits_){from._impl_._has_bits_}
3356 , /*decltype(_impl_._cached_size_)*/{}
3357 , decltype(_impl_.extra_counter_track_uuids_){from._impl_.extra_counter_track_uuids_}
3358 , decltype(_impl_.extra_double_counter_track_uuids_){from._impl_.extra_double_counter_track_uuids_}
3359 , decltype(_impl_.track_uuid_){}};
3360
3361 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
3362 _this->_impl_.track_uuid_ = from._impl_.track_uuid_;
3363 // @@protoc_insertion_point(copy_constructor:perfetto.protos.TrackEventDefaults)
3364 }
3365
SharedCtor(::_pb::Arena * arena,bool is_message_owned)3366 inline void TrackEventDefaults::SharedCtor(
3367 ::_pb::Arena* arena, bool is_message_owned) {
3368 (void)arena;
3369 (void)is_message_owned;
3370 new (&_impl_) Impl_{
3371 decltype(_impl_._has_bits_){}
3372 , /*decltype(_impl_._cached_size_)*/{}
3373 , decltype(_impl_.extra_counter_track_uuids_){arena}
3374 , decltype(_impl_.extra_double_counter_track_uuids_){arena}
3375 , decltype(_impl_.track_uuid_){::uint64_t{0u}}
3376 };
3377 }
3378
~TrackEventDefaults()3379 TrackEventDefaults::~TrackEventDefaults() {
3380 // @@protoc_insertion_point(destructor:perfetto.protos.TrackEventDefaults)
3381 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
3382 (void)arena;
3383 return;
3384 }
3385 SharedDtor();
3386 }
3387
SharedDtor()3388 inline void TrackEventDefaults::SharedDtor() {
3389 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
3390 _impl_.extra_counter_track_uuids_.~RepeatedField();
3391 _impl_.extra_double_counter_track_uuids_.~RepeatedField();
3392 }
3393
SetCachedSize(int size) const3394 void TrackEventDefaults::SetCachedSize(int size) const {
3395 _impl_._cached_size_.Set(size);
3396 }
3397
Clear()3398 void TrackEventDefaults::Clear() {
3399 // @@protoc_insertion_point(message_clear_start:perfetto.protos.TrackEventDefaults)
3400 ::uint32_t cached_has_bits = 0;
3401 // Prevent compiler warnings about cached_has_bits being unused
3402 (void) cached_has_bits;
3403
3404 _impl_.extra_counter_track_uuids_.Clear();
3405 _impl_.extra_double_counter_track_uuids_.Clear();
3406 _impl_.track_uuid_ = ::uint64_t{0u};
3407 _impl_._has_bits_.Clear();
3408 _internal_metadata_.Clear<std::string>();
3409 }
3410
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)3411 const char* TrackEventDefaults::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
3412 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
3413 _Internal::HasBits has_bits{};
3414 while (!ctx->Done(&ptr)) {
3415 ::uint32_t tag;
3416 ptr = ::_pbi::ReadTag(ptr, &tag);
3417 switch (tag >> 3) {
3418 // optional uint64 track_uuid = 11;
3419 case 11:
3420 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 88)) {
3421 _Internal::set_has_track_uuid(&has_bits);
3422 _impl_.track_uuid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
3423 CHK_(ptr);
3424 } else {
3425 goto handle_unusual;
3426 }
3427 continue;
3428 // repeated uint64 extra_counter_track_uuids = 31;
3429 case 31:
3430 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 248)) {
3431 ptr -= 2;
3432 do {
3433 ptr += 2;
3434 _internal_add_extra_counter_track_uuids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
3435 CHK_(ptr);
3436 if (!ctx->DataAvailable(ptr)) break;
3437 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<248>(ptr));
3438 } else if (static_cast<::uint8_t>(tag) == 250) {
3439 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_extra_counter_track_uuids(), ptr, ctx);
3440 CHK_(ptr);
3441 } else {
3442 goto handle_unusual;
3443 }
3444 continue;
3445 // repeated uint64 extra_double_counter_track_uuids = 45;
3446 case 45:
3447 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 104)) {
3448 ptr -= 2;
3449 do {
3450 ptr += 2;
3451 _internal_add_extra_double_counter_track_uuids(::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr));
3452 CHK_(ptr);
3453 if (!ctx->DataAvailable(ptr)) break;
3454 } while (::PROTOBUF_NAMESPACE_ID::internal::ExpectTag<360>(ptr));
3455 } else if (static_cast<::uint8_t>(tag) == 106) {
3456 ptr = ::PROTOBUF_NAMESPACE_ID::internal::PackedUInt64Parser(_internal_mutable_extra_double_counter_track_uuids(), ptr, ctx);
3457 CHK_(ptr);
3458 } else {
3459 goto handle_unusual;
3460 }
3461 continue;
3462 default:
3463 goto handle_unusual;
3464 } // switch
3465 handle_unusual:
3466 if ((tag == 0) || ((tag & 7) == 4)) {
3467 CHK_(ptr);
3468 ctx->SetLastTag(tag);
3469 goto message_done;
3470 }
3471 ptr = UnknownFieldParse(
3472 tag,
3473 _internal_metadata_.mutable_unknown_fields<std::string>(),
3474 ptr, ctx);
3475 CHK_(ptr != nullptr);
3476 } // while
3477 message_done:
3478 _impl_._has_bits_.Or(has_bits);
3479 return ptr;
3480 failure:
3481 ptr = nullptr;
3482 goto message_done;
3483 #undef CHK_
3484 }
3485
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const3486 ::uint8_t* TrackEventDefaults::_InternalSerialize(
3487 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
3488 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.TrackEventDefaults)
3489 ::uint32_t cached_has_bits = 0;
3490 (void) cached_has_bits;
3491
3492 cached_has_bits = _impl_._has_bits_[0];
3493 // optional uint64 track_uuid = 11;
3494 if (cached_has_bits & 0x00000001u) {
3495 target = stream->EnsureSpace(target);
3496 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(11, this->_internal_track_uuid(), target);
3497 }
3498
3499 // repeated uint64 extra_counter_track_uuids = 31;
3500 for (int i = 0, n = this->_internal_extra_counter_track_uuids_size(); i < n; i++) {
3501 target = stream->EnsureSpace(target);
3502 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(31, this->_internal_extra_counter_track_uuids(i), target);
3503 }
3504
3505 // repeated uint64 extra_double_counter_track_uuids = 45;
3506 for (int i = 0, n = this->_internal_extra_double_counter_track_uuids_size(); i < n; i++) {
3507 target = stream->EnsureSpace(target);
3508 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(45, this->_internal_extra_double_counter_track_uuids(i), target);
3509 }
3510
3511 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
3512 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
3513 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
3514 }
3515 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.TrackEventDefaults)
3516 return target;
3517 }
3518
ByteSizeLong() const3519 size_t TrackEventDefaults::ByteSizeLong() const {
3520 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.TrackEventDefaults)
3521 size_t total_size = 0;
3522
3523 ::uint32_t cached_has_bits = 0;
3524 // Prevent compiler warnings about cached_has_bits being unused
3525 (void) cached_has_bits;
3526
3527 // repeated uint64 extra_counter_track_uuids = 31;
3528 {
3529 size_t data_size = ::_pbi::WireFormatLite::
3530 UInt64Size(this->_impl_.extra_counter_track_uuids_);
3531 total_size += 2 *
3532 ::_pbi::FromIntSize(this->_internal_extra_counter_track_uuids_size());
3533 total_size += data_size;
3534 }
3535
3536 // repeated uint64 extra_double_counter_track_uuids = 45;
3537 {
3538 size_t data_size = ::_pbi::WireFormatLite::
3539 UInt64Size(this->_impl_.extra_double_counter_track_uuids_);
3540 total_size += 2 *
3541 ::_pbi::FromIntSize(this->_internal_extra_double_counter_track_uuids_size());
3542 total_size += data_size;
3543 }
3544
3545 // optional uint64 track_uuid = 11;
3546 cached_has_bits = _impl_._has_bits_[0];
3547 if (cached_has_bits & 0x00000001u) {
3548 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_track_uuid());
3549 }
3550
3551 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
3552 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
3553 }
3554 int cached_size = ::_pbi::ToCachedSize(total_size);
3555 SetCachedSize(cached_size);
3556 return total_size;
3557 }
3558
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)3559 void TrackEventDefaults::CheckTypeAndMergeFrom(
3560 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
3561 MergeFrom(*::_pbi::DownCast<const TrackEventDefaults*>(
3562 &from));
3563 }
3564
MergeFrom(const TrackEventDefaults & from)3565 void TrackEventDefaults::MergeFrom(const TrackEventDefaults& from) {
3566 TrackEventDefaults* const _this = this;
3567 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.TrackEventDefaults)
3568 GOOGLE_DCHECK_NE(&from, _this);
3569 ::uint32_t cached_has_bits = 0;
3570 (void) cached_has_bits;
3571
3572 _this->_impl_.extra_counter_track_uuids_.MergeFrom(from._impl_.extra_counter_track_uuids_);
3573 _this->_impl_.extra_double_counter_track_uuids_.MergeFrom(from._impl_.extra_double_counter_track_uuids_);
3574 if (from._internal_has_track_uuid()) {
3575 _this->_internal_set_track_uuid(from._internal_track_uuid());
3576 }
3577 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
3578 }
3579
CopyFrom(const TrackEventDefaults & from)3580 void TrackEventDefaults::CopyFrom(const TrackEventDefaults& from) {
3581 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.TrackEventDefaults)
3582 if (&from == this) return;
3583 Clear();
3584 MergeFrom(from);
3585 }
3586
IsInitialized() const3587 bool TrackEventDefaults::IsInitialized() const {
3588 return true;
3589 }
3590
InternalSwap(TrackEventDefaults * other)3591 void TrackEventDefaults::InternalSwap(TrackEventDefaults* other) {
3592 using std::swap;
3593 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
3594 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
3595 _impl_.extra_counter_track_uuids_.InternalSwap(&other->_impl_.extra_counter_track_uuids_);
3596 _impl_.extra_double_counter_track_uuids_.InternalSwap(&other->_impl_.extra_double_counter_track_uuids_);
3597 swap(_impl_.track_uuid_, other->_impl_.track_uuid_);
3598 }
3599
GetTypeName() const3600 std::string TrackEventDefaults::GetTypeName() const {
3601 return "perfetto.protos.TrackEventDefaults";
3602 }
3603
3604
3605 // ===================================================================
3606
3607 class EventCategory::_Internal {
3608 public:
3609 using HasBits = decltype(std::declval<EventCategory>()._impl_._has_bits_);
set_has_iid(HasBits * has_bits)3610 static void set_has_iid(HasBits* has_bits) {
3611 (*has_bits)[0] |= 2u;
3612 }
set_has_name(HasBits * has_bits)3613 static void set_has_name(HasBits* has_bits) {
3614 (*has_bits)[0] |= 1u;
3615 }
3616 };
3617
EventCategory(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)3618 EventCategory::EventCategory(::PROTOBUF_NAMESPACE_ID::Arena* arena,
3619 bool is_message_owned)
3620 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
3621 SharedCtor(arena, is_message_owned);
3622 // @@protoc_insertion_point(arena_constructor:perfetto.protos.EventCategory)
3623 }
EventCategory(const EventCategory & from)3624 EventCategory::EventCategory(const EventCategory& from)
3625 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
3626 EventCategory* const _this = this; (void)_this;
3627 new (&_impl_) Impl_{
3628 decltype(_impl_._has_bits_){from._impl_._has_bits_}
3629 , /*decltype(_impl_._cached_size_)*/{}
3630 , decltype(_impl_.name_){}
3631 , decltype(_impl_.iid_){}};
3632
3633 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
3634 _impl_.name_.InitDefault();
3635 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
3636 _impl_.name_.Set("", GetArenaForAllocation());
3637 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
3638 if (from._internal_has_name()) {
3639 _this->_impl_.name_.Set(from._internal_name(),
3640 _this->GetArenaForAllocation());
3641 }
3642 _this->_impl_.iid_ = from._impl_.iid_;
3643 // @@protoc_insertion_point(copy_constructor:perfetto.protos.EventCategory)
3644 }
3645
SharedCtor(::_pb::Arena * arena,bool is_message_owned)3646 inline void EventCategory::SharedCtor(
3647 ::_pb::Arena* arena, bool is_message_owned) {
3648 (void)arena;
3649 (void)is_message_owned;
3650 new (&_impl_) Impl_{
3651 decltype(_impl_._has_bits_){}
3652 , /*decltype(_impl_._cached_size_)*/{}
3653 , decltype(_impl_.name_){}
3654 , decltype(_impl_.iid_){::uint64_t{0u}}
3655 };
3656 _impl_.name_.InitDefault();
3657 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
3658 _impl_.name_.Set("", GetArenaForAllocation());
3659 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
3660 }
3661
~EventCategory()3662 EventCategory::~EventCategory() {
3663 // @@protoc_insertion_point(destructor:perfetto.protos.EventCategory)
3664 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
3665 (void)arena;
3666 return;
3667 }
3668 SharedDtor();
3669 }
3670
SharedDtor()3671 inline void EventCategory::SharedDtor() {
3672 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
3673 _impl_.name_.Destroy();
3674 }
3675
SetCachedSize(int size) const3676 void EventCategory::SetCachedSize(int size) const {
3677 _impl_._cached_size_.Set(size);
3678 }
3679
Clear()3680 void EventCategory::Clear() {
3681 // @@protoc_insertion_point(message_clear_start:perfetto.protos.EventCategory)
3682 ::uint32_t cached_has_bits = 0;
3683 // Prevent compiler warnings about cached_has_bits being unused
3684 (void) cached_has_bits;
3685
3686 cached_has_bits = _impl_._has_bits_[0];
3687 if (cached_has_bits & 0x00000001u) {
3688 _impl_.name_.ClearNonDefaultToEmpty();
3689 }
3690 _impl_.iid_ = ::uint64_t{0u};
3691 _impl_._has_bits_.Clear();
3692 _internal_metadata_.Clear<std::string>();
3693 }
3694
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)3695 const char* EventCategory::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
3696 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
3697 _Internal::HasBits has_bits{};
3698 while (!ctx->Done(&ptr)) {
3699 ::uint32_t tag;
3700 ptr = ::_pbi::ReadTag(ptr, &tag);
3701 switch (tag >> 3) {
3702 // optional uint64 iid = 1;
3703 case 1:
3704 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
3705 _Internal::set_has_iid(&has_bits);
3706 _impl_.iid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
3707 CHK_(ptr);
3708 } else {
3709 goto handle_unusual;
3710 }
3711 continue;
3712 // optional string name = 2;
3713 case 2:
3714 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
3715 auto str = _internal_mutable_name();
3716 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
3717 CHK_(ptr);
3718 } else {
3719 goto handle_unusual;
3720 }
3721 continue;
3722 default:
3723 goto handle_unusual;
3724 } // switch
3725 handle_unusual:
3726 if ((tag == 0) || ((tag & 7) == 4)) {
3727 CHK_(ptr);
3728 ctx->SetLastTag(tag);
3729 goto message_done;
3730 }
3731 ptr = UnknownFieldParse(
3732 tag,
3733 _internal_metadata_.mutable_unknown_fields<std::string>(),
3734 ptr, ctx);
3735 CHK_(ptr != nullptr);
3736 } // while
3737 message_done:
3738 _impl_._has_bits_.Or(has_bits);
3739 return ptr;
3740 failure:
3741 ptr = nullptr;
3742 goto message_done;
3743 #undef CHK_
3744 }
3745
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const3746 ::uint8_t* EventCategory::_InternalSerialize(
3747 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
3748 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.EventCategory)
3749 ::uint32_t cached_has_bits = 0;
3750 (void) cached_has_bits;
3751
3752 cached_has_bits = _impl_._has_bits_[0];
3753 // optional uint64 iid = 1;
3754 if (cached_has_bits & 0x00000002u) {
3755 target = stream->EnsureSpace(target);
3756 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_iid(), target);
3757 }
3758
3759 // optional string name = 2;
3760 if (cached_has_bits & 0x00000001u) {
3761 target = stream->WriteStringMaybeAliased(
3762 2, this->_internal_name(), target);
3763 }
3764
3765 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
3766 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
3767 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
3768 }
3769 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.EventCategory)
3770 return target;
3771 }
3772
ByteSizeLong() const3773 size_t EventCategory::ByteSizeLong() const {
3774 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.EventCategory)
3775 size_t total_size = 0;
3776
3777 ::uint32_t cached_has_bits = 0;
3778 // Prevent compiler warnings about cached_has_bits being unused
3779 (void) cached_has_bits;
3780
3781 cached_has_bits = _impl_._has_bits_[0];
3782 if (cached_has_bits & 0x00000003u) {
3783 // optional string name = 2;
3784 if (cached_has_bits & 0x00000001u) {
3785 total_size += 1 +
3786 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
3787 this->_internal_name());
3788 }
3789
3790 // optional uint64 iid = 1;
3791 if (cached_has_bits & 0x00000002u) {
3792 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_iid());
3793 }
3794
3795 }
3796 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
3797 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
3798 }
3799 int cached_size = ::_pbi::ToCachedSize(total_size);
3800 SetCachedSize(cached_size);
3801 return total_size;
3802 }
3803
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)3804 void EventCategory::CheckTypeAndMergeFrom(
3805 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
3806 MergeFrom(*::_pbi::DownCast<const EventCategory*>(
3807 &from));
3808 }
3809
MergeFrom(const EventCategory & from)3810 void EventCategory::MergeFrom(const EventCategory& from) {
3811 EventCategory* const _this = this;
3812 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.EventCategory)
3813 GOOGLE_DCHECK_NE(&from, _this);
3814 ::uint32_t cached_has_bits = 0;
3815 (void) cached_has_bits;
3816
3817 cached_has_bits = from._impl_._has_bits_[0];
3818 if (cached_has_bits & 0x00000003u) {
3819 if (cached_has_bits & 0x00000001u) {
3820 _this->_internal_set_name(from._internal_name());
3821 }
3822 if (cached_has_bits & 0x00000002u) {
3823 _this->_impl_.iid_ = from._impl_.iid_;
3824 }
3825 _this->_impl_._has_bits_[0] |= cached_has_bits;
3826 }
3827 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
3828 }
3829
CopyFrom(const EventCategory & from)3830 void EventCategory::CopyFrom(const EventCategory& from) {
3831 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.EventCategory)
3832 if (&from == this) return;
3833 Clear();
3834 MergeFrom(from);
3835 }
3836
IsInitialized() const3837 bool EventCategory::IsInitialized() const {
3838 return true;
3839 }
3840
InternalSwap(EventCategory * other)3841 void EventCategory::InternalSwap(EventCategory* other) {
3842 using std::swap;
3843 auto* lhs_arena = GetArenaForAllocation();
3844 auto* rhs_arena = other->GetArenaForAllocation();
3845 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
3846 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
3847 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
3848 &_impl_.name_, lhs_arena,
3849 &other->_impl_.name_, rhs_arena
3850 );
3851 swap(_impl_.iid_, other->_impl_.iid_);
3852 }
3853
GetTypeName() const3854 std::string EventCategory::GetTypeName() const {
3855 return "perfetto.protos.EventCategory";
3856 }
3857
3858
3859 // ===================================================================
3860
3861 class EventName::_Internal {
3862 public:
3863 using HasBits = decltype(std::declval<EventName>()._impl_._has_bits_);
set_has_iid(HasBits * has_bits)3864 static void set_has_iid(HasBits* has_bits) {
3865 (*has_bits)[0] |= 2u;
3866 }
set_has_name(HasBits * has_bits)3867 static void set_has_name(HasBits* has_bits) {
3868 (*has_bits)[0] |= 1u;
3869 }
3870 };
3871
EventName(::PROTOBUF_NAMESPACE_ID::Arena * arena,bool is_message_owned)3872 EventName::EventName(::PROTOBUF_NAMESPACE_ID::Arena* arena,
3873 bool is_message_owned)
3874 : ::PROTOBUF_NAMESPACE_ID::MessageLite(arena, is_message_owned) {
3875 SharedCtor(arena, is_message_owned);
3876 // @@protoc_insertion_point(arena_constructor:perfetto.protos.EventName)
3877 }
EventName(const EventName & from)3878 EventName::EventName(const EventName& from)
3879 : ::PROTOBUF_NAMESPACE_ID::MessageLite() {
3880 EventName* const _this = this; (void)_this;
3881 new (&_impl_) Impl_{
3882 decltype(_impl_._has_bits_){from._impl_._has_bits_}
3883 , /*decltype(_impl_._cached_size_)*/{}
3884 , decltype(_impl_.name_){}
3885 , decltype(_impl_.iid_){}};
3886
3887 _internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
3888 _impl_.name_.InitDefault();
3889 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
3890 _impl_.name_.Set("", GetArenaForAllocation());
3891 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
3892 if (from._internal_has_name()) {
3893 _this->_impl_.name_.Set(from._internal_name(),
3894 _this->GetArenaForAllocation());
3895 }
3896 _this->_impl_.iid_ = from._impl_.iid_;
3897 // @@protoc_insertion_point(copy_constructor:perfetto.protos.EventName)
3898 }
3899
SharedCtor(::_pb::Arena * arena,bool is_message_owned)3900 inline void EventName::SharedCtor(
3901 ::_pb::Arena* arena, bool is_message_owned) {
3902 (void)arena;
3903 (void)is_message_owned;
3904 new (&_impl_) Impl_{
3905 decltype(_impl_._has_bits_){}
3906 , /*decltype(_impl_._cached_size_)*/{}
3907 , decltype(_impl_.name_){}
3908 , decltype(_impl_.iid_){::uint64_t{0u}}
3909 };
3910 _impl_.name_.InitDefault();
3911 #ifdef PROTOBUF_FORCE_COPY_DEFAULT_STRING
3912 _impl_.name_.Set("", GetArenaForAllocation());
3913 #endif // PROTOBUF_FORCE_COPY_DEFAULT_STRING
3914 }
3915
~EventName()3916 EventName::~EventName() {
3917 // @@protoc_insertion_point(destructor:perfetto.protos.EventName)
3918 if (auto *arena = _internal_metadata_.DeleteReturnArena<std::string>()) {
3919 (void)arena;
3920 return;
3921 }
3922 SharedDtor();
3923 }
3924
SharedDtor()3925 inline void EventName::SharedDtor() {
3926 GOOGLE_DCHECK(GetArenaForAllocation() == nullptr);
3927 _impl_.name_.Destroy();
3928 }
3929
SetCachedSize(int size) const3930 void EventName::SetCachedSize(int size) const {
3931 _impl_._cached_size_.Set(size);
3932 }
3933
Clear()3934 void EventName::Clear() {
3935 // @@protoc_insertion_point(message_clear_start:perfetto.protos.EventName)
3936 ::uint32_t cached_has_bits = 0;
3937 // Prevent compiler warnings about cached_has_bits being unused
3938 (void) cached_has_bits;
3939
3940 cached_has_bits = _impl_._has_bits_[0];
3941 if (cached_has_bits & 0x00000001u) {
3942 _impl_.name_.ClearNonDefaultToEmpty();
3943 }
3944 _impl_.iid_ = ::uint64_t{0u};
3945 _impl_._has_bits_.Clear();
3946 _internal_metadata_.Clear<std::string>();
3947 }
3948
_InternalParse(const char * ptr,::_pbi::ParseContext * ctx)3949 const char* EventName::_InternalParse(const char* ptr, ::_pbi::ParseContext* ctx) {
3950 #define CHK_(x) if (PROTOBUF_PREDICT_FALSE(!(x))) goto failure
3951 _Internal::HasBits has_bits{};
3952 while (!ctx->Done(&ptr)) {
3953 ::uint32_t tag;
3954 ptr = ::_pbi::ReadTag(ptr, &tag);
3955 switch (tag >> 3) {
3956 // optional uint64 iid = 1;
3957 case 1:
3958 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 8)) {
3959 _Internal::set_has_iid(&has_bits);
3960 _impl_.iid_ = ::PROTOBUF_NAMESPACE_ID::internal::ReadVarint64(&ptr);
3961 CHK_(ptr);
3962 } else {
3963 goto handle_unusual;
3964 }
3965 continue;
3966 // optional string name = 2;
3967 case 2:
3968 if (PROTOBUF_PREDICT_TRUE(static_cast<::uint8_t>(tag) == 18)) {
3969 auto str = _internal_mutable_name();
3970 ptr = ::_pbi::InlineGreedyStringParser(str, ptr, ctx);
3971 CHK_(ptr);
3972 } else {
3973 goto handle_unusual;
3974 }
3975 continue;
3976 default:
3977 goto handle_unusual;
3978 } // switch
3979 handle_unusual:
3980 if ((tag == 0) || ((tag & 7) == 4)) {
3981 CHK_(ptr);
3982 ctx->SetLastTag(tag);
3983 goto message_done;
3984 }
3985 ptr = UnknownFieldParse(
3986 tag,
3987 _internal_metadata_.mutable_unknown_fields<std::string>(),
3988 ptr, ctx);
3989 CHK_(ptr != nullptr);
3990 } // while
3991 message_done:
3992 _impl_._has_bits_.Or(has_bits);
3993 return ptr;
3994 failure:
3995 ptr = nullptr;
3996 goto message_done;
3997 #undef CHK_
3998 }
3999
_InternalSerialize(::uint8_t * target,::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream * stream) const4000 ::uint8_t* EventName::_InternalSerialize(
4001 ::uint8_t* target, ::PROTOBUF_NAMESPACE_ID::io::EpsCopyOutputStream* stream) const {
4002 // @@protoc_insertion_point(serialize_to_array_start:perfetto.protos.EventName)
4003 ::uint32_t cached_has_bits = 0;
4004 (void) cached_has_bits;
4005
4006 cached_has_bits = _impl_._has_bits_[0];
4007 // optional uint64 iid = 1;
4008 if (cached_has_bits & 0x00000002u) {
4009 target = stream->EnsureSpace(target);
4010 target = ::_pbi::WireFormatLite::WriteUInt64ToArray(1, this->_internal_iid(), target);
4011 }
4012
4013 // optional string name = 2;
4014 if (cached_has_bits & 0x00000001u) {
4015 target = stream->WriteStringMaybeAliased(
4016 2, this->_internal_name(), target);
4017 }
4018
4019 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
4020 target = stream->WriteRaw(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).data(),
4021 static_cast<int>(_internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size()), target);
4022 }
4023 // @@protoc_insertion_point(serialize_to_array_end:perfetto.protos.EventName)
4024 return target;
4025 }
4026
ByteSizeLong() const4027 size_t EventName::ByteSizeLong() const {
4028 // @@protoc_insertion_point(message_byte_size_start:perfetto.protos.EventName)
4029 size_t total_size = 0;
4030
4031 ::uint32_t cached_has_bits = 0;
4032 // Prevent compiler warnings about cached_has_bits being unused
4033 (void) cached_has_bits;
4034
4035 cached_has_bits = _impl_._has_bits_[0];
4036 if (cached_has_bits & 0x00000003u) {
4037 // optional string name = 2;
4038 if (cached_has_bits & 0x00000001u) {
4039 total_size += 1 +
4040 ::PROTOBUF_NAMESPACE_ID::internal::WireFormatLite::StringSize(
4041 this->_internal_name());
4042 }
4043
4044 // optional uint64 iid = 1;
4045 if (cached_has_bits & 0x00000002u) {
4046 total_size += ::_pbi::WireFormatLite::UInt64SizePlusOne(this->_internal_iid());
4047 }
4048
4049 }
4050 if (PROTOBUF_PREDICT_FALSE(_internal_metadata_.have_unknown_fields())) {
4051 total_size += _internal_metadata_.unknown_fields<std::string>(::PROTOBUF_NAMESPACE_ID::internal::GetEmptyString).size();
4052 }
4053 int cached_size = ::_pbi::ToCachedSize(total_size);
4054 SetCachedSize(cached_size);
4055 return total_size;
4056 }
4057
CheckTypeAndMergeFrom(const::PROTOBUF_NAMESPACE_ID::MessageLite & from)4058 void EventName::CheckTypeAndMergeFrom(
4059 const ::PROTOBUF_NAMESPACE_ID::MessageLite& from) {
4060 MergeFrom(*::_pbi::DownCast<const EventName*>(
4061 &from));
4062 }
4063
MergeFrom(const EventName & from)4064 void EventName::MergeFrom(const EventName& from) {
4065 EventName* const _this = this;
4066 // @@protoc_insertion_point(class_specific_merge_from_start:perfetto.protos.EventName)
4067 GOOGLE_DCHECK_NE(&from, _this);
4068 ::uint32_t cached_has_bits = 0;
4069 (void) cached_has_bits;
4070
4071 cached_has_bits = from._impl_._has_bits_[0];
4072 if (cached_has_bits & 0x00000003u) {
4073 if (cached_has_bits & 0x00000001u) {
4074 _this->_internal_set_name(from._internal_name());
4075 }
4076 if (cached_has_bits & 0x00000002u) {
4077 _this->_impl_.iid_ = from._impl_.iid_;
4078 }
4079 _this->_impl_._has_bits_[0] |= cached_has_bits;
4080 }
4081 _this->_internal_metadata_.MergeFrom<std::string>(from._internal_metadata_);
4082 }
4083
CopyFrom(const EventName & from)4084 void EventName::CopyFrom(const EventName& from) {
4085 // @@protoc_insertion_point(class_specific_copy_from_start:perfetto.protos.EventName)
4086 if (&from == this) return;
4087 Clear();
4088 MergeFrom(from);
4089 }
4090
IsInitialized() const4091 bool EventName::IsInitialized() const {
4092 return true;
4093 }
4094
InternalSwap(EventName * other)4095 void EventName::InternalSwap(EventName* other) {
4096 using std::swap;
4097 auto* lhs_arena = GetArenaForAllocation();
4098 auto* rhs_arena = other->GetArenaForAllocation();
4099 _internal_metadata_.InternalSwap(&other->_internal_metadata_);
4100 swap(_impl_._has_bits_[0], other->_impl_._has_bits_[0]);
4101 ::PROTOBUF_NAMESPACE_ID::internal::ArenaStringPtr::InternalSwap(
4102 &_impl_.name_, lhs_arena,
4103 &other->_impl_.name_, rhs_arena
4104 );
4105 swap(_impl_.iid_, other->_impl_.iid_);
4106 }
4107
GetTypeName() const4108 std::string EventName::GetTypeName() const {
4109 return "perfetto.protos.EventName";
4110 }
4111
4112
4113 // @@protoc_insertion_point(namespace_scope)
4114 } // namespace protos
4115 } // namespace perfetto
4116 PROTOBUF_NAMESPACE_OPEN
4117 template<> PROTOBUF_NOINLINE ::perfetto::protos::TrackEvent_LegacyEvent*
CreateMaybeMessage(Arena * arena)4118 Arena::CreateMaybeMessage< ::perfetto::protos::TrackEvent_LegacyEvent >(Arena* arena) {
4119 return Arena::CreateMessageInternal< ::perfetto::protos::TrackEvent_LegacyEvent >(arena);
4120 }
4121 template<> PROTOBUF_NOINLINE ::perfetto::protos::TrackEvent*
CreateMaybeMessage(Arena * arena)4122 Arena::CreateMaybeMessage< ::perfetto::protos::TrackEvent >(Arena* arena) {
4123 return Arena::CreateMessageInternal< ::perfetto::protos::TrackEvent >(arena);
4124 }
4125 template<> PROTOBUF_NOINLINE ::perfetto::protos::TrackEventDefaults*
CreateMaybeMessage(Arena * arena)4126 Arena::CreateMaybeMessage< ::perfetto::protos::TrackEventDefaults >(Arena* arena) {
4127 return Arena::CreateMessageInternal< ::perfetto::protos::TrackEventDefaults >(arena);
4128 }
4129 template<> PROTOBUF_NOINLINE ::perfetto::protos::EventCategory*
CreateMaybeMessage(Arena * arena)4130 Arena::CreateMaybeMessage< ::perfetto::protos::EventCategory >(Arena* arena) {
4131 return Arena::CreateMessageInternal< ::perfetto::protos::EventCategory >(arena);
4132 }
4133 template<> PROTOBUF_NOINLINE ::perfetto::protos::EventName*
CreateMaybeMessage(Arena * arena)4134 Arena::CreateMaybeMessage< ::perfetto::protos::EventName >(Arena* arena) {
4135 return Arena::CreateMessageInternal< ::perfetto::protos::EventName >(arena);
4136 }
4137 PROTOBUF_NAMESPACE_CLOSE
4138
4139 // @@protoc_insertion_point(global_scope)
4140 #include <google/protobuf/port_undef.inc>
4141