diff options
author | caseq <caseq@chromium.org> | 2014-12-12 11:00:39 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2014-12-12 19:01:00 +0000 |
commit | 5262e5a158f6302eb4dac49d416b1a00f37186ba (patch) | |
tree | 684ea826d80947940ddc55a3494032388fefc71d /base/debug/trace_event_unittest.cc | |
parent | ce39d41c13db11a69564ba2299f7e83d3fa05c3c (diff) | |
download | chromium_src-5262e5a158f6302eb4dac49d416b1a00f37186ba.zip chromium_src-5262e5a158f6302eb4dac49d416b1a00f37186ba.tar.gz chromium_src-5262e5a158f6302eb4dac49d416b1a00f37186ba.tar.bz2 |
Tracing: make filtering logic more intuitive for multiple categories
This changes the way category filter processes multi-categories groups.
Previously, adding a disabled-by-default- category to a regular category
would prevent the event from matching filter if only regular category
is enabled. This is somewhat counter-intuitive, the expected behavior
is that each category is processed by the filter independently. The new
logic is:
1. if at least one category in event category group matches at
least one category enabled in the filter, the event passes;
2. if at least one category in event category group matches at least
one category explicitly excluded in the filter, the event is
filtered out;
3. the event is passed by default, if included categories list is empty
and event has at least one category that is not disabled-by-default-.
Note no existing tests were modified (though I'm not sure if (2) should
be the way it is).
BUG=
Review URL: https://codereview.chromium.org/788243003
Cr-Commit-Position: refs/heads/master@{#308136}
Diffstat (limited to 'base/debug/trace_event_unittest.cc')
-rw-r--r-- | base/debug/trace_event_unittest.cc | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/base/debug/trace_event_unittest.cc b/base/debug/trace_event_unittest.cc index 0904954..85cf4eb 100644 --- a/base/debug/trace_event_unittest.cc +++ b/base/debug/trace_event_unittest.cc @@ -1615,6 +1615,22 @@ TEST_F(TraceEventTestFixture, DisabledCategories) { EXPECT_FIND_("disabled-by-default-cc"); EXPECT_FIND_("other_included"); } + + Clear(); + + BeginSpecificTrace("other_included"); + TRACE_EVENT_INSTANT0(TRACE_DISABLED_BY_DEFAULT("cc") ",other_included", + "first", TRACE_EVENT_SCOPE_THREAD); + TRACE_EVENT_INSTANT0("other_included," TRACE_DISABLED_BY_DEFAULT("cc"), + "second", TRACE_EVENT_SCOPE_THREAD); + EndTraceAndFlush(); + + { + const DictionaryValue* item = NULL; + ListValue& trace_parsed = trace_parsed_; + EXPECT_FIND_("disabled-by-default-cc,other_included"); + EXPECT_FIND_("other_included,disabled-by-default-cc"); + } } TEST_F(TraceEventTestFixture, NormallyNoDeepCopy) { |