| 370 | |
| 371 | template <typename T> |
| 372 | void InitializeMetadataEvent(TraceEvent* trace_event, |
| 373 | int thread_id, |
| 374 | const char* metadata_name, const char* arg_name, |
| 375 | const T& value) { |
| 376 | if (!trace_event) |
| 377 | return; |
| 378 | |
| 379 | int num_args = 1; |
| 380 | unsigned char arg_type; |
| 381 | uint64_t arg_value; |
| 382 | ::trace_event_internal::SetTraceValue(value, &arg_type, &arg_value); |
| 383 | trace_event->Initialize(thread_id, |
| 384 | MicrosecondsInt64(0), MicrosecondsInt64(0), TRACE_EVENT_PHASE_METADATA, |
| 385 | &g_category_group_enabled[kCategoryMetadata], |
| 386 | metadata_name, ::trace_event_internal::kNoEventId, |
| 387 | num_args, &arg_name, &arg_type, &arg_value, nullptr, |
| 388 | TRACE_EVENT_FLAG_NONE); |
| 389 | } |
| 390 | |
| 391 | // RAII object which marks '*dst' with a non-zero value while in scope. |
| 392 | // This assumes that no other threads write to '*dst'. |
no test coverage detected