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

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

Issue 171013006: Telemetry: Use mimimum tracing for timeline benchmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « base/message_loop/message_loop.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..90033d188768bd6ad88692ca7f68c85146114782 100644
--- a/tools/perf/metrics/timeline.py
+++ b/tools/perf/metrics/timeline.py
@@ -11,6 +11,17 @@ 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)
+# "disabled-by-default-topall,"
ernstm 2014/02/19 22:18:16 In the comment: disabled-by-default-topall -> disa
+MINIMAL_TRACE_CATEGORIES = ("disabled-by-default-poll_cpu,"
+ "benchmark,"
+ "webkit.console,"
+ "trace_event_overhead")
class MissingFramesError(page_measurement.MeasurementFailure):
def __init__(self):
@@ -24,6 +35,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 +51,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()
@@ -281,8 +293,29 @@ class ResultsForThread(object):
class ThreadTimesTimelineMetric(TimelineMetric):
def __init__(self):
super(ThreadTimesTimelineMetric, self).__init__(TRACING_MODE)
- self.results_to_report = AllThreads
- self.details_to_report = NoThreads
+ # Minimal traces, for minimum noise in CPU-time measurements.
+ self.trace_categories = MINIMAL_TRACE_CATEGORIES
+ self._results_to_report = AllThreads
+ self._details_to_report = NoThreads
+
+ @property
+ def results_to_report(self):
+ return self._results_to_report
+
+ @results_to_report.setter
+ def results_to_report(self, results_to_report):
+ self._results_to_report = results_to_report
+
+ @property
+ def details_to_report(self):
+ return self._details_to_report
+
+ @details_to_report.setter
+ def details_to_report(self, details_to_report):
+ self._details_to_report = details_to_report
+ # We need the other traces in order to have any details to report.
+ if not details_to_report == NoThreads:
+ self.trace_categories = DEFAULT_TRACE_CATEGORIES
def CountSlices(self, slices, substring):
count = 0
@@ -322,9 +355,9 @@ class ThreadTimesTimelineMetric(TimelineMetric):
# Report the desired results and details.
for thread_results in thread_category_results.values():
- if thread_results.name in self.results_to_report:
+ if thread_results.name in self._results_to_report:
thread_results.AddResults(num_frames, results)
# TOOD(nduca): When generic results objects are done, this special case
# can be replaced with a generic UI feature.
- if thread_results.name in self.details_to_report:
+ if thread_results.name in self._details_to_report:
thread_results.AddDetailedResults(num_frames, results)
« no previous file with comments | « base/message_loop/message_loop.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698