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

Unified Diff: base/trace_event/trace_event_impl.cc

Issue 994133002: Generate globally (cross-process) unique IDs for memory tracing dumps (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Made changes. Created 5 years, 8 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/trace_event_impl.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_event_impl.cc
diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc
index 834f826e04078dae5b992276b986a1581f6a1037..f312c71dfaed3ad865267dee19ae3275d4dcb0bc 100644
--- a/base/trace_event/trace_event_impl.cc
+++ b/base/trace_event/trace_event_impl.cc
@@ -1921,7 +1921,7 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp(
DCHECK(!timestamp.is_null());
if (flags & TRACE_EVENT_FLAG_MANGLE_ID)
- id ^= process_id_hash_;
+ id = MangleEventId(id);
TimeTicks offset_event_timestamp = OffsetTimestamp(timestamp);
TimeTicks now = flags & TRACE_EVENT_FLAG_EXPLICIT_TIMESTAMP ?
@@ -2190,6 +2190,10 @@ void TraceLog::CancelWatchEvent() {
watch_event_callback_.Reset();
}
+uint64 TraceLog::MangleEventId(uint64 id) {
+ return id ^ process_id_hash_;
+}
+
void TraceLog::AddMetadataEventsWhileLocked() {
lock_.AssertAcquired();
« no previous file with comments | « base/trace_event/trace_event_impl.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698