summaryrefslogtreecommitdiffstats
path: root/tools
diff options
context:
space:
mode:
authorernstm@chromium.org <ernstm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-05 22:03:06 +0000
committerernstm@chromium.org <ernstm@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-08-05 22:03:06 +0000
commit8758b27b6da1c7752efc3c66146dd70ed48c338c (patch)
treeedc5d3df6e5fad255a2269f849fddc6a85852e3e /tools
parent4e8c49a8a0f513c8a35040d0f2b7d7420892141e (diff)
downloadchromium_src-8758b27b6da1c7752efc3c66146dd70ed48c338c.zip
chromium_src-8758b27b6da1c7752efc3c66146dd70ed48c338c.tar.gz
chromium_src-8758b27b6da1c7752efc3c66146dd70ed48c338c.tar.bz2
telemetry: Analyze events only from Renderer process in rasterize_and_record.
- rasterize_and_record got confused on Android because of UpdateLayer events from the browser compositor. - Fixed by analyzing events only from the Renderer process in the benchmark. R=tengs@chromium.org,tomhudson@chromium.org BUG=265907 Review URL: https://chromiumcodereview.appspot.com/21938005 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@215701 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'tools')
-rw-r--r--tools/perf/measurements/rasterize_and_record.py25
-rw-r--r--tools/telemetry/telemetry/core/timeline/process.py5
-rw-r--r--tools/telemetry/telemetry/core/timeline/thread.py6
-rw-r--r--tools/telemetry/telemetry/core/timeline/trace_event_importer.py3
4 files changed, 29 insertions, 10 deletions
diff --git a/tools/perf/measurements/rasterize_and_record.py b/tools/perf/measurements/rasterize_and_record.py
index 600774e..0cab742e 100644
--- a/tools/perf/measurements/rasterize_and_record.py
+++ b/tools/perf/measurements/rasterize_and_record.py
@@ -19,17 +19,21 @@ class StatsCollector(object):
self.total_best_record_time = 0
self.total_pixels_rasterized = 0
self.total_pixels_recorded = 0
-
- def FindTriggerTime(self):
- measure_next_frame_event = self.timeline.GetAllEventsOfName(
- "measureNextFrame")
- if len(measure_next_frame_event) == 0:
+ self.trigger_event = self.FindTriggerEvent()
+ self.renderer_process = self.trigger_event.start_thread.parent
+
+ def FindTriggerEvent(self):
+ events = [s for
+ s in self.timeline.GetAllEventsOfName(
+ 'measureNextFrame')
+ if s.parent_slice == None]
+ if len(events) != 1:
raise LookupError, 'no measureNextFrame event found'
- return measure_next_frame_event[0].start
+ return events[0]
def FindFrameNumber(self, trigger_time):
start_event = None
- for event in self.timeline.GetAllEventsOfName(
+ for event in self.renderer_process.IterAllSlicesOfName(
"LayerTreeHost::UpdateLayers"):
if event.start > trigger_time:
if start_event == None:
@@ -42,7 +46,7 @@ class StatsCollector(object):
return start_event.args["source_frame_number"]
def GatherRasterizeStats(self, frame_number):
- for event in self.timeline.GetAllEventsOfName(
+ for event in self.renderer_process.IterAllSlicesOfName(
"RasterWorkerPoolTaskImpl::RunRasterOnThread"):
if event.args["data"]["source_frame_number"] == frame_number:
for raster_loop_event in event.GetAllSubSlicesOfName("RasterLoop"):
@@ -59,7 +63,8 @@ class StatsCollector(object):
self.total_best_rasterize_time += best_rasterize_time
def GatherRecordStats(self, frame_number):
- for event in self.timeline.GetAllEventsOfName("PictureLayer::Update"):
+ for event in self.renderer_process.IterAllSlicesOfName(
+ "PictureLayer::Update"):
if event.args["source_frame_number"] == frame_number:
for record_loop_event in event.GetAllSubSlicesOfName("RecordLoop"):
best_record_time = float('inf')
@@ -74,7 +79,7 @@ class StatsCollector(object):
self.total_best_record_time += best_record_time
def GatherRenderingStats(self):
- trigger_time = self.FindTriggerTime()
+ trigger_time = self.trigger_event.start
frame_number = self.FindFrameNumber(trigger_time)
self.GatherRasterizeStats(frame_number)
self.GatherRecordStats(frame_number)
diff --git a/tools/telemetry/telemetry/core/timeline/process.py b/tools/telemetry/telemetry/core/timeline/process.py
index 5a26619..1b65d66 100644
--- a/tools/telemetry/telemetry/core/timeline/process.py
+++ b/tools/telemetry/telemetry/core/timeline/process.py
@@ -29,6 +29,11 @@ class Process(event_container.TimelineEventContainer):
for counter in self._counters.itervalues():
yield counter
+ def IterAllSlicesOfName(self, name):
+ for thread in self._threads.itervalues():
+ for s in thread.IterAllSlicesOfName(name):
+ yield s
+
def IterEventsInThisContainer(self):
return
yield # pylint: disable=W0101
diff --git a/tools/telemetry/telemetry/core/timeline/thread.py b/tools/telemetry/telemetry/core/timeline/thread.py
index 180532c..47194ac 100644
--- a/tools/telemetry/telemetry/core/timeline/thread.py
+++ b/tools/telemetry/telemetry/core/timeline/thread.py
@@ -52,6 +52,12 @@ class Thread(event_container.TimelineEventContainer):
yield s
for sub_slice in s.IterEventsInThisContainerRecrusively():
yield sub_slice
+
+ def IterAllSlicesOfName(self, name):
+ for s in self.IterAllSlices():
+ if s.name == name:
+ yield s
+
def IterAllAsyncSlices(self):
for async_slice in self._async_slices:
yield async_slice
diff --git a/tools/telemetry/telemetry/core/timeline/trace_event_importer.py b/tools/telemetry/telemetry/core/timeline/trace_event_importer.py
index 93664d7..aff6ec5 100644
--- a/tools/telemetry/telemetry/core/timeline/trace_event_importer.py
+++ b/tools/telemetry/telemetry/core/timeline/trace_event_importer.py
@@ -175,6 +175,9 @@ class TraceEventTimelineImporter(importer.TimelineImporter):
thread = (self._GetOrCreateProcess(event['pid'])
.GetOrCreateThread(event['tid']))
thread.name = event['args']['name']
+ if event['name'] == 'process_name':
+ process = self._GetOrCreateProcess(event['pid'])
+ process.name = event['args']['name']
else:
self._model.import_errors.append(
'Unrecognized metadata name: ' + event['name'])