Index: base/trace_event/trace_event_impl.cc |
diff --git a/base/trace_event/trace_event_impl.cc b/base/trace_event/trace_event_impl.cc |
index 445cb6db97aad8cedd410c60ef3447ab731c86ce..a66bf5f68c86368034ab7de8004c7b82d4968d43 100644 |
--- a/base/trace_event/trace_event_impl.cc |
+++ b/base/trace_event/trace_event_impl.cc |
@@ -2490,18 +2490,35 @@ bool CategoryFilter::IsCategoryGroupEnabled( |
// Do a second pass to check for explicitly disabled categories |
// (those explicitly enabled have priority due to first pass). |
category_group_tokens.Reset(); |
+ bool all_category_groups_disabled = false; |
while (category_group_tokens.GetNext()) { |
std::string category_group_token = category_group_tokens.token(); |
for (StringList::const_iterator ci = excluded_.begin(); |
ci != excluded_.end(); ++ci) { |
- if (MatchPattern(category_group_token.c_str(), ci->c_str())) |
- return false; |
+ if (MatchPattern(category_group_token.c_str(), ci->c_str())) { |
+ // Current token of category_group_name is present in excluded_list. |
+ // Flag the exclusion and proceed further to check if any of the |
+ // remaining categories of category_group_name is not present in the |
+ // excluded_ list. |
+ all_category_groups_disabled = true; |
dsinclair
2015/03/06 04:04:45
This isn't really all_, it's one category group di
r.kasibhatla
2015/03/06 04:19:32
Done.
|
+ break; |
+ } |
+ // One of the category of category_group_name is not present in |
+ // excluded_ list. So, it has to be included_ list. Enable the |
+ // category_group_name for recording. |
+ all_category_groups_disabled = false; |
} |
+ // One of the categories present in category_group_name is not present in |
+ // excluded_ list. Implies this category_group_name group can be enabled |
+ // for recording, since one of its groups is enabled for recording. |
+ if (!all_category_groups_disabled) |
+ break; |
} |
// If the category group is not excluded, and there are no included patterns |
// we consider this category group enabled, as long as it had categories |
// other than disabled-by-default. |
- return included_.empty() && had_enabled_by_default; |
+ return !all_category_groups_disabled && |
+ (included_.empty() && had_enabled_by_default); |
dsinclair
2015/03/06 04:04:45
nit: Don't need the brackets.
r.kasibhatla
2015/03/06 04:19:32
Done.
|
} |
bool CategoryFilter::IsCategoryEnabled(const char* category_name) const { |