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..47cc135c96caba24eb1a9261a846f75b754bd31c 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 |
| + // "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"], |
|
Primiano Tucci (use gerrit)
2015/08/25 18:27:37
remove this line
ssid
2015/08/26 10:19:51
Done.
|
| // "excluded_categories": ["excluded", "exc_pattern*"], |
| // "synthetic_delays": ["test.Delay1;16", "test.Delay2;32"] |
| + // "memory_dump_config": { |
| + // "triggers": [ |
| + // { |
| + // "level_of_detail": "high", |
|
Primiano Tucci (use gerrit)
2015/08/25 18:27:37
s/level_of_detail/mode/
high -> detailed
low -> li
ssid
2015/08/26 10:19:51
Done.
|
| + // "periodic_interval_ms": 2000 |
| + // } |
| + // ] |
| + // } |
| // } |
| + // |
| + // Note: memory_dump_config can be specified only if |
|
Primiano Tucci (use gerrit)
2015/08/24 21:26:47
ssid: according to our last chat offline this comm
ssid
2015/08/24 22:46:26
For this CL this is true. This will be removed onc
ssid
2015/08/24 22:53:22
Hm, this is true even after the change, right? The
|
| + // disabled-by-default-memory-infra category is enabled. |
|
Primiano Tucci (use gerrit)
2015/08/25 18:27:37
Had offline chat, remove this comment
ssid
2015/08/26 10:19:51
Done.
|
| 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,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 +196,8 @@ class BASE_EXPORT TraceConfig { |
| const char* param, |
| const StringList& categories) const; |
| + void SetMemoryDumpConfig(const base::DictionaryValue& memory_dump_config); |
| + |
| // Convert TraceConfig to the dict representation of the TraceConfig. |
| void ToDict(base::DictionaryValue& dict) const; |
| @@ -193,6 +222,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_; |