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

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: Fix mac. 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
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..a6d5e0739e96ff301b2582b1fee4f0cf16a92133 100644
--- a/content/common/host_discardable_shared_memory_manager.cc
+++ b/content/common/host_discardable_shared_memory_manager.cc
@@ -185,6 +185,15 @@ bool HostDiscardableSharedMemoryManager::OnMemoryDump(
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
segment->memory()->mapped_size());
+ ssize_t resident_size =
+ base::trace_event::ProcessMemoryDump::CountResidentBytes(
+ segment->memory()->memory(), segment->memory()->mapped_size());
+ if (resident_size >= 0) {
+ dump->AddScalar("resident_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ static_cast<uint64>(resident_size));
+ }
+
// Host can only tell if whole segment is locked or not.
dump->AddScalar(
"locked_size", base::trace_event::MemoryAllocatorDump::kUnitsBytes,
« base/trace_event/process_memory_dump.cc ('K') | « content/common/discardable_shared_memory_heap.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698