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

Unified Diff: content/child/web_memory_dump_provider_adapter.cc

Issue 1494293005: [Tracing] Enable heap dumps with both type info and backtraces (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@sfdedup-iter
Patch Set: Rename _all_ occurrences Created 5 years 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 | « base/trace_event/heap_profiler_heap_dump_writer_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/child/web_memory_dump_provider_adapter.cc
diff --git a/content/child/web_memory_dump_provider_adapter.cc b/content/child/web_memory_dump_provider_adapter.cc
index d5fbdfbe5011fc1f3f7251bcdd99551f389252f2..f26c1268fcf1cdc8ec295b8ff2775a96f108c675 100644
--- a/content/child/web_memory_dump_provider_adapter.cc
+++ b/content/child/web_memory_dump_provider_adapter.cc
@@ -4,6 +4,7 @@
#include "content/child/web_memory_dump_provider_adapter.h"
+#include "base/containers/hash_tables.h"
#include "base/lazy_instance.h"
#include "base/synchronization/lock.h"
#include "base/trace_event/heap_profiler_allocation_context.h"
@@ -77,19 +78,20 @@ bool WebMemoryDumpProviderAdapter::OnMemoryDump(
if (args.level_of_detail == MemoryDumpLevelOfDetail::DETAILED &&
web_memory_dump_provider_->supportsHeapProfiling() &&
g_heap_profiling_enabled) {
- HeapDumpWriter writer(pmd->session_state()->stack_frame_deduplicator(),
- pmd->session_state()->type_name_deduplicator());
TraceEventMemoryOverhead overhead;
-
+ hash_map<AllocationContext, size_t> bytes_by_context;
{
AutoLock lock(g_allocation_register_lock.Get());
for (const auto& alloc_size : *g_allocation_register)
- writer.InsertAllocation(alloc_size.context, alloc_size.size);
+ bytes_by_context[alloc_size.context] += alloc_size.size;
g_allocation_register->EstimateTraceMemoryOverhead(&overhead);
}
- pmd->AddHeapDump("partition_alloc", writer.WriteHeapDump());
+ scoped_refptr<TracedValue> heap_dump = ExportHeapDump(
+ bytes_by_context, pmd->session_state()->stack_frame_deduplicator(),
+ pmd->session_state()->type_name_deduplicator());
+ pmd->AddHeapDump("partition_alloc", heap_dump);
overhead.DumpInto("tracing/heap_profiler", pmd);
}
« no previous file with comments | « base/trace_event/heap_profiler_heap_dump_writer_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698