OLD | NEW |
---|---|
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_EVENT_H_ |
6 #define BASE_TRACE_EVENT_TRACE_EVENT_H_ | 6 #define BASE_TRACE_EVENT_TRACE_EVENT_H_ |
7 | 7 |
8 // This header file defines implementation details of how the trace macros in | 8 // This header file defines implementation details of how the trace macros in |
9 // trace_event_common.h collect and store trace events. Anything not | 9 // trace_event_common.h collect and store trace events. Anything not |
10 // implementation-specific should go in trace_event_common.h instead of here. | 10 // implementation-specific should go in trace_event_common.h instead of here. |
(...skipping 331 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
342 &trace_event_flags); \ | 342 &trace_event_flags); \ |
343 trace_event_internal::AddTraceEventWithThreadIdAndTimestamp( \ | 343 trace_event_internal::AddTraceEventWithThreadIdAndTimestamp( \ |
344 phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ | 344 phase, INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ |
345 trace_event_trace_id.scope(), trace_event_trace_id.raw_id(), \ | 345 trace_event_trace_id.scope(), trace_event_trace_id.raw_id(), \ |
346 thread_id, base::TimeTicks::FromInternalValue(timestamp), \ | 346 thread_id, base::TimeTicks::FromInternalValue(timestamp), \ |
347 trace_event_flags | TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP, \ | 347 trace_event_flags | TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP, \ |
348 trace_event_internal::kNoId, ##__VA_ARGS__); \ | 348 trace_event_internal::kNoId, ##__VA_ARGS__); \ |
349 } \ | 349 } \ |
350 } while (0) | 350 } while (0) |
351 | 351 |
352 // The trace ID and bind ID will never be mangled by this macro. | |
353 #define INTERNAL_TRACE_EVENT_ADD_BIND_IDS(category_group, name, id, bind_id, \ | |
354 ...) \ | |
355 do { \ | |
356 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ | |
357 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ | |
358 unsigned int dummy_flags = TRACE_EVENT_FLAG_NONE; \ | |
359 trace_event_internal::TraceID trace_event_trace_id(id, &dummy_flags); \ | |
Primiano Tucci (use gerrit)
2016/07/20 16:39:04
I think you don't need dummy_flags here and just u
chiniforooshan
2016/07/20 18:41:36
Done.
| |
360 trace_event_internal::TraceID trace_event_bind_id( \ | |
Primiano Tucci (use gerrit)
2016/07/20 16:39:04
maybe calling these vars "source_id" and "target_i
chiniforooshan
2016/07/20 18:41:36
Done.
| |
361 bind_id, &dummy_flags); \ | |
362 if (trace_event_bind_id.scope() == \ | |
363 trace_event_internal::kGlobalScope) { \ | |
364 trace_event_internal::AddTraceEvent( \ | |
365 TRACE_EVENT_PHASE_BIND_IDS, \ | |
366 INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ | |
367 name, trace_event_trace_id.scope(), \ | |
368 trace_event_trace_id.raw_id(), \ | |
369 TRACE_EVENT_FLAG_HAS_ID, trace_event_bind_id.raw_id(), \ | |
370 ##__VA_ARGS__); \ | |
371 } else { \ | |
372 trace_event_internal::AddTraceEvent( \ | |
373 TRACE_EVENT_PHASE_BIND_IDS, \ | |
374 INTERNAL_TRACE_EVENT_UID(category_group_enabled), \ | |
375 name, trace_event_trace_id.scope(), \ | |
376 trace_event_trace_id.raw_id(), \ | |
377 TRACE_EVENT_FLAG_HAS_ID, trace_event_bind_id.raw_id(), \ | |
378 "bind_scope", trace_event_bind_id.scope(), ##__VA_ARGS__); \ | |
Primiano Tucci (use gerrit)
2016/07/20 16:39:04
same here, I'd call this arg "target_scope" or "ta
chiniforooshan
2016/07/20 18:41:36
I changed the local variable names to {source, tar
| |
379 } \ | |
380 } \ | |
381 } while (0) | |
382 | |
352 // Implementation detail: internal macro to create static category and add | 383 // Implementation detail: internal macro to create static category and add |
353 // metadata event if the category is enabled. | 384 // metadata event if the category is enabled. |
354 #define INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, ...) \ | 385 #define INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, ...) \ |
355 do { \ | 386 do { \ |
356 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ | 387 INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \ |
357 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ | 388 if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \ |
358 TRACE_EVENT_API_ADD_METADATA_EVENT( \ | 389 TRACE_EVENT_API_ADD_METADATA_EVENT( \ |
359 INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ | 390 INTERNAL_TRACE_EVENT_UID(category_group_enabled), name, \ |
360 ##__VA_ARGS__); \ | 391 ##__VA_ARGS__); \ |
361 } \ | 392 } \ |
(...skipping 721 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
1083 const char* name_; | 1114 const char* name_; |
1084 IDType id_; | 1115 IDType id_; |
1085 | 1116 |
1086 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); | 1117 DISALLOW_COPY_AND_ASSIGN(TraceScopedTrackableObject); |
1087 }; | 1118 }; |
1088 | 1119 |
1089 } // namespace trace_event | 1120 } // namespace trace_event |
1090 } // namespace base | 1121 } // namespace base |
1091 | 1122 |
1092 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ | 1123 #endif // BASE_TRACE_EVENT_TRACE_EVENT_H_ |
OLD | NEW |