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

Unified Diff: base/trace_event/trace_event.h

Issue 2381083003: The TRACE_LINK_IDS macro (Closed)
Patch Set: comments Created 4 years, 2 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
Index: base/trace_event/trace_event.h
diff --git a/base/trace_event/trace_event.h b/base/trace_event/trace_event.h
index 4de64837161fded5fd176d1dc5136006d8521a9e..8ff054f0ba307ca033e3d4de5be5878b424c67a5 100644
--- a/base/trace_event/trace_event.h
+++ b/base/trace_event/trace_event.h
@@ -376,29 +376,20 @@ TRACE_EVENT_API_CLASS_EXPORT extern \
} \
} while (0)
-// This macro ignores whether the bind_id is local, global, or mangled.
-#define INTERNAL_TRACE_EVENT_ADD_BIND_IDS(category_group, name, id, bind_id, \
- ...) \
+// The linked ID will not be mangled.
+#define INTERNAL_TRACE_EVENT_ADD_LINK_IDS(category_group, name, id1, id2) \
do { \
INTERNAL_TRACE_EVENT_GET_CATEGORY_INFO(category_group); \
if (INTERNAL_TRACE_EVENT_CATEGORY_GROUP_ENABLED_FOR_RECORDING_MODE()) { \
- trace_event_internal::TraceID source_id((id)); \
+ trace_event_internal::TraceID source_id((id1)); \
unsigned int source_flags = source_id.id_flags(); \
- trace_event_internal::TraceID target_id((bind_id)); \
- if (target_id.scope() == trace_event_internal::kGlobalScope) { \
- trace_event_internal::AddTraceEvent( \
- TRACE_EVENT_PHASE_BIND_IDS, \
- INTERNAL_TRACE_EVENT_UID(category_group_enabled), \
- name, source_id.scope(), source_id.raw_id(), \
- source_flags, target_id.raw_id(), ##__VA_ARGS__); \
- } else { \
- trace_event_internal::AddTraceEvent( \
- TRACE_EVENT_PHASE_BIND_IDS, \
- INTERNAL_TRACE_EVENT_UID(category_group_enabled), \
- name, source_id.scope(), source_id.raw_id(), \
- source_flags, target_id.raw_id(), \
- "bind_scope", target_id.scope(), ##__VA_ARGS__); \
- } \
+ trace_event_internal::TraceID target_id((id2)); \
+ trace_event_internal::AddTraceEvent( \
+ TRACE_EVENT_PHASE_LINK_IDS, \
+ INTERNAL_TRACE_EVENT_UID(category_group_enabled), \
+ name, source_id.scope(), source_id.raw_id(), source_flags, \
+ trace_event_internal::kNoId, \
+ "linked_id", target_id.AsConvertableToTraceFormat()); \
} \
} while (0)
@@ -582,6 +573,9 @@ class TraceID {
const char* scope() const { return scope_; }
unsigned int id_flags() const { return id_flags_; }
+ std::unique_ptr<base::trace_event::ConvertableToTraceFormat>
+ AsConvertableToTraceFormat() const;
+
private:
const char* scope_ = nullptr;
unsigned long long raw_id_;

Powered by Google App Engine
This is Rietveld 408576698