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

Side by Side Diff: base/trace_event/trace_config.h

Issue 1911643002: Add configurable limit to allocations in heap profiler. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fixed naming in protocol.json Created 4 years, 7 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
OLDNEW
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
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 MemoryDumpTriggerConfig {
Primiano Tucci (use gerrit) 2016/04/28 07:33:45 I'd probably shorten these names (e.g. s/MemoryDum
Maria 2016/04/28 17:23:39 Done.
52 uint32_t periodic_interval_ms;
53 MemoryDumpLevelOfDetail level_of_detail;
54 };
55
56 // Specifies the configuration options for the heap profiler.
57 struct HeapProfilerOptions {
58 // Default value for |breakdown_threshold_bytes|.
59 enum { kDefaultBreakdownThresholdBytes = 1024 };
60
61 HeapProfilerOptions();
62 ~HeapProfilerOptions();
Primiano Tucci (use gerrit) 2016/04/28 07:33:45 I think you can omit empty dtors for trivial struc
Maria 2016/04/28 17:23:39 Done.
63
64 // Reset the options to default.
65 void Clear();
66
67 uint32_t breakdown_threshold_bytes;
68 };
69
70 // Reset the values in the config.
71 void Clear();
72
73 std::vector<MemoryDumpTriggerConfig> triggers;
74 HeapProfilerOptions heap_profiler_options;
48 }; 75 };
49 76
50 typedef std::vector<MemoryDumpTriggerConfig> MemoryDumpConfig; 77 typedef MemoryDumpConfig::MemoryDumpTriggerConfig MemoryDumpTrigger;
78 typedef MemoryDumpConfig::HeapProfilerOptions MemoryDumpHeapProfilerOptions;
51 79
52 TraceConfig(); 80 TraceConfig();
53 81
54 // Create TraceConfig object from category filter and trace options strings. 82 // Create TraceConfig object from category filter and trace options strings.
55 // 83 //
56 // |category_filter_string| is a comma-delimited list of category wildcards. 84 // |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. 85 // 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 86 // All the same rules apply above, so for example, having both included and
59 // excluded categories in the same list would not be supported. 87 // excluded categories in the same list would not be supported.
60 // 88 //
(...skipping 182 matching lines...) Expand 10 before | Expand all | Expand 10 after
243 StringList included_categories_; 271 StringList included_categories_;
244 StringList disabled_categories_; 272 StringList disabled_categories_;
245 StringList excluded_categories_; 273 StringList excluded_categories_;
246 StringList synthetic_delays_; 274 StringList synthetic_delays_;
247 }; 275 };
248 276
249 } // namespace trace_event 277 } // namespace trace_event
250 } // namespace base 278 } // namespace base
251 279
252 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_ 280 #endif // BASE_TRACE_EVENT_TRACE_CONFIG_H_
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698