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

Unified Diff: telemetry/telemetry/timeline/chrome_trace_category_filter.py

Issue 2162963002: [polymer] Merge of master into polymer10-migration (Closed) Base URL: git@github.com:catapult-project/catapult.git@polymer10-migration
Patch Set: Merge polymer10-migration int polymer10-merge Created 4 years, 5 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: telemetry/telemetry/timeline/chrome_trace_category_filter.py
diff --git a/telemetry/telemetry/timeline/tracing_category_filter.py b/telemetry/telemetry/timeline/chrome_trace_category_filter.py
similarity index 83%
rename from telemetry/telemetry/timeline/tracing_category_filter.py
rename to telemetry/telemetry/timeline/chrome_trace_category_filter.py
index c417d13b57316f88d1697f5676b60a2962b2a644..203c5e95644cdf506eb81a33f346dcc451cecf3b 100644
--- a/telemetry/telemetry/timeline/tracing_category_filter.py
+++ b/telemetry/telemetry/timeline/chrome_trace_category_filter.py
@@ -5,7 +5,7 @@
import re
-def CreateNoOverheadFilter():
+def CreateLowOverheadFilter():
"""Returns a filter with the least overhead possible.
This contains no sub-traces of thread tasks, so it's only useful for
@@ -22,27 +22,45 @@ def CreateNoOverheadFilter():
"blink.console",
"trace_event_overhead"
]
- return TracingCategoryFilter(filter_string=','.join(categories))
+ return ChromeTraceCategoryFilter(filter_string=','.join(categories))
-def CreateMinimalOverheadFilter():
- """Returns a filter with the best-effort amount of overhead."""
- return TracingCategoryFilter(filter_string='')
+def CreateDefaultOverheadFilter():
+ """Returns a filter with the best-effort amount of overhead.
+
+ This matches Chrome tracing's default category filter setting, i.e., enable
+ all categories except the disabled-by-default-* ones.
+
+ We should use '*' instead of '' (empty string) here. On the Chrome side, both
+ '*' and '' mean default category filter setting. However, if someone adds
+ additional category filters, the behavior becomes different.
+
+ For example:
+ '*': enable all categories except the disabled-by-default-* ones.
+ '': enable all categories except the disabled-by-default-* ones.
+
+ Now add an additional category filter 'abc' to '*' and '':
+ '*,abc': enable all categories (including 'abc') except the
+ disabled-by-default-* ones.
+ 'abc': enable only 'abc', and disable all other ones.
+ """
+ return ChromeTraceCategoryFilter(filter_string='*')
def CreateDebugOverheadFilter():
"""Returns a filter with as many traces enabled as is useful."""
- return TracingCategoryFilter(filter_string='*,disabled-by-default-cc.debug')
+ return ChromeTraceCategoryFilter(
+ filter_string='*,disabled-by-default-cc.debug')
_delay_re = re.compile(r'DELAY[(][A-Za-z0-9._;]+[)]')
-class TracingCategoryFilter(object):
+class ChromeTraceCategoryFilter(object):
"""A set of included and excluded categories that should be traced.
- The TraceCategoryFilter allows fine tuning of what data is traced. Basic
- choice of which tracers to use is done by TracingOptions.
+ The ChromeTraceCategoryFilter allows fine tuning of what data is traced for
+ Chrome. Basic choice of which tracers to use is done by TracingConfig.
Providing filter_string=None gives the default category filter, which leaves
what to trace up to the individual trace systems.

Powered by Google App Engine
This is Rietveld 408576698