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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 987043003: [tracing] Introduce support for userland memory allocators dumps. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@mmaps_en
Patch Set: Created 5 years, 9 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/memory_dump_manager.cc
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc
index 9a39faba8a645134200c8e7f979db2d9c2325374..8c97abf0de4327c7859cdc5d9cbc339155af15a5 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -139,12 +139,22 @@ void MemoryDumpManager::CreateLocalDumpPoint(DumpPointType dump_point_type,
// deal with thread safety.
{
AutoLock lock(lock_);
+ MemoryAllocatorDump* last_allocator_dump = nullptr;
for (auto it = dump_providers_enabled_.begin();
it != dump_providers_enabled_.end();) {
MemoryDumpProvider* dump_provider = *it;
if (dump_provider->DumpInto(pmd.get())) {
did_any_provider_dump = true;
++it;
+ // TODO(primiano): remove this once crbug.com/466121 gets fixed and
+ // the dump provider can inject the declarations for the allocator
+ // attributes just once when the trace is started (or ended).
+ MemoryAllocatorDump* allocator_dump = pmd->last_allocator_dump();
+ if (allocator_dump != last_allocator_dump) {
+ allocator_dump->set_extra_attributes_types(
+ dump_provider->allocator_attributes());
+ last_allocator_dump = allocator_dump;
+ }
} else {
LOG(ERROR) << "The memory dumper " << dump_provider->GetFriendlyName()
<< " failed, possibly due to sandboxing (crbug.com/461788), "

Powered by Google App Engine
This is Rietveld 408576698