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

Unified 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: Moving to use session state Created 4 years, 8 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 side-by-side diff with in-line comments
Download patch
Index: base/trace_event/trace_config.h
diff --git a/base/trace_event/trace_config.h b/base/trace_event/trace_config.h
index 72ca5f868785691b7686fef576f6eb59218c4592..f8504479bf6730452fccd598cf6686a854ad8a40 100644
--- a/base/trace_event/trace_config.h
+++ b/base/trace_event/trace_config.h
@@ -40,14 +40,39 @@ class BASE_EXPORT TraceConfig {
public:
typedef std::vector<std::string> StringList;
- // Specifies the memory dump config for tracing. Used only when
- // "memory-infra" category is enabled.
+ // Specifies the triggers in the memory dump config.
struct MemoryDumpTriggerConfig {
Primiano Tucci (use gerrit) 2016/04/22 14:18:29 I think just for the sake of legibility these stru
Maria 2016/04/25 18:37:24 Done.
uint32_t periodic_interval_ms;
MemoryDumpLevelOfDetail level_of_detail;
};
- typedef std::vector<MemoryDumpTriggerConfig> MemoryDumpConfig;
+ // Specifies the configuration options for the heap profiler.
+ struct HeapProfilerOptions {
+ // Default value for |breakdown_threshold_bytes|.
+ enum { kDefaultBreakdownThresholdBytes = 1024 };
+
+ HeapProfilerOptions();
+ ~HeapProfilerOptions();
+
+ // Reset the options to default.
+ void Clear();
+
+ uint32_t breakdown_threshold_bytes;
+ };
+
+ // Specifies the memory dump config for tracing.
+ // Used only when "memory-infra" category is enabled.
+ struct MemoryDumpConfig {
+ MemoryDumpConfig();
+ MemoryDumpConfig(const MemoryDumpConfig& other);
+ ~MemoryDumpConfig();
+
+ // Reset the values in the config.
+ void Clear();
+
+ std::vector<MemoryDumpTriggerConfig> triggers;
+ HeapProfilerOptions heap_profiler_options;
+ };
TraceConfig();
@@ -212,6 +237,8 @@ class BASE_EXPORT TraceConfig {
const StringList& categories) const;
void SetMemoryDumpConfig(const base::DictionaryValue& memory_dump_config);
+ void SetTriggers(const base::DictionaryValue& memory_dump_config);
Primiano Tucci (use gerrit) 2016/04/22 14:18:29 why do we have these intermediate setters (SetTrig
Maria 2016/04/25 18:37:24 I found it more clean to do it this way rather tha
+ void SetHeapProfilerOptions(const base::DictionaryValue& memory_dump_config);
void SetDefaultMemoryDumpConfig();
// Convert TraceConfig to the dict representation of the TraceConfig.

Powered by Google App Engine
This is Rietveld 408576698