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

Unified Diff: base/debug/trace_event_impl.h

Issue 11823016: Trace category groups and category filter. (Closed) Base URL: http://git.chromium.org/chromium/src.git@master
Patch Set: Minor edits from previous changeset, mainly fixing line exceeding 80 chars. Created 7 years, 11 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/debug/trace_event_impl.h
diff --git a/base/debug/trace_event_impl.h b/base/debug/trace_event_impl.h
index fb9c5791021ed3b26ef34142f74264a45dc024a4..3c25f2ac33b276238a44225db48f5c5b960a1f3f 100644
--- a/base/debug/trace_event_impl.h
+++ b/base/debug/trace_event_impl.h
@@ -176,26 +176,30 @@ class BASE_EXPORT TraceLog {
// The known categories are inserted into |categories|.
void GetKnownCategories(std::vector<std::string>* categories);
- // Enable tracing for provided list of categories. If tracing is already
- // enabled, this method does nothing -- changing categories during trace is
- // not supported.
- // If both included_categories and excluded_categories are empty,
- // all categories are traced.
- // Else if included_categories is non-empty, only those are traced.
- // Else if excluded_categories is non-empty, everything but those are traced.
+ // Enable tracing for provided list of category tags. If tracing is already
+ // enabled, this method does nothing -- changing category tags during trace
+ // is not supported.
+ // If both included_tag_patterns and excluded_tag_patterns are empty,
+ // all categories are traced.
+ // Else if included_tag_patterns is non-empty, only those categories with
+ // matching tags are traced.
+ // Else if excluded_tag_patterns is non-empty, everything but those
+ // categories with matching tags 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);
+ void SetEnabled(const std::vector<std::string>& included_tag_patterns,
+ const std::vector<std::string>& excluded_tag_patterns);
- // |categories| is a comma-delimited list of category wildcards.
- // A category can have an optional '-' prefix to make it an excluded category.
+ // |tag_patterns| is a comma-delimited list of category tag wildcards.
+ // A tag pattern can have an optional '-' prefix to exclude categories
+ // with matching tags excluded.
+ //
// All the same rules apply above, so for example, having both included and
- // excluded categories in the same list would not be supported.
+ // excluded category tags in the same list would not be supported.
//
// Example: SetEnabled("test_MyTest*");
// Example: SetEnabled("test_MyTest*,test_OtherStuff");
- // Example: SetEnabled("-excluded_category1,-excluded_category2");
- void SetEnabled(const std::string& categories);
+ // Example: SetEnabled("-excluded_category_tag1,-excluded_category_tag2");
+ void SetEnabled(const std::string& tag_patterns);
// Retieves the categories set via a prior call to SetEnabled(). Only
// meaningful if |IsEnabled()| is true.
@@ -250,6 +254,8 @@ class BASE_EXPORT TraceLog {
void Flush(const OutputCallback& cb);
// Called by TRACE_EVENT* macros, don't call this directly.
+ // The name parameter is a category name that can be made up of tags, for
+ // example: TRACE_EVENT0("renderer,webkit", "WebViewImpl::HandleInputEvent")
static const unsigned char* GetCategoryEnabled(const char* name);
static const char* GetCategoryName(const unsigned char* category_enabled);
@@ -370,8 +376,8 @@ class BASE_EXPORT TraceLog {
int enable_count_;
NotificationCallback notification_callback_;
std::vector<TraceEvent> logged_events_;
- std::vector<std::string> included_categories_;
- std::vector<std::string> excluded_categories_;
+ std::vector<std::string> included_tag_patterns_;
+ std::vector<std::string> excluded_tag_patterns_;
bool dispatching_to_observer_list_;
ObserverList<EnabledStateChangedObserver> enabled_state_observer_list_;

Powered by Google App Engine
This is Rietveld 408576698