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

Unified Diff: content/browser/tracing/tracing_ui.cc

Issue 2912483002: Change memory dumps to not use periodic dumps by default. (Closed)
Patch Set: Created 3 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 | « base/trace_event/trace_config_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: content/browser/tracing/tracing_ui.cc
diff --git a/content/browser/tracing/tracing_ui.cc b/content/browser/tracing/tracing_ui.cc
index 14389658a420ecb7b3f5d00d287fedeabee87753..d455be3d53d1af6b2ae33d2ef4fa7242798c74d9 100644
--- a/content/browser/tracing/tracing_ui.cc
+++ b/content/browser/tracing/tracing_ui.cc
@@ -89,6 +89,22 @@ bool GetTracingOptions(const std::string& data64,
*trace_config = base::trace_event::TraceConfig(category_filter_string,
record_mode);
+ // When enabling memory-infra via tracing, use periodic dumping to trigger a
+ // detailed dump every 5s.
+ if (category_filter_string.find(
+ base::trace_event::MemoryDumpManager::kTraceCategory) !=
Primiano Tucci (use gerrit) 2017/05/26 19:12:33 Iirc there is a iscategoryenabled in traceconfig t
erikchen 2017/05/26 20:31:13 Done.
+ std::string::npos) {
+ base::trace_event::TraceConfig::MemoryDumpConfig::Trigger trigger = {
+ 5000, // min_time_between_dumps_ms
+ base::trace_event::MemoryDumpLevelOfDetail::DETAILED,
+ base::trace_event::MemoryDumpType::PERIODIC_INTERVAL};
+ base::trace_event::TraceConfig::MemoryDumpConfig memory_dump_config;
+ memory_dump_config.triggers.push_back(trigger);
+ memory_dump_config.allowed_dump_modes.insert(
+ base::trace_event::MemoryDumpLevelOfDetail::DETAILED);
Primiano Tucci (use gerrit) 2017/05/26 19:12:33 Check with ssid, I don't think you need this. This
erikchen 2017/05/26 20:31:13 This is necessary, because a freshly constructed M
ssid 2017/05/26 21:56:07 Yeah we only thought about the trace config string
erikchen 2017/05/27 00:51:03 Done.
+ trace_config->ResetMemoryDumpConfig(memory_dump_config);
+ }
+
bool enable_systrace;
options_ok &= options->GetBoolean("useSystemTracing", &enable_systrace);
if (enable_systrace)
« no previous file with comments | « base/trace_event/trace_config_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698