1 // Autogenerated by the ProtoZero compiler plugin. DO NOT EDIT. 2 3 #ifndef PERFETTO_PROTOS_TRACK_EVENT_PROTO_H_ 4 #define PERFETTO_PROTOS_TRACK_EVENT_PROTO_H_ 5 6 #include <stddef.h> 7 #include <stdint.h> 8 9 #include "perfetto/protozero/message.h" 10 #include "perfetto/protozero/packed_repeated_fields.h" 11 #include "perfetto/protozero/proto_decoder.h" 12 #include "perfetto/protozero/proto_utils.h" 13 14 namespace perfetto { 15 namespace protos { 16 namespace pbzero { 17 18 class ChromeCompositorSchedulerState; 19 class ChromeFrameReporter; 20 class ChromeHistogramSample; 21 class ChromeKeyedService; 22 class ChromeLatencyInfo; 23 class ChromeLegacyIpc; 24 class ChromeMessagePump; 25 class ChromeUserEvent; 26 class DebugAnnotation; 27 class LogMessage; 28 class SourceLocation; 29 class TaskExecution; 30 class TrackEvent_LegacyEvent; 31 enum TrackEvent_LegacyEvent_FlowDirection : int32_t; 32 enum TrackEvent_LegacyEvent_InstantEventScope : int32_t; 33 enum TrackEvent_Type : int32_t; 34 35 enum TrackEvent_Type : int32_t { 36 TrackEvent_Type_TYPE_UNSPECIFIED = 0, 37 TrackEvent_Type_TYPE_SLICE_BEGIN = 1, 38 TrackEvent_Type_TYPE_SLICE_END = 2, 39 TrackEvent_Type_TYPE_INSTANT = 3, 40 TrackEvent_Type_TYPE_COUNTER = 4, 41 }; 42 43 const TrackEvent_Type TrackEvent_Type_MIN = TrackEvent_Type_TYPE_UNSPECIFIED; 44 const TrackEvent_Type TrackEvent_Type_MAX = TrackEvent_Type_TYPE_COUNTER; 45 46 enum TrackEvent_LegacyEvent_FlowDirection : int32_t { 47 TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED = 0, 48 TrackEvent_LegacyEvent_FlowDirection_FLOW_IN = 1, 49 TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT = 2, 50 TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT = 3, 51 }; 52 53 const TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent_FlowDirection_MIN = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED; 54 const TrackEvent_LegacyEvent_FlowDirection TrackEvent_LegacyEvent_FlowDirection_MAX = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT; 55 56 enum TrackEvent_LegacyEvent_InstantEventScope : int32_t { 57 TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED = 0, 58 TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL = 1, 59 TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS = 2, 60 TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD = 3, 61 }; 62 63 const TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent_InstantEventScope_MIN = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED; 64 const TrackEvent_LegacyEvent_InstantEventScope TrackEvent_LegacyEvent_InstantEventScope_MAX = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD; 65 66 class EventName_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { 67 public: EventName_Decoder(const uint8_t * data,size_t len)68 EventName_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} EventName_Decoder(const std::string & raw)69 explicit EventName_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} EventName_Decoder(const::protozero::ConstBytes & raw)70 explicit EventName_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_iid()71 bool has_iid() const { return at<1>().valid(); } iid()72 uint64_t iid() const { return at<1>().as_uint64(); } has_name()73 bool has_name() const { return at<2>().valid(); } name()74 ::protozero::ConstChars name() const { return at<2>().as_string(); } 75 }; 76 77 class EventName : public ::protozero::Message { 78 public: 79 using Decoder = EventName_Decoder; 80 enum : int32_t { 81 kIidFieldNumber = 1, 82 kNameFieldNumber = 2, 83 }; set_iid(uint64_t value)84 void set_iid(uint64_t value) { 85 AppendVarInt(1, value); 86 } set_name(const std::string & value)87 void set_name(const std::string& value) { 88 AppendBytes(2, value.data(), value.size()); 89 } set_name(const char * data,size_t size)90 void set_name(const char* data, size_t size) { 91 AppendBytes(2, data, size); 92 } 93 }; 94 95 class EventCategory_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/2, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { 96 public: EventCategory_Decoder(const uint8_t * data,size_t len)97 EventCategory_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} EventCategory_Decoder(const std::string & raw)98 explicit EventCategory_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} EventCategory_Decoder(const::protozero::ConstBytes & raw)99 explicit EventCategory_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_iid()100 bool has_iid() const { return at<1>().valid(); } iid()101 uint64_t iid() const { return at<1>().as_uint64(); } has_name()102 bool has_name() const { return at<2>().valid(); } name()103 ::protozero::ConstChars name() const { return at<2>().as_string(); } 104 }; 105 106 class EventCategory : public ::protozero::Message { 107 public: 108 using Decoder = EventCategory_Decoder; 109 enum : int32_t { 110 kIidFieldNumber = 1, 111 kNameFieldNumber = 2, 112 }; set_iid(uint64_t value)113 void set_iid(uint64_t value) { 114 AppendVarInt(1, value); 115 } set_name(const std::string & value)116 void set_name(const std::string& value) { 117 AppendBytes(2, value.data(), value.size()); 118 } set_name(const char * data,size_t size)119 void set_name(const char* data, size_t size) { 120 AppendBytes(2, data, size); 121 } 122 }; 123 124 class TrackEventDefaults_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/31, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { 125 public: TrackEventDefaults_Decoder(const uint8_t * data,size_t len)126 TrackEventDefaults_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} TrackEventDefaults_Decoder(const std::string & raw)127 explicit TrackEventDefaults_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} TrackEventDefaults_Decoder(const::protozero::ConstBytes & raw)128 explicit TrackEventDefaults_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_track_uuid()129 bool has_track_uuid() const { return at<11>().valid(); } track_uuid()130 uint64_t track_uuid() const { return at<11>().as_uint64(); } has_extra_counter_track_uuids()131 bool has_extra_counter_track_uuids() const { return at<31>().valid(); } extra_counter_track_uuids()132 ::protozero::RepeatedFieldIterator<uint64_t> extra_counter_track_uuids() const { return GetRepeated<uint64_t>(31); } 133 }; 134 135 class TrackEventDefaults : public ::protozero::Message { 136 public: 137 using Decoder = TrackEventDefaults_Decoder; 138 enum : int32_t { 139 kTrackUuidFieldNumber = 11, 140 kExtraCounterTrackUuidsFieldNumber = 31, 141 }; set_track_uuid(uint64_t value)142 void set_track_uuid(uint64_t value) { 143 AppendVarInt(11, value); 144 } add_extra_counter_track_uuids(uint64_t value)145 void add_extra_counter_track_uuids(uint64_t value) { 146 AppendVarInt(31, value); 147 } 148 }; 149 150 class TrackEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/35, /*HAS_NONPACKED_REPEATED_FIELDS=*/true> { 151 public: TrackEvent_Decoder(const uint8_t * data,size_t len)152 TrackEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} TrackEvent_Decoder(const std::string & raw)153 explicit TrackEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} TrackEvent_Decoder(const::protozero::ConstBytes & raw)154 explicit TrackEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_category_iids()155 bool has_category_iids() const { return at<3>().valid(); } category_iids()156 ::protozero::RepeatedFieldIterator<uint64_t> category_iids() const { return GetRepeated<uint64_t>(3); } has_categories()157 bool has_categories() const { return at<22>().valid(); } categories()158 ::protozero::RepeatedFieldIterator<::protozero::ConstChars> categories() const { return GetRepeated<::protozero::ConstChars>(22); } has_name_iid()159 bool has_name_iid() const { return at<10>().valid(); } name_iid()160 uint64_t name_iid() const { return at<10>().as_uint64(); } has_name()161 bool has_name() const { return at<23>().valid(); } name()162 ::protozero::ConstChars name() const { return at<23>().as_string(); } has_type()163 bool has_type() const { return at<9>().valid(); } type()164 int32_t type() const { return at<9>().as_int32(); } has_track_uuid()165 bool has_track_uuid() const { return at<11>().valid(); } track_uuid()166 uint64_t track_uuid() const { return at<11>().as_uint64(); } has_counter_value()167 bool has_counter_value() const { return at<30>().valid(); } counter_value()168 int64_t counter_value() const { return at<30>().as_int64(); } has_extra_counter_track_uuids()169 bool has_extra_counter_track_uuids() const { return at<31>().valid(); } extra_counter_track_uuids()170 ::protozero::RepeatedFieldIterator<uint64_t> extra_counter_track_uuids() const { return GetRepeated<uint64_t>(31); } has_extra_counter_values()171 bool has_extra_counter_values() const { return at<12>().valid(); } extra_counter_values()172 ::protozero::RepeatedFieldIterator<int64_t> extra_counter_values() const { return GetRepeated<int64_t>(12); } has_debug_annotations()173 bool has_debug_annotations() const { return at<4>().valid(); } debug_annotations()174 ::protozero::RepeatedFieldIterator<::protozero::ConstBytes> debug_annotations() const { return GetRepeated<::protozero::ConstBytes>(4); } has_task_execution()175 bool has_task_execution() const { return at<5>().valid(); } task_execution()176 ::protozero::ConstBytes task_execution() const { return at<5>().as_bytes(); } has_log_message()177 bool has_log_message() const { return at<21>().valid(); } log_message()178 ::protozero::ConstBytes log_message() const { return at<21>().as_bytes(); } has_cc_scheduler_state()179 bool has_cc_scheduler_state() const { return at<24>().valid(); } cc_scheduler_state()180 ::protozero::ConstBytes cc_scheduler_state() const { return at<24>().as_bytes(); } has_chrome_user_event()181 bool has_chrome_user_event() const { return at<25>().valid(); } chrome_user_event()182 ::protozero::ConstBytes chrome_user_event() const { return at<25>().as_bytes(); } has_chrome_keyed_service()183 bool has_chrome_keyed_service() const { return at<26>().valid(); } chrome_keyed_service()184 ::protozero::ConstBytes chrome_keyed_service() const { return at<26>().as_bytes(); } has_chrome_legacy_ipc()185 bool has_chrome_legacy_ipc() const { return at<27>().valid(); } chrome_legacy_ipc()186 ::protozero::ConstBytes chrome_legacy_ipc() const { return at<27>().as_bytes(); } has_chrome_histogram_sample()187 bool has_chrome_histogram_sample() const { return at<28>().valid(); } chrome_histogram_sample()188 ::protozero::ConstBytes chrome_histogram_sample() const { return at<28>().as_bytes(); } has_chrome_latency_info()189 bool has_chrome_latency_info() const { return at<29>().valid(); } chrome_latency_info()190 ::protozero::ConstBytes chrome_latency_info() const { return at<29>().as_bytes(); } has_chrome_frame_reporter()191 bool has_chrome_frame_reporter() const { return at<32>().valid(); } chrome_frame_reporter()192 ::protozero::ConstBytes chrome_frame_reporter() const { return at<32>().as_bytes(); } has_source_location()193 bool has_source_location() const { return at<33>().valid(); } source_location()194 ::protozero::ConstBytes source_location() const { return at<33>().as_bytes(); } has_source_location_iid()195 bool has_source_location_iid() const { return at<34>().valid(); } source_location_iid()196 uint64_t source_location_iid() const { return at<34>().as_uint64(); } has_chrome_message_pump()197 bool has_chrome_message_pump() const { return at<35>().valid(); } chrome_message_pump()198 ::protozero::ConstBytes chrome_message_pump() const { return at<35>().as_bytes(); } has_timestamp_delta_us()199 bool has_timestamp_delta_us() const { return at<1>().valid(); } timestamp_delta_us()200 int64_t timestamp_delta_us() const { return at<1>().as_int64(); } has_timestamp_absolute_us()201 bool has_timestamp_absolute_us() const { return at<16>().valid(); } timestamp_absolute_us()202 int64_t timestamp_absolute_us() const { return at<16>().as_int64(); } has_thread_time_delta_us()203 bool has_thread_time_delta_us() const { return at<2>().valid(); } thread_time_delta_us()204 int64_t thread_time_delta_us() const { return at<2>().as_int64(); } has_thread_time_absolute_us()205 bool has_thread_time_absolute_us() const { return at<17>().valid(); } thread_time_absolute_us()206 int64_t thread_time_absolute_us() const { return at<17>().as_int64(); } has_thread_instruction_count_delta()207 bool has_thread_instruction_count_delta() const { return at<8>().valid(); } thread_instruction_count_delta()208 int64_t thread_instruction_count_delta() const { return at<8>().as_int64(); } has_thread_instruction_count_absolute()209 bool has_thread_instruction_count_absolute() const { return at<20>().valid(); } thread_instruction_count_absolute()210 int64_t thread_instruction_count_absolute() const { return at<20>().as_int64(); } has_legacy_event()211 bool has_legacy_event() const { return at<6>().valid(); } legacy_event()212 ::protozero::ConstBytes legacy_event() const { return at<6>().as_bytes(); } 213 }; 214 215 class TrackEvent : public ::protozero::Message { 216 public: 217 using Decoder = TrackEvent_Decoder; 218 enum : int32_t { 219 kCategoryIidsFieldNumber = 3, 220 kCategoriesFieldNumber = 22, 221 kNameIidFieldNumber = 10, 222 kNameFieldNumber = 23, 223 kTypeFieldNumber = 9, 224 kTrackUuidFieldNumber = 11, 225 kCounterValueFieldNumber = 30, 226 kExtraCounterTrackUuidsFieldNumber = 31, 227 kExtraCounterValuesFieldNumber = 12, 228 kDebugAnnotationsFieldNumber = 4, 229 kTaskExecutionFieldNumber = 5, 230 kLogMessageFieldNumber = 21, 231 kCcSchedulerStateFieldNumber = 24, 232 kChromeUserEventFieldNumber = 25, 233 kChromeKeyedServiceFieldNumber = 26, 234 kChromeLegacyIpcFieldNumber = 27, 235 kChromeHistogramSampleFieldNumber = 28, 236 kChromeLatencyInfoFieldNumber = 29, 237 kChromeFrameReporterFieldNumber = 32, 238 kSourceLocationFieldNumber = 33, 239 kSourceLocationIidFieldNumber = 34, 240 kChromeMessagePumpFieldNumber = 35, 241 kTimestampDeltaUsFieldNumber = 1, 242 kTimestampAbsoluteUsFieldNumber = 16, 243 kThreadTimeDeltaUsFieldNumber = 2, 244 kThreadTimeAbsoluteUsFieldNumber = 17, 245 kThreadInstructionCountDeltaFieldNumber = 8, 246 kThreadInstructionCountAbsoluteFieldNumber = 20, 247 kLegacyEventFieldNumber = 6, 248 }; 249 using LegacyEvent = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent; 250 using Type = ::perfetto::protos::pbzero::TrackEvent_Type; 251 static const Type TYPE_UNSPECIFIED = TrackEvent_Type_TYPE_UNSPECIFIED; 252 static const Type TYPE_SLICE_BEGIN = TrackEvent_Type_TYPE_SLICE_BEGIN; 253 static const Type TYPE_SLICE_END = TrackEvent_Type_TYPE_SLICE_END; 254 static const Type TYPE_INSTANT = TrackEvent_Type_TYPE_INSTANT; 255 static const Type TYPE_COUNTER = TrackEvent_Type_TYPE_COUNTER; add_category_iids(uint64_t value)256 void add_category_iids(uint64_t value) { 257 AppendVarInt(3, value); 258 } add_categories(const std::string & value)259 void add_categories(const std::string& value) { 260 AppendBytes(22, value.data(), value.size()); 261 } add_categories(const char * data,size_t size)262 void add_categories(const char* data, size_t size) { 263 AppendBytes(22, data, size); 264 } set_name_iid(uint64_t value)265 void set_name_iid(uint64_t value) { 266 AppendVarInt(10, value); 267 } set_name(const std::string & value)268 void set_name(const std::string& value) { 269 AppendBytes(23, value.data(), value.size()); 270 } set_name(const char * data,size_t size)271 void set_name(const char* data, size_t size) { 272 AppendBytes(23, data, size); 273 } set_type(::perfetto::protos::pbzero::TrackEvent_Type value)274 void set_type(::perfetto::protos::pbzero::TrackEvent_Type value) { 275 AppendTinyVarInt(9, value); 276 } set_track_uuid(uint64_t value)277 void set_track_uuid(uint64_t value) { 278 AppendVarInt(11, value); 279 } set_counter_value(int64_t value)280 void set_counter_value(int64_t value) { 281 AppendVarInt(30, value); 282 } add_extra_counter_track_uuids(uint64_t value)283 void add_extra_counter_track_uuids(uint64_t value) { 284 AppendVarInt(31, value); 285 } add_extra_counter_values(int64_t value)286 void add_extra_counter_values(int64_t value) { 287 AppendVarInt(12, value); 288 } add_debug_annotations()289 template <typename T = DebugAnnotation> T* add_debug_annotations() { 290 return BeginNestedMessage<T>(4); 291 } 292 set_task_execution()293 template <typename T = TaskExecution> T* set_task_execution() { 294 return BeginNestedMessage<T>(5); 295 } 296 set_log_message()297 template <typename T = LogMessage> T* set_log_message() { 298 return BeginNestedMessage<T>(21); 299 } 300 set_cc_scheduler_state()301 template <typename T = ChromeCompositorSchedulerState> T* set_cc_scheduler_state() { 302 return BeginNestedMessage<T>(24); 303 } 304 set_chrome_user_event()305 template <typename T = ChromeUserEvent> T* set_chrome_user_event() { 306 return BeginNestedMessage<T>(25); 307 } 308 set_chrome_keyed_service()309 template <typename T = ChromeKeyedService> T* set_chrome_keyed_service() { 310 return BeginNestedMessage<T>(26); 311 } 312 set_chrome_legacy_ipc()313 template <typename T = ChromeLegacyIpc> T* set_chrome_legacy_ipc() { 314 return BeginNestedMessage<T>(27); 315 } 316 set_chrome_histogram_sample()317 template <typename T = ChromeHistogramSample> T* set_chrome_histogram_sample() { 318 return BeginNestedMessage<T>(28); 319 } 320 set_chrome_latency_info()321 template <typename T = ChromeLatencyInfo> T* set_chrome_latency_info() { 322 return BeginNestedMessage<T>(29); 323 } 324 set_chrome_frame_reporter()325 template <typename T = ChromeFrameReporter> T* set_chrome_frame_reporter() { 326 return BeginNestedMessage<T>(32); 327 } 328 set_source_location()329 template <typename T = SourceLocation> T* set_source_location() { 330 return BeginNestedMessage<T>(33); 331 } 332 set_source_location_iid(uint64_t value)333 void set_source_location_iid(uint64_t value) { 334 AppendVarInt(34, value); 335 } set_chrome_message_pump()336 template <typename T = ChromeMessagePump> T* set_chrome_message_pump() { 337 return BeginNestedMessage<T>(35); 338 } 339 set_timestamp_delta_us(int64_t value)340 void set_timestamp_delta_us(int64_t value) { 341 AppendVarInt(1, value); 342 } set_timestamp_absolute_us(int64_t value)343 void set_timestamp_absolute_us(int64_t value) { 344 AppendVarInt(16, value); 345 } set_thread_time_delta_us(int64_t value)346 void set_thread_time_delta_us(int64_t value) { 347 AppendVarInt(2, value); 348 } set_thread_time_absolute_us(int64_t value)349 void set_thread_time_absolute_us(int64_t value) { 350 AppendVarInt(17, value); 351 } set_thread_instruction_count_delta(int64_t value)352 void set_thread_instruction_count_delta(int64_t value) { 353 AppendVarInt(8, value); 354 } set_thread_instruction_count_absolute(int64_t value)355 void set_thread_instruction_count_absolute(int64_t value) { 356 AppendVarInt(20, value); 357 } set_legacy_event()358 template <typename T = TrackEvent_LegacyEvent> T* set_legacy_event() { 359 return BeginNestedMessage<T>(6); 360 } 361 362 }; 363 364 class TrackEvent_LegacyEvent_Decoder : public ::protozero::TypedProtoDecoder</*MAX_FIELD_ID=*/19, /*HAS_NONPACKED_REPEATED_FIELDS=*/false> { 365 public: TrackEvent_LegacyEvent_Decoder(const uint8_t * data,size_t len)366 TrackEvent_LegacyEvent_Decoder(const uint8_t* data, size_t len) : TypedProtoDecoder(data, len) {} TrackEvent_LegacyEvent_Decoder(const std::string & raw)367 explicit TrackEvent_LegacyEvent_Decoder(const std::string& raw) : TypedProtoDecoder(reinterpret_cast<const uint8_t*>(raw.data()), raw.size()) {} TrackEvent_LegacyEvent_Decoder(const::protozero::ConstBytes & raw)368 explicit TrackEvent_LegacyEvent_Decoder(const ::protozero::ConstBytes& raw) : TypedProtoDecoder(raw.data, raw.size) {} has_name_iid()369 bool has_name_iid() const { return at<1>().valid(); } name_iid()370 uint64_t name_iid() const { return at<1>().as_uint64(); } has_phase()371 bool has_phase() const { return at<2>().valid(); } phase()372 int32_t phase() const { return at<2>().as_int32(); } has_duration_us()373 bool has_duration_us() const { return at<3>().valid(); } duration_us()374 int64_t duration_us() const { return at<3>().as_int64(); } has_thread_duration_us()375 bool has_thread_duration_us() const { return at<4>().valid(); } thread_duration_us()376 int64_t thread_duration_us() const { return at<4>().as_int64(); } has_thread_instruction_delta()377 bool has_thread_instruction_delta() const { return at<15>().valid(); } thread_instruction_delta()378 int64_t thread_instruction_delta() const { return at<15>().as_int64(); } has_unscoped_id()379 bool has_unscoped_id() const { return at<6>().valid(); } unscoped_id()380 uint64_t unscoped_id() const { return at<6>().as_uint64(); } has_local_id()381 bool has_local_id() const { return at<10>().valid(); } local_id()382 uint64_t local_id() const { return at<10>().as_uint64(); } has_global_id()383 bool has_global_id() const { return at<11>().valid(); } global_id()384 uint64_t global_id() const { return at<11>().as_uint64(); } has_id_scope()385 bool has_id_scope() const { return at<7>().valid(); } id_scope()386 ::protozero::ConstChars id_scope() const { return at<7>().as_string(); } has_use_async_tts()387 bool has_use_async_tts() const { return at<9>().valid(); } use_async_tts()388 bool use_async_tts() const { return at<9>().as_bool(); } has_bind_id()389 bool has_bind_id() const { return at<8>().valid(); } bind_id()390 uint64_t bind_id() const { return at<8>().as_uint64(); } has_bind_to_enclosing()391 bool has_bind_to_enclosing() const { return at<12>().valid(); } bind_to_enclosing()392 bool bind_to_enclosing() const { return at<12>().as_bool(); } has_flow_direction()393 bool has_flow_direction() const { return at<13>().valid(); } flow_direction()394 int32_t flow_direction() const { return at<13>().as_int32(); } has_instant_event_scope()395 bool has_instant_event_scope() const { return at<14>().valid(); } instant_event_scope()396 int32_t instant_event_scope() const { return at<14>().as_int32(); } has_pid_override()397 bool has_pid_override() const { return at<18>().valid(); } pid_override()398 int32_t pid_override() const { return at<18>().as_int32(); } has_tid_override()399 bool has_tid_override() const { return at<19>().valid(); } tid_override()400 int32_t tid_override() const { return at<19>().as_int32(); } 401 }; 402 403 class TrackEvent_LegacyEvent : public ::protozero::Message { 404 public: 405 using Decoder = TrackEvent_LegacyEvent_Decoder; 406 enum : int32_t { 407 kNameIidFieldNumber = 1, 408 kPhaseFieldNumber = 2, 409 kDurationUsFieldNumber = 3, 410 kThreadDurationUsFieldNumber = 4, 411 kThreadInstructionDeltaFieldNumber = 15, 412 kUnscopedIdFieldNumber = 6, 413 kLocalIdFieldNumber = 10, 414 kGlobalIdFieldNumber = 11, 415 kIdScopeFieldNumber = 7, 416 kUseAsyncTtsFieldNumber = 9, 417 kBindIdFieldNumber = 8, 418 kBindToEnclosingFieldNumber = 12, 419 kFlowDirectionFieldNumber = 13, 420 kInstantEventScopeFieldNumber = 14, 421 kPidOverrideFieldNumber = 18, 422 kTidOverrideFieldNumber = 19, 423 }; 424 using FlowDirection = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection; 425 using InstantEventScope = ::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope; 426 static const FlowDirection FLOW_UNSPECIFIED = TrackEvent_LegacyEvent_FlowDirection_FLOW_UNSPECIFIED; 427 static const FlowDirection FLOW_IN = TrackEvent_LegacyEvent_FlowDirection_FLOW_IN; 428 static const FlowDirection FLOW_OUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_OUT; 429 static const FlowDirection FLOW_INOUT = TrackEvent_LegacyEvent_FlowDirection_FLOW_INOUT; 430 static const InstantEventScope SCOPE_UNSPECIFIED = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_UNSPECIFIED; 431 static const InstantEventScope SCOPE_GLOBAL = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_GLOBAL; 432 static const InstantEventScope SCOPE_PROCESS = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_PROCESS; 433 static const InstantEventScope SCOPE_THREAD = TrackEvent_LegacyEvent_InstantEventScope_SCOPE_THREAD; set_name_iid(uint64_t value)434 void set_name_iid(uint64_t value) { 435 AppendVarInt(1, value); 436 } set_phase(int32_t value)437 void set_phase(int32_t value) { 438 AppendVarInt(2, value); 439 } set_duration_us(int64_t value)440 void set_duration_us(int64_t value) { 441 AppendVarInt(3, value); 442 } set_thread_duration_us(int64_t value)443 void set_thread_duration_us(int64_t value) { 444 AppendVarInt(4, value); 445 } set_thread_instruction_delta(int64_t value)446 void set_thread_instruction_delta(int64_t value) { 447 AppendVarInt(15, value); 448 } set_unscoped_id(uint64_t value)449 void set_unscoped_id(uint64_t value) { 450 AppendVarInt(6, value); 451 } set_local_id(uint64_t value)452 void set_local_id(uint64_t value) { 453 AppendVarInt(10, value); 454 } set_global_id(uint64_t value)455 void set_global_id(uint64_t value) { 456 AppendVarInt(11, value); 457 } set_id_scope(const std::string & value)458 void set_id_scope(const std::string& value) { 459 AppendBytes(7, value.data(), value.size()); 460 } set_id_scope(const char * data,size_t size)461 void set_id_scope(const char* data, size_t size) { 462 AppendBytes(7, data, size); 463 } set_use_async_tts(bool value)464 void set_use_async_tts(bool value) { 465 AppendTinyVarInt(9, value); 466 } set_bind_id(uint64_t value)467 void set_bind_id(uint64_t value) { 468 AppendVarInt(8, value); 469 } set_bind_to_enclosing(bool value)470 void set_bind_to_enclosing(bool value) { 471 AppendTinyVarInt(12, value); 472 } set_flow_direction(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection value)473 void set_flow_direction(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_FlowDirection value) { 474 AppendTinyVarInt(13, value); 475 } set_instant_event_scope(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope value)476 void set_instant_event_scope(::perfetto::protos::pbzero::TrackEvent_LegacyEvent_InstantEventScope value) { 477 AppendTinyVarInt(14, value); 478 } set_pid_override(int32_t value)479 void set_pid_override(int32_t value) { 480 AppendVarInt(18, value); 481 } set_tid_override(int32_t value)482 void set_tid_override(int32_t value) { 483 AppendVarInt(19, value); 484 } 485 }; 486 487 } // Namespace. 488 } // Namespace. 489 } // Namespace. 490 #endif // Include guard. 491