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

Unified Diff: content/common/host_discardable_shared_memory_manager.cc

Issue 2012763004: [tracing] Only add totals from discardable memory in background mode (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@whitelist_mdp
Patch Set: Created 4 years, 7 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 | « content/child/child_discardable_shared_memory_manager.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 7951ea127cc6238b4e207465cd5b8a9245a58e87..bfb689054948f6fd52da9897cd10805ea1821970 100644
--- a/content/common/host_discardable_shared_memory_manager.cc
+++ b/content/common/host_discardable_shared_memory_manager.cc
@@ -222,6 +222,16 @@ HostDiscardableSharedMemoryManager::AllocateLockedDiscardableMemory(
bool HostDiscardableSharedMemoryManager::OnMemoryDump(
const base::trace_event::MemoryDumpArgs& args,
base::trace_event::ProcessMemoryDump* pmd) {
+ if (args.level_of_detail ==
+ base::trace_event::MemoryDumpLevelOfDetail::BACKGROUND) {
+ base::trace_event::MemoryAllocatorDump* total_dump =
+ pmd->CreateAllocatorDump("discardable");
+ total_dump->AddScalar(base::trace_event::MemoryAllocatorDump::kNameSize,
+ base::trace_event::MemoryAllocatorDump::kUnitsBytes,
+ GetBytesAllocated());
Primiano Tucci (use gerrit) 2016/06/02 19:31:41 can you call this without the lock?
ssid 2016/06/03 00:27:47 Hmm, we can only be stalling the memory-infra thre
+ return true;
+ }
+
base::AutoLock lock(lock_);
for (const auto& process_entry : processes_) {
const int child_process_id = process_entry.first;
« no previous file with comments | « content/child/child_discardable_shared_memory_manager.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698