Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1169)

Unified Diff: base/trace_event/trace_event.h

Issue 2142023003: Binds two IDs together. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: unit tests + inline documentation Created 4 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « base/trace_event/common/trace_event_common.h ('k') | base/trace_event/trace_event_impl.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event.h
diff --git a/base/trace_event/trace_event.h b/base/trace_event/trace_event.h
index faaccac8eaf34b40ff91b81e633df44246266a6a..eca429ac128707ad66dfde1c84c6f8d1820f4c88 100644
--- a/base/trace_event/trace_event.h
+++ b/base/trace_event/trace_event.h
@@ -349,6 +349,37 @@ TRACE_EVENT_API_CLASS_EXPORT extern \
} \
} while (0)
+// The trace ID and bind ID will never be mangled by this macro.
+#define INTERNAL_TRACE_EVENT_ADD_BIND_IDS(category_group, name, id, bind_id, \
+ ...) \
+ do { \
+ INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
+ if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \
+ unsigned int dummy_flags = TRACE_EVENT_FLAG_NONE; \
+ 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.
+ 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.
+ bind_id, &dummy_flags); \
+ if (trace_event_bind_id.scope() == \
+ trace_event_internal::kGlobalScope) { \
+ trace_event_internal::AddTraceEvent( \
+ TRACE_EVENT_PHASE_BIND_IDS, \
+ INTERNAL_TRACE_EVENT_UID(category_group_enabled), \
+ name, trace_event_trace_id.scope(), \
+ trace_event_trace_id.raw_id(), \
+ TRACE_EVENT_FLAG_HAS_ID, trace_event_bind_id.raw_id(), \
+ ##__VA_ARGS__); \
+ } else { \
+ trace_event_internal::AddTraceEvent( \
+ TRACE_EVENT_PHASE_BIND_IDS, \
+ INTERNAL_TRACE_EVENT_UID(category_group_enabled), \
+ name, trace_event_trace_id.scope(), \
+ trace_event_trace_id.raw_id(), \
+ TRACE_EVENT_FLAG_HAS_ID, trace_event_bind_id.raw_id(), \
+ "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
+ } \
+ } \
+ } while (0)
+
// Implementation detail: internal macro to create static category and add
// metadata event if the category is enabled.
#define INTERNAL_TRACE_EVENT_METADATA_ADD(category_group, name, ...) \
« no previous file with comments | « base/trace_event/common/trace_event_common.h ('k') | base/trace_event/trace_event_impl.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698