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

Unified Diff: base/trace_event/heap_profiler_allocation_context_tracker.h

Issue 1900223003: [tracing] Ignore tracing allocations in heap profiler (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: fixes. Created 4 years, 8 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 d6133323bfb3d8f88f4331f6c718582c5611b3ee..7265247efd48e5832279e61cab990bc924baab4d 100644
--- a/base/trace_event/heap_profiler_allocation_context_tracker.h
+++ b/base/trace_event/heap_profiler_allocation_context_tracker.h
@@ -52,6 +52,15 @@ class BASE_EXPORT AllocationContextTracker {
// if capture is enabled.
static void SetCurrentThreadName(const char* name);
+ // Starts and ends a new ignore scope between which the allocations are
+ // ignored in the heap profiler. A dummy context is returned for these
Primiano Tucci (use gerrit) 2016/04/21 19:47:31 I'd say: A dummy context that short circuits to "t
ssid 2016/04/22 04:57:12 Done.
+ // allocations.
+ void begin_ignore_scope() { ignore_scope_depth_++; }
+ void end_ignore_scope() {
+ DCHECK(ignore_scope_depth_);
Primiano Tucci (use gerrit) 2016/04/21 19:47:31 thinking more I think you should remove the dcheck
ssid 2016/04/22 04:57:12 Makes sense. done.
+ ignore_scope_depth_--;
+ }
+
// Pushes a frame onto the thread-local pseudo stack.
void PushPseudoStackFrame(StackFrame frame);
@@ -83,6 +92,8 @@ class BASE_EXPORT AllocationContextTracker {
// pseudo stack to cluster allocations.
std::vector<const char*> task_contexts_;
+ uint32_t ignore_scope_depth_;
+
DISALLOW_COPY_AND_ASSIGN(AllocationContextTracker);
};

Powered by Google App Engine
This is Rietveld 408576698