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

Unified Diff: base/trace_event/memory_dump_manager.cc

Issue 2838913002: memory-infra: Add SUMMARY_ONLY MemoryDumpType (Closed)
Patch Set: fix for rebase 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/memory_dump_manager_unittest.cc » ('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 02f2a6a8d45665abd5e89bd19d6736ab771bb999..c7619a9f138fbb2b28d7ae7191bd450db6726062 100644
--- a/base/trace_event/memory_dump_manager.cc
+++ b/base/trace_event/memory_dump_manager.cc
@@ -743,10 +743,15 @@ void MemoryDumpManager::FinalizeDumpAndAddToTrace(
ProcessId pid = kv.first; // kNullProcessId for the current process.
ProcessMemoryDump* process_memory_dump = kv.second.get();
- bool added_to_trace = tracing_observer_->AddDumpToTraceIfEnabled(
- &pmd_async_state->req_args, pid, process_memory_dump);
-
- dump_successful = dump_successful && added_to_trace;
+ // SUMMARY_ONLY dumps are just return the summarized result in the
+ // ProcessMemoryDumpCallback. These shouldn't be added to the trace to
+ // avoid confusing trace consumers.
+ if (pmd_async_state->req_args.dump_type != MemoryDumpType::SUMMARY_ONLY) {
+ bool added_to_trace = tracing_observer_->AddDumpToTraceIfEnabled(
+ &pmd_async_state->req_args, pid, process_memory_dump);
+
+ dump_successful = dump_successful && added_to_trace;
+ }
// TODO(hjd): Transitional until we send the full PMD. See crbug.com/704203
// Don't try to fill the struct in detailed mode since it is hard to avoid
« no previous file with comments | « no previous file | base/trace_event/memory_dump_manager_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698