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

Unified Diff: base/trace_event/heap_profiler_allocation_context_tracker.h

Issue 1814083002: [tracing] Add thread name to the pseudo stack of heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@profiler
Patch Set: rebase. 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 20a6e3015d647aaad1272e3c36cc03e93d2c8eb6..5d32c64952266475fcb440476febf208f618a39f 100644
--- a/base/trace_event/heap_profiler_allocation_context_tracker.h
+++ b/base/trace_event/heap_profiler_allocation_context_tracker.h
@@ -48,6 +48,10 @@ class BASE_EXPORT AllocationContextTracker {
// returns nullptr in the nested calls.
static AllocationContextTracker* GetInstanceForCurrentThread();
+ // Set the thread name in the AllocationContextTracker of current thread if
petrcermak 2016/03/29 13:07:46 nit: s/current/the current/
ssid 2016/03/29 18:19:11 Done.
+ // capture is enabled.
+ static void SetCurrentThreadName(const char* name);
+
// Pushes a frame onto the thread-local pseudo stack.
void PushPseudoStackFrame(StackFrame frame);
@@ -67,6 +71,9 @@ class BASE_EXPORT AllocationContextTracker {
// The pseudo stack where frames are |TRACE_EVENT| names.
std::vector<StackFrame> pseudo_stack_;
+ // The thread name is used as the first entry in the pseudo stack.
+ const char* thread_name_;
+
DISALLOW_COPY_AND_ASSIGN(AllocationContextTracker);
};

Powered by Google App Engine
This is Rietveld 408576698