| 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 <stddef.h> | 7 #include <stddef.h> |
| 8 | 8 |
| 9 #include <utility> | 9 #include <utility> |
| 10 | 10 |
| (...skipping 37 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 48 // string. | 48 // string. |
| 49 const char kMemoryDumpConfigParam[] = "memory_dump_config"; | 49 const char kMemoryDumpConfigParam[] = "memory_dump_config"; |
| 50 const char kTriggersParam[] = "triggers"; | 50 const char kTriggersParam[] = "triggers"; |
| 51 const char kPeriodicIntervalParam[] = "periodic_interval_ms"; | 51 const char kPeriodicIntervalParam[] = "periodic_interval_ms"; |
| 52 const char kModeParam[] = "mode"; | 52 const char kModeParam[] = "mode"; |
| 53 const char kHeapProfilerOptions[] = "heap_profiler_options"; | 53 const char kHeapProfilerOptions[] = "heap_profiler_options"; |
| 54 const char kBreakdownThresholdBytes[] = "breakdown_threshold_bytes"; | 54 const char kBreakdownThresholdBytes[] = "breakdown_threshold_bytes"; |
| 55 | 55 |
| 56 // Default configuration of memory dumps. | 56 // Default configuration of memory dumps. |
| 57 const TraceConfig::MemoryDumpConfig::Trigger kDefaultHeavyMemoryDumpTrigger = { | 57 const TraceConfig::MemoryDumpConfig::Trigger kDefaultHeavyMemoryDumpTrigger = { |
| 58 2000, // periodic_interval_ms | 58 10000, // periodic_interval_ms |
| 59 MemoryDumpLevelOfDetail::DETAILED}; | 59 MemoryDumpLevelOfDetail::DETAILED}; |
| 60 const TraceConfig::MemoryDumpConfig::Trigger kDefaultLightMemoryDumpTrigger = { | 60 const TraceConfig::MemoryDumpConfig::Trigger kDefaultLightMemoryDumpTrigger = { |
| 61 250, // periodic_interval_ms | 61 100, // periodic_interval_ms |
| 62 MemoryDumpLevelOfDetail::LIGHT}; | 62 MemoryDumpLevelOfDetail::LIGHT}; |
| 63 | 63 |
| 64 class ConvertableTraceConfigToTraceFormat | 64 class ConvertableTraceConfigToTraceFormat |
| 65 : public base::trace_event::ConvertableToTraceFormat { | 65 : public base::trace_event::ConvertableToTraceFormat { |
| 66 public: | 66 public: |
| 67 explicit ConvertableTraceConfigToTraceFormat(const TraceConfig& trace_config) | 67 explicit ConvertableTraceConfigToTraceFormat(const TraceConfig& trace_config) |
| 68 : trace_config_(trace_config) {} | 68 : trace_config_(trace_config) {} |
| 69 ~ConvertableTraceConfigToTraceFormat() override {} | 69 ~ConvertableTraceConfigToTraceFormat() override {} |
| 70 void AppendAsTraceFormat(std::string* out) const override { | 70 void AppendAsTraceFormat(std::string* out) const override { |
| 71 out->append(trace_config_.ToString()); | 71 out->append(trace_config_.ToString()); |
| (...skipping 655 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 727 str.at(0) == ' ' || | 727 str.at(0) == ' ' || |
| 728 str.at(str.length() - 1) == ' '; | 728 str.at(str.length() - 1) == ' '; |
| 729 } | 729 } |
| 730 | 730 |
| 731 bool TraceConfig::HasIncludedPatterns() const { | 731 bool TraceConfig::HasIncludedPatterns() const { |
| 732 return !included_categories_.empty(); | 732 return !included_categories_.empty(); |
| 733 } | 733 } |
| 734 | 734 |
| 735 } // namespace trace_event | 735 } // namespace trace_event |
| 736 } // namespace base | 736 } // namespace base |
| OLD | NEW |