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

Unified Diff: base/trace_event/heap_profiler_allocation_context_tracker.h

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 | « no previous file | base/trace_event/heap_profiler_allocation_context_tracker.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 454200c474ee32be54c15e234cfa1753a8e580ce..ae5f73af432bc9ecfb4aa87c8734238176490fe3 100644
--- a/base/trace_event/heap_profiler_allocation_context_tracker.h
+++ b/base/trace_event/heap_profiler_allocation_context_tracker.h
@@ -10,7 +10,6 @@
#include "base/atomicops.h"
#include "base/base_export.h"
#include "base/debug/stack_trace.h"
-#include "base/logging.h"
#include "base/macros.h"
#include "base/trace_event/heap_profiler_allocation_context.h"
@@ -30,6 +29,17 @@ class BASE_EXPORT AllocationContextTracker {
NATIVE_STACK // GetContextSnapshot() returns native (real) stack trace
};
+ // Stack frame constructed from trace events in codebase.
+ struct BASE_EXPORT PseudoStackFrame {
+ const char* trace_event_category;
+ const char* trace_event_name;
+
+ bool operator==(const PseudoStackFrame& other) const {
+ return trace_event_category == other.trace_event_category &&
+ trace_event_name == other.trace_event_name;
+ }
+ };
+
// Globally sets capturing mode.
// TODO(primiano): How to guard against *_STACK -> DISABLED -> *_STACK?
static void SetCaptureMode(CaptureMode mode);
@@ -69,10 +79,10 @@ class BASE_EXPORT AllocationContextTracker {
}
// Pushes a frame onto the thread-local pseudo stack.
- void PushPseudoStackFrame(const char* trace_event_name);
+ void PushPseudoStackFrame(PseudoStackFrame stack_frame);
// Pops a frame from the thread-local pseudo stack.
- void PopPseudoStackFrame(const char* trace_event_name);
+ void PopPseudoStackFrame(PseudoStackFrame stack_frame);
// Push and pop current task's context. A stack is used to support nested
// tasks and the top of the stack will be used in allocation context.
@@ -90,7 +100,7 @@ class BASE_EXPORT AllocationContextTracker {
static subtle::Atomic32 capture_mode_;
// The pseudo stack where frames are |TRACE_EVENT| names.
- std::vector<const char*> pseudo_stack_;
+ std::vector<PseudoStackFrame> pseudo_stack_;
// The thread name is used as the first entry in the pseudo stack.
const char* thread_name_;
« no previous file with comments | « no previous file | base/trace_event/heap_profiler_allocation_context_tracker.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698