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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 2812573002: memory-infra: Reland: Fill the memory dump callback result (2/2) (Closed)
Patch Set: Created 3 years, 8 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 | « no previous file | base/trace_event/process_memory_dump.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/trace_event/memory_dump_manager.cc
diff --git a/base/trace_event/memory_dump_manager.cc b/base/trace_event/memory_dump_manager.cc
index 6ed1ca8fff3aa55d94af524a1a0e0057183b02ac..f42f5b3caf5bfe8be339def3c3fed74fa0540f8a 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -98,6 +98,15 @@ void OnGlobalDumpDone(MemoryDumpCallback wrapped_callback,
}
}
+void FillOsDumpFromProcessMemoryDump(
+ const ProcessMemoryDump* pmd,
+ MemoryDumpCallbackResult::OSMemDump* osDump) {
+ if (pmd->has_process_totals()) {
+ const ProcessMemoryTotals* totals = pmd->process_totals();
+ osDump->resident_set_kb = totals->resident_set_bytes() / 1024;
+ }
+}
+
// Proxy class which wraps a ConvertableToTraceFormat owned by the
// |session_state| into a proxy object that can be added to the trace event log.
// This is to solve the problem that the MemoryDumpSessionState is refcounted
@@ -807,6 +816,10 @@ void MemoryDumpManager::FinalizeDumpAndAddToTrace(
GetDumpsSumKb("partition_alloc/partitions/*", process_memory_dump);
result.chrome_dump.blink_gc_total_kb =
GetDumpsSumKb("blink_gc", process_memory_dump);
+ FillOsDumpFromProcessMemoryDump(process_memory_dump, &result.os_dump);
+ } else {
+ auto& os_dump = result.extra_processes_dump[pid];
+ FillOsDumpFromProcessMemoryDump(process_memory_dump, &os_dump);
}
}
« no previous file with comments | « no previous file | base/trace_event/process_memory_dump.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698