| Index: trace_event/trace_config.h
|
| diff --git a/trace_event/trace_config.h b/trace_event/trace_config.h
|
| index a9f830656203502852ba1ca25b77554bc1867220..82ef9d7dfc2aace88957c15c96210dfd88f76559 100644
|
| --- a/trace_event/trace_config.h
|
| +++ b/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
|
| + // "memory-infra" category is enabled.
|
| + struct MemoryDumpTriggerConfig {
|
| + uint32 periodic_interval_ms;
|
| + MemoryDumpArgs::LevelOfDetail level_of_detail;
|
| + };
|
| +
|
| + typedef std::vector<MemoryDumpTriggerConfig> MemoryDumpConfig;
|
| +
|
| TraceConfig();
|
|
|
| // Create TraceConfig object from category filter and trace options strings.
|
| @@ -99,10 +109,21 @@ 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": [
|
| + // {
|
| + // "mode": "detailed",
|
| + // "periodic_interval_ms": 2000
|
| + // }
|
| + // ]
|
| + // }
|
| // }
|
| + //
|
| + // Note: memory_dump_config can be specified only if
|
| + // disabled-by-default-memory-infra category is enabled.
|
| explicit TraceConfig(const std::string& config_string);
|
|
|
| TraceConfig(const TraceConfig& tc);
|
| @@ -140,6 +161,10 @@ class BASE_EXPORT TraceConfig {
|
|
|
| void Clear();
|
|
|
| + const MemoryDumpConfig& memory_dump_config() const {
|
| + return memory_dump_config_;
|
| + }
|
| +
|
| private:
|
| FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, TraceConfigFromValidLegacyFormat);
|
| FRIEND_TEST_ALL_PREFIXES(TraceConfigTest,
|
| @@ -149,6 +174,9 @@ 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, LegacyStringToMemoryDumpConfig);
|
| + FRIEND_TEST_ALL_PREFIXES(TraceConfigTest, EmptyMemoryDumpConfigTest);
|
|
|
| // The default trace config, used when none is provided.
|
| // Allows all non-disabled-by-default categories through, except if they end
|
| @@ -169,6 +197,9 @@ class BASE_EXPORT TraceConfig {
|
| const char* param,
|
| const StringList& categories) const;
|
|
|
| + void SetMemoryDumpConfig(const base::DictionaryValue& memory_dump_config);
|
| + void SetDefaultMemoryDumpConfig();
|
| +
|
| // Convert TraceConfig to the dict representation of the TraceConfig.
|
| void ToDict(base::DictionaryValue& dict) const;
|
|
|
| @@ -193,6 +224,8 @@ class BASE_EXPORT TraceConfig {
|
| bool enable_systrace_ : 1;
|
| bool enable_argument_filter_ : 1;
|
|
|
| + MemoryDumpConfig memory_dump_config_;
|
| +
|
| StringList included_categories_;
|
| StringList disabled_categories_;
|
| StringList excluded_categories_;
|
|
|