Index: base/debug/trace_event_impl.h |
diff --git a/base/debug/trace_event_impl.h b/base/debug/trace_event_impl.h |
index f152b0a413b4302e51191518b2c3993252d15d70..ceed71f9cf0497c1f93285b208cace8a61b193ae 100644 |
--- a/base/debug/trace_event_impl.h |
+++ b/base/debug/trace_event_impl.h |
@@ -157,7 +157,6 @@ class BASE_EXPORT TraceResultBuffer { |
bool append_comma_; |
}; |
- |
class BASE_EXPORT TraceLog { |
public: |
// Notification is a mask of one or more of the following events. |
@@ -170,8 +169,17 @@ class BASE_EXPORT TraceLog { |
EVENT_WATCH_NOTIFICATION = 1 << 1 |
}; |
+ // Options determines how the trace buffer stores data. |
+ enum Options { |
+ RECORD_UNTIL_FULL = 1 << 0 |
+ }; |
+ |
static TraceLog* GetInstance(); |
+ // Convert the given string to trace options. Defaults to RECORD_UNTIL_FULL if |
+ // the string does not provide valid options. |
+ static int TraceOptionsFromString(const std::string& str); |
jar (doing other things)
2013/02/22 19:31:28
nit: perhaps it would be nice to return Options.
dsinclair
2013/02/22 20:01:42
Done.
|
+ |
// Get set of known categories. This can change as new code paths are reached. |
// The known categories are inserted into |categories|. |
void GetKnownCategories(std::vector<std::string>* categories); |
@@ -185,7 +193,8 @@ class BASE_EXPORT TraceLog { |
// Else if excluded_categories is non-empty, everything but those are traced. |
// Wildcards * and ? are supported (see MatchPattern in string_util.h). |
void SetEnabled(const std::vector<std::string>& included_categories, |
- const std::vector<std::string>& excluded_categories); |
+ const std::vector<std::string>& excluded_categories, |
+ int options); |
jar (doing other things)
2013/02/22 19:31:28
nit: use Options rather than int throughout in arg
dsinclair
2013/02/22 20:01:42
Done.
|
// |categories| is a comma-delimited list of category wildcards. |
// A category can have an optional '-' prefix to make it an excluded category. |
@@ -195,17 +204,19 @@ class BASE_EXPORT TraceLog { |
// Example: SetEnabled("test_MyTest*"); |
// Example: SetEnabled("test_MyTest*,test_OtherStuff"); |
// Example: SetEnabled("-excluded_category1,-excluded_category2"); |
- void SetEnabled(const std::string& categories); |
+ void SetEnabled(const std::string& categories, int options); |
// Retieves the categories set via a prior call to SetEnabled(). Only |
// meaningful if |IsEnabled()| is true. |
void GetEnabledTraceCategories(std::vector<std::string>* included_out, |
std::vector<std::string>* excluded_out); |
+ int GetTraceOptions() { return trace_options_; } |
nduca
2013/02/22 18:38:13
int -> Options
const
This is a trivial accessor,
dsinclair
2013/02/22 19:16:03
Done.
|
+ |
// Disable tracing for all categories. |
void SetDisabled(); |
// Helper method to enable/disable tracing for all categories. |
- void SetEnabled(bool enabled); |
+ void SetEnabled(bool enabled, int options); |
bool IsEnabled() { return !!enable_count_; } |
#if defined(OS_ANDROID) |
@@ -400,6 +411,8 @@ class BASE_EXPORT TraceLog { |
const unsigned char* watch_category_; |
std::string watch_event_name_; |
+ int trace_options_; |
+ |
DISALLOW_COPY_AND_ASSIGN(TraceLog); |
}; |