Chromium Code Reviews| Index: base/trace_event/heap_profiler_allocation_context_tracker.cc |
| diff --git a/base/trace_event/heap_profiler_allocation_context_tracker.cc b/base/trace_event/heap_profiler_allocation_context_tracker.cc |
| index 1fc8bc008a522419f7b1eb454c9b45a6d8c739b0..399c48c765643fa39a22731d6ad46974f9d8a48c 100644 |
| --- a/base/trace_event/heap_profiler_allocation_context_tracker.cc |
| +++ b/base/trace_event/heap_profiler_allocation_context_tracker.cc |
| @@ -22,6 +22,7 @@ const size_t kMaxStackDepth = 128u; |
| const size_t kMaxTaskDepth = 16u; |
| AllocationContextTracker* const kInitializingSentinel = |
| reinterpret_cast<AllocationContextTracker*>(-1); |
| +const char kTracingOverhead[] = "tracing_overhead"; |
| ThreadLocalStorage::StaticSlot g_tls_alloc_ctx_tracker = TLS_INITIALIZER; |
| @@ -50,7 +51,8 @@ AllocationContextTracker::GetInstanceForCurrentThread() { |
| return tracker; |
| } |
| -AllocationContextTracker::AllocationContextTracker() : thread_name_(nullptr) { |
| +AllocationContextTracker::AllocationContextTracker() |
| + : thread_name_(nullptr), ignore_scope_count_(0) { |
| pseudo_stack_.reserve(kMaxStackDepth); |
| task_contexts_.reserve(kMaxTaskDepth); |
| } |
| @@ -119,6 +121,13 @@ void AllocationContextTracker::PopCurrentTaskContext(const char* context) { |
| AllocationContext AllocationContextTracker::GetContextSnapshot() { |
| AllocationContext ctx; |
| + if (ignore_scope_count_) { |
| + ctx = AllocationContext::Empty(); |
|
Primiano Tucci (use gerrit)
2016/04/20 16:34:57
I think either you or dskiba need to rebase on top
ssid
2016/04/21 01:07:46
Yes was waiting for it to land. Done.
|
| + ctx.backtrace.frames[0] = kTracingOverhead; |
| + ctx.type_name = kTracingOverhead; |
| + return ctx; |
| + } |
| + |
| // Fill the backtrace. |
| { |
| auto src = pseudo_stack_.begin(); |