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

Unified Diff: base/trace_event/trace_log.cc

Issue 2272843002: Heap Profiler: Add trace category group names as type names for allocations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@add_filter
Patch Set: Rebase. Created 4 years, 4 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 6dca8fafb25163a51d09977d679162dae3d9f9c2..17171822be487420632f9682ea53bfe27ffc019e 100644
--- a/base/trace_event/trace_log.cc
+++ b/base/trace_event/trace_log.cc
@@ -151,14 +151,16 @@ class HeapProfilerFilter : public TraceLog::TraceEventFilter {
if (trace_event.flags() & TRACE_EVENT_FLAG_COPY)
return true;
+ const char* category_name =
+ TraceLog::GetCategoryGroupName(trace_event.category_group_enabled());
if (trace_event.phase() == TRACE_EVENT_PHASE_BEGIN ||
trace_event.phase() == TRACE_EVENT_PHASE_COMPLETE) {
AllocationContextTracker::GetInstanceForCurrentThread()
- ->PushPseudoStackFrame(trace_event.name());
+ ->PushPseudoStackFrame(category_name, trace_event.name());
} else if (trace_event.phase() == TRACE_EVENT_PHASE_END) {
// The pop for |TRACE_EVENT_PHASE_COMPLETE| events is in |EndEvent|.
AllocationContextTracker::GetInstanceForCurrentThread()
- ->PopPseudoStackFrame(trace_event.name());
+ ->PopPseudoStackFrame(category_name, trace_event.name());
}
// Do not filter-out any events and always return true. TraceLog adds the
// event only if it is enabled for recording.
@@ -169,7 +171,7 @@ class HeapProfilerFilter : public TraceLog::TraceEventFilter {
if (AllocationContextTracker::capture_mode() ==
AllocationContextTracker::CaptureMode::PSEUDO_STACK) {
AllocationContextTracker::GetInstanceForCurrentThread()
- ->PopPseudoStackFrame(name);
+ ->PopPseudoStackFrame(category_group, name);
}
}
};

Powered by Google App Engine
This is Rietveld 408576698