Chromium Code Reviews| Index: base/trace_event/trace_config.h |
| diff --git a/base/trace_event/trace_config.h b/base/trace_event/trace_config.h |
| index a9f830656203502852ba1ca25b77554bc1867220..eda662a6c841273b2deef5bc02ddae81ffcd5197 100644 |
| --- a/base/trace_event/trace_config.h |
| +++ b/base/trace_event/trace_config.h |
| @@ -10,6 +10,7 @@ |
| #include "base/base_export.h" |
| #include "base/gtest_prod_util.h" |
| +#include "base/trace_event/memory_dump_provider.h" |
| #include "base/values.h" |
| namespace base { |
| @@ -35,6 +36,15 @@ class BASE_EXPORT TraceConfig { |
| public: |
| typedef std::vector<std::string> StringList; |
| + // Specifies the memory dump config for tracing. Used only when |
| + // DISABLED_BY_DEFAULT("memory-infra") category is enabled. |
|
Primiano Tucci (use gerrit)
2015/08/24 11:58:36
I'd just say "memory-infra" category, so if tomorr
ssid
2015/08/24 15:29:31
Done.
|
| + struct MemoryDumpConfig { |
|
Primiano Tucci (use gerrit)
2015/08/24 11:58:36
Shouldn't this be named MemoryDumpTriggerConfig?
ssid
2015/08/24 15:29:31
Done.
|
| + uint32 periodic_interval_ms; |
| + MemoryDumpArgs::LevelOfDetail dump_level_of_detail; |
|
Primiano Tucci (use gerrit)
2015/08/24 11:58:36
i'd omit the "dump_" part in the name (i.e. just l
ssid
2015/08/24 15:29:31
Done.
|
| + }; |
| + |
| + typedef std::vector<MemoryDumpConfig> MemoryDumpConfigList; |
|
Primiano Tucci (use gerrit)
2015/08/24 11:58:36
And this just MemoryDumpConfig?
ssid
2015/08/24 15:29:31
Done.
|
| + |
| TraceConfig(); |
| // Create TraceConfig object from category filter and trace options strings. |
| @@ -99,9 +109,17 @@ class BASE_EXPORT TraceConfig { |
| // "enable_argument_filter": true, |
| // "included_categories": ["included", |
| // "inc_pattern*", |
| - // "disabled-by-default-category1"], |
| + // "disabled-by-default-memory-infra"], |
| // "excluded_categories": ["excluded", "exc_pattern*"], |
| // "synthetic_delays": ["test.Delay1;16", "test.Delay2;32"] |
| + // "memory_dump_config": { |
| + // "triggers": [ |
| + // { |
| + // "dump_type": "heavy", |
|
Primiano Tucci (use gerrit)
2015/08/24 11:58:36
Why not "level_of_detail"? So it is consistent wit
ssid
2015/08/24 15:29:31
Done.
|
| + // "periodic_interval_ms": 2000 |
| + // } |
| + // ] |
| + // } |
| // } |
| explicit TraceConfig(const std::string& config_string); |
| @@ -140,6 +158,10 @@ class BASE_EXPORT TraceConfig { |
| void Clear(); |
| + const MemoryDumpConfigList& memory_dump_config_list() const { |
| + return memory_dump_config_list_; |
| + } |
| + |
| private: |
| FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromValidLegacyFormat); |
| FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, |
| @@ -149,6 +171,8 @@ class BASE_EXPORT TraceConfig { |
| FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromInvalidString); |
| FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, |
| IsEmptyOrContainsLeadingOrTrailingWhitespace); |
| + FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromMemoryConfigString); |
| + FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, InvalidMemoryConfigString); |
| // The default trace config, used when none is provided. |
| // Allows all non-disabled-by-default categories through, except if they end |
| @@ -169,6 +193,8 @@ class BASE_EXPORT TraceConfig { |
| const char* param, |
| const StringList& categories) const; |
| + void SetMemoryDumpConfigList(base::DictionaryValue& memory_dump_config); |
|
Primiano Tucci (use gerrit)
2015/08/24 11:58:36
+const base::....
Primiano Tucci (use gerrit)
2015/08/24 11:58:36
Shouldn't this be just SetMemoryDumpConfig (withou
ssid
2015/08/24 15:29:31
Done.
|
| + |
| // Convert TraceConfig to the dict representation of the TraceConfig. |
| void ToDict(base::DictionaryValue& dict) const; |
| @@ -193,6 +219,8 @@ class BASE_EXPORT TraceConfig { |
| bool enable_systrace_ : 1; |
| bool enable_argument_filter_ : 1; |
| + MemoryDumpConfigList memory_dump_config_list_; |
| + |
| StringList included_categories_; |
| StringList disabled_categories_; |
| StringList excluded_categories_; |