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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 2766173003: memory-infra: Fill the memory dump callback result (2/2) (Closed)
Patch Set: rebase for struct change Created 3 years, 9 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 | « base/trace_event/memory_dump_manager.h ('k') | no next file » | 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 7b853279d6900594eb95d159322c57bd4a66fdea..8278c7b00b8b51760c33eb6574e0d347bbe2f7ad 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -733,6 +733,16 @@ uint32_t MemoryDumpManager::GetDumpsSumKb(const std::string& pattern,
}
// static
+void MemoryDumpManager::FillOsDumpFromProcessMemoryDump(
Primiano Tucci (use gerrit) 2017/03/24 11:44:43 move this to the anonymous namespace (and remove t
hjd 2017/03/24 12:12:54 Done.
+ MemoryDumpCallbackResult::OSMemDump& osDump,
+ ProcessMemoryDump* pmd) {
+ if (pmd->has_process_totals()) {
+ auto* totals = pmd->process_totals();
+ osDump.resident_set_kb = totals->resident_set_bytes() / 1024;
+ }
+}
+
+// static
void MemoryDumpManager::FinalizeDumpAndAddToTrace(
std::unique_ptr<ProcessMemoryDumpAsyncState> pmd_async_state) {
HEAP_PROFILER_SCOPED_IGNORE;
@@ -791,6 +801,9 @@ void MemoryDumpManager::FinalizeDumpAndAddToTrace(
GetDumpsSumKb("partition_alloc/partitions/*", process_memory_dump);
result.chrome_dump.blink_gc_total_kb =
GetDumpsSumKb("blink_gc", process_memory_dump);
+ } else {
+ auto& os_dump = result.extra_processes_dump[pid];
+ FillOsDumpFromProcessMemoryDump(os_dump, process_memory_dump);
Primiano Tucci (use gerrit) 2017/03/24 11:44:43 I think we want to do this also in the case above
hjd 2017/03/24 12:12:54 oops, I must have lost it in a rebase, thanks!
}
}
« no previous file with comments | « base/trace_event/memory_dump_manager.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698