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

Unified Diff: base/trace_event/heap_profiler_allocation_context_tracker.h

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/heap_profiler_allocation_context_tracker.h
diff --git a/base/trace_event/heap_profiler_allocation_context_tracker.h b/base/trace_event/heap_profiler_allocation_context_tracker.h
index 9c9a3132abab1e395a94d5632dc253845f43efa4..20a6e3015d647aaad1272e3c36cc03e93d2c8eb6 100644
--- a/base/trace_event/heap_profiler_allocation_context_tracker.h
+++ b/base/trace_event/heap_profiler_allocation_context_tracker.h
@@ -43,22 +43,25 @@ class BASE_EXPORT AllocationContextTracker {
return subtle::Acquire_Load(&capture_enabled_) != 0;
}
+ // Returns the thread-local instance, creating one if necessary. Returns
+ // always a valid instance, unless it is called re-entrantly, in which case
+ // returns nullptr in the nested calls.
+ static AllocationContextTracker* GetInstanceForCurrentThread();
+
// Pushes a frame onto the thread-local pseudo stack.
- static void PushPseudoStackFrame(StackFrame frame);
+ void PushPseudoStackFrame(StackFrame frame);
// Pops a frame from the thread-local pseudo stack.
- static void PopPseudoStackFrame(StackFrame frame);
+ void PopPseudoStackFrame(StackFrame frame);
// Returns a snapshot of the current thread-local context.
- static AllocationContext GetContextSnapshot();
+ AllocationContext GetContextSnapshot();
~AllocationContextTracker();
private:
AllocationContextTracker();
- static AllocationContextTracker* GetThreadLocalTracker();
-
static subtle::Atomic32 capture_enabled_;
// The pseudo stack where frames are |TRACE_EVENT| names.

Powered by Google App Engine
This is Rietveld 408576698