| OLD | NEW |
| 1 // Copyright (c) 2015 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2015 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 "base/trace_event/trace_config.h" | 5 #include "base/trace_event/trace_config.h" |
| 6 | 6 |
| 7 #include "base/json/json_reader.h" | 7 #include "base/json/json_reader.h" |
| 8 #include "base/json/json_writer.h" | 8 #include "base/json/json_writer.h" |
| 9 #include "base/strings/pattern.h" | 9 #include "base/strings/pattern.h" |
| 10 #include "base/strings/string_split.h" | 10 #include "base/strings/string_split.h" |
| (...skipping 234 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 245 enable_sampling_ = false; | 245 enable_sampling_ = false; |
| 246 enable_systrace_ = false; | 246 enable_systrace_ = false; |
| 247 enable_argument_filter_ = false; | 247 enable_argument_filter_ = false; |
| 248 included_categories_.clear(); | 248 included_categories_.clear(); |
| 249 disabled_categories_.clear(); | 249 disabled_categories_.clear(); |
| 250 excluded_categories_.clear(); | 250 excluded_categories_.clear(); |
| 251 synthetic_delays_.clear(); | 251 synthetic_delays_.clear(); |
| 252 memory_dump_config_.clear(); | 252 memory_dump_config_.clear(); |
| 253 } | 253 } |
| 254 | 254 |
| 255 bool TraceConfig::IsDetailedMemoryDumpEnabled() const { |
| 256 if (IsCategoryEnabled(MemoryDumpManager::kTraceCategory)) { |
| 257 for (const MemoryDumpTriggerConfig& config : memory_dump_config_) { |
| 258 if (config.level_of_detail == MemoryDumpLevelOfDetail::DETAILED) |
| 259 return true; |
| 260 } |
| 261 } |
| 262 return false; |
| 263 } |
| 264 |
| 255 void TraceConfig::InitializeDefault() { | 265 void TraceConfig::InitializeDefault() { |
| 256 record_mode_ = RECORD_UNTIL_FULL; | 266 record_mode_ = RECORD_UNTIL_FULL; |
| 257 enable_sampling_ = false; | 267 enable_sampling_ = false; |
| 258 enable_systrace_ = false; | 268 enable_systrace_ = false; |
| 259 enable_argument_filter_ = false; | 269 enable_argument_filter_ = false; |
| 260 excluded_categories_.push_back("*Debug"); | 270 excluded_categories_.push_back("*Debug"); |
| 261 excluded_categories_.push_back("*Test"); | 271 excluded_categories_.push_back("*Test"); |
| 262 } | 272 } |
| 263 | 273 |
| 264 void TraceConfig::InitializeFromConfigString(const std::string& config_string) { | 274 void TraceConfig::InitializeFromConfigString(const std::string& config_string) { |
| (...skipping 368 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 633 str.at(0) == ' ' || | 643 str.at(0) == ' ' || |
| 634 str.at(str.length() - 1) == ' '; | 644 str.at(str.length() - 1) == ' '; |
| 635 } | 645 } |
| 636 | 646 |
| 637 bool TraceConfig::HasIncludedPatterns() const { | 647 bool TraceConfig::HasIncludedPatterns() const { |
| 638 return !included_categories_.empty(); | 648 return !included_categories_.empty(); |
| 639 } | 649 } |
| 640 | 650 |
| 641 } // namespace trace_event | 651 } // namespace trace_event |
| 642 } // namespace base | 652 } // namespace base |
| OLD | NEW |