Index: base/trace_event/malloc_dump_provider.cc |
diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc |
index 52a432b86332fe893d0860214b6dbcc97e35cd8d..c26746a7789bf4faaa683ed88b0d804542106ac5 100644 |
--- a/base/trace_event/malloc_dump_provider.cc |
+++ b/base/trace_event/malloc_dump_provider.cc |
@@ -13,7 +13,7 @@ |
#include "base/trace_event/heap_profiler_allocation_context.h" |
#include "base/trace_event/heap_profiler_allocation_context_tracker.h" |
#include "base/trace_event/heap_profiler_allocation_register.h" |
-#include "base/trace_event/heap_profiler_heap_dump_writer.h" |
+#include "base/trace_event/heap_profiler_event_writer.h" |
#include "base/trace_event/process_memory_dump.h" |
#include "base/trace_event/trace_event_argument.h" |
#include "build/build_config.h" |
@@ -289,22 +289,10 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args, |
// Enclosing all the temporariy data structures in a scope, so that the heap |
// profiler does not see unabalanced malloc/free calls from these containers. |
{ |
- TraceEventMemoryOverhead overhead; |
- hash_map<AllocationContext, AllocationMetrics> metrics_by_context; |
- { |
- AutoLock lock(allocation_register_lock_); |
- if (allocation_register_) { |
- if (args.level_of_detail == MemoryDumpLevelOfDetail::DETAILED) { |
- for (const auto& alloc_size : *allocation_register_) { |
- AllocationMetrics& metrics = metrics_by_context[alloc_size.context]; |
- metrics.size += alloc_size.size; |
- metrics.count++; |
- } |
- } |
- allocation_register_->EstimateTraceMemoryOverhead(&overhead); |
- } |
- } // lock(allocation_register_lock_) |
- pmd->DumpHeapUsage(metrics_by_context, overhead, "malloc"); |
+ AutoLock lock(allocation_register_lock_); |
+ if (allocation_register_) { |
+ pmd->DumpHeapUsage(*allocation_register_, "malloc"); |
+ } |
} |
tid_dumping_heap_ = kInvalidThreadId; |