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

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: nits. 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..5ce5831c49d68223ec171272aba7d120559c364d 100644
--- a/base/trace_event/heap_profiler_allocation_context_tracker.h
+++ b/base/trace_event/heap_profiler_allocation_context_tracker.h
@@ -52,6 +52,12 @@ class BASE_EXPORT AllocationContextTracker {
// if capture is enabled.
static void SetCurrentThreadName(const char* name);
+ void start_ignore_scope() { ignore_scope_count_++; }
Primiano Tucci (use gerrit) 2016/04/20 16:34:57 add a comment plz. One for both is ok.
ssid 2016/04/21 01:07:46 Sorry uploaded older patch here.
+ void end_ignore_scope() {
Primiano Tucci (use gerrit) 2016/04/20 16:34:57 s/start/begin/ s/start/end/
ssid 2016/04/21 01:07:46 I think you meant begin and end here.
+ DCHECK(ignore_scope_count_);
+ ignore_scope_count_--;
+ }
+
// Pushes a frame onto the thread-local pseudo stack.
void PushPseudoStackFrame(StackFrame frame);
@@ -83,6 +89,8 @@ class BASE_EXPORT AllocationContextTracker {
// pseudo stack to cluster allocations.
std::vector<const char*> task_contexts_;
+ uint32_t ignore_scope_count_;
Primiano Tucci (use gerrit) 2016/04/20 16:34:57 s/count/depth/
Dmitry Skiba 2016/04/20 16:59:15 Also, size_t is better here.
ssid 2016/04/21 01:07:46 Done.
ssid 2016/04/21 01:07:46 Done.
+
DISALLOW_COPY_AND_ASSIGN(AllocationContextTracker);
};

Powered by Google App Engine
This is Rietveld 408576698