OLD | NEW |
1 // Copyright 2015 The Chromium Authors. All rights reserved. | 1 // Copyright 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 #ifndef BASE_TRACE_EVENT_TRACE_CONFIG_H_ | 5 #ifndef BASE_TRACE_EVENT_TRACE_CONFIG_H_ |
6 #define BASE_TRACE_EVENT_TRACE_CONFIG_H_ | 6 #define BASE_TRACE_EVENT_TRACE_CONFIG_H_ |
7 | 7 |
8 #include <stdint.h> | 8 #include <stdint.h> |
9 | 9 |
10 #include <string> | 10 #include <string> |
(...skipping 22 matching lines...) Expand all Loading... |
33 RECORD_AS_MUCH_AS_POSSIBLE, | 33 RECORD_AS_MUCH_AS_POSSIBLE, |
34 | 34 |
35 // Echo to console. Events are discarded. | 35 // Echo to console. Events are discarded. |
36 ECHO_TO_CONSOLE, | 36 ECHO_TO_CONSOLE, |
37 }; | 37 }; |
38 | 38 |
39 class BASE_EXPORT TraceConfig { | 39 class BASE_EXPORT TraceConfig { |
40 public: | 40 public: |
41 typedef std::vector<std::string> StringList; | 41 typedef std::vector<std::string> StringList; |
42 | 42 |
43 // Specifies the memory dump config for tracing. Used only when | 43 // Specifies the memory dump config for tracing. |
44 // "memory-infra" category is enabled. | 44 // Used only when "memory-infra" category is enabled. |
45 struct MemoryDumpTriggerConfig { | 45 struct MemoryDumpConfig { |
46 uint32_t periodic_interval_ms; | 46 MemoryDumpConfig(); |
47 MemoryDumpLevelOfDetail level_of_detail; | 47 MemoryDumpConfig(const MemoryDumpConfig& other); |
| 48 ~MemoryDumpConfig(); |
| 49 |
| 50 // Specifies the triggers in the memory dump config. |
| 51 struct Trigger { |
| 52 uint32_t periodic_interval_ms; |
| 53 MemoryDumpLevelOfDetail level_of_detail; |
| 54 }; |
| 55 |
| 56 // Specifies the configuration options for the heap profiler. |
| 57 struct HeapProfiler { |
| 58 // Default value for |breakdown_threshold_bytes|. |
| 59 enum { kDefaultBreakdownThresholdBytes = 1024 }; |
| 60 |
| 61 HeapProfiler(); |
| 62 |
| 63 // Reset the options to default. |
| 64 void Clear(); |
| 65 |
| 66 uint32_t breakdown_threshold_bytes; |
| 67 }; |
| 68 |
| 69 // Reset the values in the config. |
| 70 void Clear(); |
| 71 |
| 72 std::vector<Trigger> triggers; |
| 73 HeapProfiler heap_profiler_options; |
48 }; | 74 }; |
49 | 75 |
50 typedef std::vector<MemoryDumpTriggerConfig> MemoryDumpConfig; | |
51 | |
52 TraceConfig(); | 76 TraceConfig(); |
53 | 77 |
54 // Create TraceConfig object from category filter and trace options strings. | 78 // Create TraceConfig object from category filter and trace options strings. |
55 // | 79 // |
56 // |category_filter_string| is a comma-delimited list of category wildcards. | 80 // |category_filter_string| is a comma-delimited list of category wildcards. |
57 // A category can have an optional '-' prefix to make it an excluded category. | 81 // A category can have an optional '-' prefix to make it an excluded category. |
58 // All the same rules apply above, so for example, having both included and | 82 // All the same rules apply above, so for example, having both included and |
59 // excluded categories in the same list would not be supported. | 83 // excluded categories in the same list would not be supported. |
60 // | 84 // |
61 // Category filters can also be used to configure synthetic delays. | 85 // Category filters can also be used to configure synthetic delays. |
(...skipping 181 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
243 StringList included_categories_; | 267 StringList included_categories_; |
244 StringList disabled_categories_; | 268 StringList disabled_categories_; |
245 StringList excluded_categories_; | 269 StringList excluded_categories_; |
246 StringList synthetic_delays_; | 270 StringList synthetic_delays_; |
247 }; | 271 }; |
248 | 272 |
249 } // namespace trace_event | 273 } // namespace trace_event |
250 } // namespace base | 274 } // namespace base |
251 | 275 |
252 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_ | 276 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_ |
OLD | NEW |