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

Unified Diff: tools/perf/measurements/rasterize_and_record.py

Issue 23902027: telemetry: Make trace profiler work with trace-based benchmarks. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 7 years, 3 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 | « no previous file | tools/perf/measurements/smoothness.py » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: tools/perf/measurements/rasterize_and_record.py
diff --git a/tools/perf/measurements/rasterize_and_record.py b/tools/perf/measurements/rasterize_and_record.py
index 4ed5a0942e0808f28f9c0fc9cac36980f07bc3a7..92b2f65c1d305bfdb755bc497a81a63a6c5740d5 100644
--- a/tools/perf/measurements/rasterize_and_record.py
+++ b/tools/perf/measurements/rasterize_and_record.py
@@ -148,7 +148,11 @@ class RasterizeAndRecord(page_measurement.PageMeasurement):
});
""")
- tab.browser.StartTracing('webkit,webkit.console,benchmark', 60)
+ # We don't need to start tracing, if a trace profiler is already running.
+ # Note that all trace event categories are enabled in this case, which
+ # increases the risk of a trace buffer overflow.
+ if self.options.profiler != 'trace':
tonyg 2013/09/11 21:31:44 Making this Measurement aware of profilers which a
+ tab.browser.StartTracing('webkit.console,benchmark', 60)
self._metrics.Start()
tab.ExecuteJavaScript("""
@@ -166,10 +170,17 @@ class RasterizeAndRecord(page_measurement.PageMeasurement):
time.sleep(float(self.options.stop_wait_time))
tab.ExecuteJavaScript('console.timeEnd("measureNextFrame")')
+ # Always stop tracing at this point. If a trace profiler is running, it will
+ # be stopped here.
tab.browser.StopTracing()
self._metrics.Stop()
- timeline = tab.browser.GetTraceResultAndReset().AsTimelineModel()
+ # Fetch the results without resetting, if a trace profiler is running. The
+ # profiler needs to read the results later on.
+ if self.options.profiler == 'trace':
+ timeline = tab.browser.GetTraceResult().AsTimelineModel()
+ else:
+ timeline = tab.browser.GetTraceResultAndReset().AsTimelineModel()
collector = StatsCollector(timeline)
collector.GatherRenderingStats()
« no previous file with comments | « no previous file | tools/perf/measurements/smoothness.py » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698