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

Side by Side Diff: content/browser/tracing/tracing_ui.cc

Issue 2912483002: Change memory dumps to not use periodic dumps by default. (Closed)
Patch Set: comments from primiano. Created 3 years, 6 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 unified diff | Download patch
« no previous file with comments | « base/trace_event/trace_config_unittest.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be 2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file. 3 // found in the LICENSE file.
4 4
5 #include "content/browser/tracing/tracing_ui.h" 5 #include "content/browser/tracing/tracing_ui.h"
6 6
7 #include <stddef.h> 7 #include <stddef.h>
8 8
9 #include <memory> 9 #include <memory>
10 #include <set> 10 #include <set>
(...skipping 71 matching lines...) Expand 10 before | Expand all | Expand 10 after
82 bool options_ok = true; 82 bool options_ok = true;
83 std::string category_filter_string; 83 std::string category_filter_string;
84 options_ok &= options->GetString("categoryFilter", &category_filter_string); 84 options_ok &= options->GetString("categoryFilter", &category_filter_string);
85 85
86 std::string record_mode; 86 std::string record_mode;
87 options_ok &= options->GetString("tracingRecordMode", &record_mode); 87 options_ok &= options->GetString("tracingRecordMode", &record_mode);
88 88
89 *trace_config = base::trace_event::TraceConfig(category_filter_string, 89 *trace_config = base::trace_event::TraceConfig(category_filter_string,
90 record_mode); 90 record_mode);
91 91
92 // When enabling memory-infra via tracing, use periodic dumping to trigger a
93 // detailed dump every 5s.
94 if (trace_config->category_filter().IsCategoryEnabled(
ssid 2017/05/26 21:56:07 This should just be trace/config->IsCategoryGroupE
erikchen 2017/05/27 00:51:03 Done.
95 base::trace_event::MemoryDumpManager::kTraceCategory)) {
96 base::trace_event::TraceConfig::MemoryDumpConfig::Trigger trigger = {
97 5000, // min_time_between_dumps_ms
98 base::trace_event::MemoryDumpLevelOfDetail::DETAILED,
99 base::trace_event::MemoryDumpType::PERIODIC_INTERVAL};
100 base::trace_event::TraceConfig::MemoryDumpConfig memory_dump_config;
101 memory_dump_config.triggers.push_back(trigger);
102 memory_dump_config.allowed_dump_modes.insert(
103 base::trace_event::MemoryDumpLevelOfDetail::DETAILED);
104 trace_config->ResetMemoryDumpConfig(memory_dump_config);
105 }
106
92 bool enable_systrace; 107 bool enable_systrace;
93 options_ok &= options->GetBoolean("useSystemTracing", &enable_systrace); 108 options_ok &= options->GetBoolean("useSystemTracing", &enable_systrace);
94 if (enable_systrace) 109 if (enable_systrace)
95 trace_config->EnableSystrace(); 110 trace_config->EnableSystrace();
96 111
97 if (!options_ok) { 112 if (!options_ok) {
98 LOG(ERROR) << "Malformed options"; 113 LOG(ERROR) << "Malformed options";
99 return false; 114 return false;
100 } 115 }
101 return true; 116 return true;
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after
307 web_ui()->CallJavascriptFunctionUnsafe("onUploadComplete", 322 web_ui()->CallJavascriptFunctionUnsafe("onUploadComplete",
308 base::Value(feedback)); 323 base::Value(feedback));
309 } else { 324 } else {
310 web_ui()->CallJavascriptFunctionUnsafe("onUploadError", 325 web_ui()->CallJavascriptFunctionUnsafe("onUploadError",
311 base::Value(feedback)); 326 base::Value(feedback));
312 } 327 }
313 trace_uploader_.reset(); 328 trace_uploader_.reset();
314 } 329 }
315 330
316 } // namespace content 331 } // namespace content
OLDNEW
« 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