OLD | NEW |
---|---|
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 Loading... | |
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 (category_filter_string.find( | |
95 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.
| |
96 std::string::npos) { | |
97 base::trace_event::TraceConfig::MemoryDumpConfig::Trigger trigger = { | |
98 5000, // min_time_between_dumps_ms | |
99 base::trace_event::MemoryDumpLevelOfDetail::DETAILED, | |
100 base::trace_event::MemoryDumpType::PERIODIC_INTERVAL}; | |
101 base::trace_event::TraceConfig::MemoryDumpConfig memory_dump_config; | |
102 memory_dump_config.triggers.push_back(trigger); | |
103 memory_dump_config.allowed_dump_modes.insert( | |
104 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.
| |
105 trace_config->ResetMemoryDumpConfig(memory_dump_config); | |
106 } | |
107 | |
92 bool enable_systrace; | 108 bool enable_systrace; |
93 options_ok &= options->GetBoolean("useSystemTracing", &enable_systrace); | 109 options_ok &= options->GetBoolean("useSystemTracing", &enable_systrace); |
94 if (enable_systrace) | 110 if (enable_systrace) |
95 trace_config->EnableSystrace(); | 111 trace_config->EnableSystrace(); |
96 | 112 |
97 if (!options_ok) { | 113 if (!options_ok) { |
98 LOG(ERROR) << "Malformed options"; | 114 LOG(ERROR) << "Malformed options"; |
99 return false; | 115 return false; |
100 } | 116 } |
101 return true; | 117 return true; |
(...skipping 205 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
307 web_ui()->CallJavascriptFunctionUnsafe("onUploadComplete", | 323 web_ui()->CallJavascriptFunctionUnsafe("onUploadComplete", |
308 base::Value(feedback)); | 324 base::Value(feedback)); |
309 } else { | 325 } else { |
310 web_ui()->CallJavascriptFunctionUnsafe("onUploadError", | 326 web_ui()->CallJavascriptFunctionUnsafe("onUploadError", |
311 base::Value(feedback)); | 327 base::Value(feedback)); |
312 } | 328 } |
313 trace_uploader_.reset(); | 329 trace_uploader_.reset(); |
314 } | 330 } |
315 | 331 |
316 } // namespace content | 332 } // namespace content |
OLD | NEW |