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

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: Using suppotrted macro. 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..413776be9233a22d53136a0d7fc676928be749df 100644
--- a/content/common/host_discardable_shared_memory_manager.cc
+++ b/content/common/host_discardable_shared_memory_manager.cc
@@ -185,6 +185,20 @@ bool HostDiscardableSharedMemoryManager::OnMemoryDump(
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
segment->memory()->mapped_size());
+#if defined(COUNT_RESIDENT_BYTES_SUPPORTED)
+ if (args.level_of_detail ==
+ base::trace_event::MemoryDumpLevelOfDetail::DETAILED) {
+ int64 resident_size =
reveman 2015/10/07 13:41:44 nit: size_t as that's now the return type for Coun
ssid 2015/10/07 14:46:45 Done.
+ base::trace_event::ProcessMemoryDump::CountResidentBytes(
+ segment->memory()->memory(), segment->memory()->mapped_size());
+ if (resident_size >= 0) {
reveman 2015/10/07 13:41:44 nit: s/resident_size >= 0/resident_size/ after swi
ssid 2015/10/07 14:46:45 0 is still reported. removing if.
+ dump->AddScalar("resident_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ static_cast<uint64>(resident_size));
+ }
+ }
+#endif // defined(COUNT_RESIDENT_BYTES_SUPPORTED)
+
// Host can only tell if whole segment is locked or not.
dump->AddScalar(
"locked_size", base::trace_event::MemoryAllocatorDump::kUnitsBytes,

Powered by Google App Engine
This is Rietveld 408576698