Chromium Code Reviews| 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() |