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

Unified Diff: base/trace_event/malloc_dump_provider.cc

Issue 2650863003: [tracing] Switch to new heap dump format. (Closed)
Patch Set: Add 'version' field. Created 3 years, 11 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/malloc_dump_provider.cc
diff --git a/base/trace_event/malloc_dump_provider.cc b/base/trace_event/malloc_dump_provider.cc
index 4683694d6bb60dc15a59b544dcadf639a7464e84..1f309a4f0507a78c94eedb9ec0b1ab12c197c295 100644
--- a/base/trace_event/malloc_dump_provider.cc
+++ b/base/trace_event/malloc_dump_provider.cc
@@ -242,22 +242,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;

Powered by Google App Engine
This is Rietveld 408576698