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

Unified Diff: content/common/host_discardable_shared_memory_manager.cc

Issue 1375963007: [tracing] Display the resident size of the discardable memory segments (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@lock_discardable
Patch Set: Nit. Created 5 years, 2 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 | « base/trace_event/process_memory_dump_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/common/host_discardable_shared_memory_manager.cc
diff --git a/content/common/host_discardable_shared_memory_manager.cc b/content/common/host_discardable_shared_memory_manager.cc
index 8af1d4dcc09912c2a6569fec88df88a33e54a0d7..efab71cfa107404c3be2fd4485b22ac3ec32a30e 100644
--- a/content/common/host_discardable_shared_memory_manager.cc
+++ b/content/common/host_discardable_shared_memory_manager.cc
@@ -203,6 +203,22 @@ bool HostDiscardableSharedMemoryManager::OnMemoryDump(
child_tracing_process_id, segment_id);
pmd->CreateSharedGlobalAllocatorDump(shared_segment_guid);
pmd->AddOwnershipEdge(dump->guid(), shared_segment_guid);
+
+#if defined(COUNT_RESIDENT_BYTES_SUPPORTED)
+ if (args.level_of_detail ==
+ base::trace_event::MemoryDumpLevelOfDetail::DETAILED) {
+ size_t resident_size =
+ base::trace_event::ProcessMemoryDump::CountResidentBytes(
+ segment->memory()->memory(), segment->memory()->mapped_size());
+
+ // This is added to the global dump since it has to be attributed to
+ // both the allocator dumps involved.
+ pmd->GetSharedGlobalAllocatorDump(shared_segment_guid)
+ ->AddScalar("resident_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ static_cast<uint64>(resident_size));
+ }
+#endif // defined(COUNT_RESIDENT_BYTES_SUPPORTED)
}
}
return true;
« no previous file with comments | « base/trace_event/process_memory_dump_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698