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

Unified Diff: base/trace_event/heap_profiler_allocation_context_tracker.h

Issue 1784133002: [tracing] Adding task information to heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: use SetThreadName function. 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 83912ce3cc232434fa2c937d9e21a958152b9c61..93cd110ffba943f7501493a1b2916887b05af804 100644
--- a/base/trace_event/heap_profiler_allocation_context_tracker.h
+++ b/base/trace_event/heap_profiler_allocation_context_tracker.h
@@ -61,6 +61,13 @@ class BASE_EXPORT AllocationContextTracker {
// Pops a frame from the thread-local pseudo stack.
static void PopPseudoStackFrame(StackFrame frame);
+ // Pushes the thread name as the first entry in the pseudo stack.
+ static void SetThreadName(const char* name);
+
+ // Sets the file name where the current task on thread is posted from. This is
+ // used to categorize theallocations by source path.
+ static void SetCurrentTaskFileName(const char* file_name);
+
// Returns a snapshot of the current thread-local context.
static AllocationContext GetContextSnapshot();
@@ -76,6 +83,9 @@ class BASE_EXPORT AllocationContextTracker {
// The pseudo stack where frames are |TRACE_EVENT| names.
std::vector<StackFrame> pseudo_stack_;
+ // Name of the file from which the current task is posted from.
+ const char* current_task_file_name_;
+
DISALLOW_COPY_AND_ASSIGN(AllocationContextTracker);
};

Powered by Google App Engine
This is Rietveld 408576698