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

Unified Diff: base/trace_event/trace_log.cc

Issue 1675183006: tracing: add dump provider for malloc heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@shim_layer_linux
Patch Set: ssid review Created 4 years, 9 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_log.cc
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc
index dcedb4477563028eb2510c4a1430800d35b5bcb5..3b1d2c9bb2f5dc5ca05100010a96ac6e07bdcfd5 100644
--- a/base/trace_event/trace_log.cc
+++ b/base/trace_event/trace_log.cc
@@ -1318,12 +1318,14 @@ TraceEventHandle TraceLog::AddTraceEventWithThreadIdAndTimestamp(
if (!(flags & TRACE_EVENT_FLAG_COPY)) {
if (AllocationContextTracker::capture_enabled()) {
if (phase == TRACE_EVENT_PHASE_BEGIN ||
- phase == TRACE_EVENT_PHASE_COMPLETE)
- AllocationContextTracker::PushPseudoStackFrame(name);
- else if (phase == TRACE_EVENT_PHASE_END)
+ phase == TRACE_EVENT_PHASE_COMPLETE) {
+ AllocationContextTracker::GetInstanceForCurrentThread()
+ ->PushPseudoStackFrame(name);
+ } else if (phase == TRACE_EVENT_PHASE_END)
// The pop for |TRACE_EVENT_PHASE_COMPLETE| events
// is in |TraceLog::UpdateTraceEventDuration|.
- AllocationContextTracker::PopPseudoStackFrame(name);
+ AllocationContextTracker::GetInstanceForCurrentThread()
+ ->PopPseudoStackFrame(name);
}
}
@@ -1447,7 +1449,8 @@ void TraceLog::UpdateTraceEventDuration(
if (base::trace_event::AllocationContextTracker::capture_enabled()) {
// The corresponding push is in |AddTraceEventWithThreadIdAndTimestamp|.
- base::trace_event::AllocationContextTracker::PopPseudoStackFrame(name);
+ base::trace_event::AllocationContextTracker::GetInstanceForCurrentThread()
+ ->PopPseudoStackFrame(name);
}
}

Powered by Google App Engine
This is Rietveld 408576698