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

Unified Diff: tools/perf/metrics/timeline.py

Issue 148613014: CC: Add 'cc-benchmark' traces for minimal tracing in benchmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Minimum overhead toplevel tracing. Created 6 years, 10 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
« base/message_loop/message_loop.cc ('K') | « ipc/ipc_sync_channel.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/metrics/timeline.py
diff --git a/tools/perf/metrics/timeline.py b/tools/perf/metrics/timeline.py
index 3442cab15b01b00604f22a2541f4df74825a0c7f..0b1bc4281a1954bd007cdd44297a6ba741b35438 100644
--- a/tools/perf/metrics/timeline.py
+++ b/tools/perf/metrics/timeline.py
@@ -11,6 +11,18 @@ from telemetry.page import page_measurement
TRACING_MODE = 'tracing-mode'
TIMELINE_MODE = 'timeline-mode'
+# All tracing categories not disabled-by-default
+DEFAULT_TRACE_CATEGORIES = None
+
+# Categories for absolute minimum overhead tracing. This contains no
+# sub-traces of thread tasks, so it's only useful for capturing the
+# cpu-time spent on threads (as well as needed benchmark traces)
+MINIMAL_TRACE_CATEGORIES = ("toplevel,"
+ "benchmark,"
+ "cc-benchmark,"
+ "webkit.console,"
+ "trace_event_overhead")
+
class MissingFramesError(page_measurement.MeasurementFailure):
def __init__(self):
@@ -24,6 +36,7 @@ class TimelineMetric(Metric):
"""
super(TimelineMetric, self).__init__()
assert mode in (TRACING_MODE, TIMELINE_MODE)
+ self.trace_categories = DEFAULT_TRACE_CATEGORIES
self._mode = mode
self._model = None
self._renderer_process = None
@@ -39,7 +52,7 @@ class TimelineMetric(Metric):
if self._mode == TRACING_MODE:
if not tab.browser.supports_tracing:
raise Exception('Not supported')
- tab.browser.StartTracing()
+ tab.browser.StartTracing(self.trace_categories)
else:
assert self._mode == TIMELINE_MODE
tab.StartTimelineRecording()
@@ -283,6 +296,7 @@ class ThreadTimesTimelineMetric(TimelineMetric):
super(ThreadTimesTimelineMetric, self).__init__(TRACING_MODE)
self.results_to_report = AllThreads
self.details_to_report = NoThreads
+ self.trace_categories = MINIMAL_TRACE_CATEGORIES
def CountSlices(self, slices, substring):
count = 0
« base/message_loop/message_loop.cc ('K') | « ipc/ipc_sync_channel.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698