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

Unified Diff: base/trace_event/malloc_dump_provider.cc

Issue 2898943004: Cleanup malloc dump provider after previous refactoring (Closed)
Patch Set: Created 3 years, 7 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 21357c7ab0d5baf9e85896985ce710ac8ddb561b..17c9bc39edcdade1344de8be63dcf64d025a6f0f 100644
--- a/base/trace_event/malloc_dump_provider.cc
+++ b/base/trace_event/malloc_dump_provider.cc
@@ -298,26 +298,22 @@ bool MallocDumpProvider::OnMemoryDump(const MemoryDumpArgs& args,
// Enclosing all the temporary data structures in a scope, so that the heap
// profiler does not see unbalanced malloc/free calls from these containers.
{
- size_t shim_allocated_objects_size = 0;
- size_t shim_allocated_objects_count = 0;
TraceEventMemoryOverhead overhead;
std::unordered_map<AllocationContext, AllocationMetrics> metrics_by_context;
if (args.level_of_detail == MemoryDumpLevelOfDetail::DETAILED) {
- ShardedAllocationRegister::OutputMetrics metrics =
+ ShardedAllocationRegister::OutputMetrics shim_metrics =
allocation_register_.UpdateAndReturnsMetrics(metrics_by_context);
// Aggregate data for objects allocated through the shim.
- shim_allocated_objects_size += metrics.size;
- shim_allocated_objects_count += metrics.count;
+ inner_dump->AddScalar("shim_allocated_objects_size",
+ MemoryAllocatorDump::kUnitsBytes,
+ shim_metrics.size);
+ inner_dump->AddScalar("shim_allocator_object_count",
+ MemoryAllocatorDump::kUnitsObjects,
+ shim_metrics.count);
}
allocation_register_.EstimateTraceMemoryOverhead(&overhead);
- inner_dump->AddScalar("shim_allocated_objects_size",
- MemoryAllocatorDump::kUnitsBytes,
- shim_allocated_objects_size);
- inner_dump->AddScalar("shim_allocator_object_count",
- MemoryAllocatorDump::kUnitsObjects,
- shim_allocated_objects_count);
pmd->DumpHeapUsage(metrics_by_context, overhead, "malloc");
}
tid_dumping_heap_ = kInvalidThreadId;
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698