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

Unified Diff: content/common/host_discardable_shared_memory_manager.cc

Issue 1374213002: [tracing] Display the locked size of discardable memory segment. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Storing locked state in spans. Created 5 years, 3 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 97351e5510538dd3fc1cbb6cdf0fbce27b5d5c0b..5858b63b0eb70e9120d0ac5140bfb2cd151d3774 100644
--- a/content/common/host_discardable_shared_memory_manager.cc
+++ b/content/common/host_discardable_shared_memory_manager.cc
@@ -180,9 +180,16 @@ bool HostDiscardableSharedMemoryManager::OnMemoryDump(
"discardable/process_%x/segment_%d", child_process_id, segment_id);
base::trace_event::MemoryAllocatorDump* dump =
pmd->CreateAllocatorDump(dump_name);
+
+ const size_t mapped_size = segment->memory()->mapped_size();
dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
base::trace_event::MemoryAllocatorDump::kUnitsBytes,
- segment->memory()->mapped_size());
+ mapped_size);
+
+ // Host can only tell if whole segment is locked or not.
+ dump->AddScalar("locked_size",
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ segment->memory()->IsMemoryLocked() ? mapped_size : 0u);
// Create the cross-process ownership edge. If the child creates a
// corresponding dump for the same segment, this will avoid to

Powered by Google App Engine
This is Rietveld 408576698