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

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: use substr and build fix. Created 4 years, 3 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
« no previous file with comments | « base/trace_event/heap_profiler_type_name_deduplicator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/trace_log.cc
diff --git a/base/trace_event/trace_log.cc b/base/trace_event/trace_log.cc
index 2e2f8b969a54c6379ad95192dda653c8f82d2f77..1a9af140551254bf6111c54ed4fb2a55d2e50121 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});
}
}
};
« no previous file with comments | « base/trace_event/heap_profiler_type_name_deduplicator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698