1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-04-20 17:50:49 +01:00

exoplayer: Add metric for dropped frames

This commit is contained in:
Brendan Jackman 2017-09-21 13:35:11 +01:00 committed by setrofim
parent b17a0d30c0
commit df2ae3c451

View File

@ -29,9 +29,10 @@ from devlib.utils.android import grant_app_permissions
# Regexps for benchmark synchronization # Regexps for benchmark synchronization
REGEXPS = { REGEXPS = {
'start' : '.*Displayed com.google.android.exoplayer2.demo/.PlayerActivity', 'start' : '.*Displayed com.google.android.exoplayer2.demo/.PlayerActivity',
'duration' : '.*period \[(?P<duration>[0-9]+.*)\]', 'duration' : '.*period \[(?P<duration>[0-9]+.*)\]',
'end' : '.*state \[.+, .+, E\]' 'end' : '.*state \[.+, .+, E\]',
'dropped_frames': '.*droppedFrames \[(?P<session_time>[0-9]+\.[0-9]+), (?P<count>[0-9]+)\]'
} }
@ -57,6 +58,10 @@ class ExoPlayer(ApkWorkload):
loading the ExoPlayer sources into Android Studio. loading the ExoPlayer sources into Android Studio.
Version r2.4.0 built from commit d979469 is known to work Version r2.4.0 built from commit d979469 is known to work
Produces a metric 'exoplayer_dropped_frames' - this is the count of frames
that Exoplayer itself reports as dropped. This is not the same thing as the
dropped frames reported by gfxinfo.
""" """
name = 'exoplayer' name = 'exoplayer'
@ -182,6 +187,18 @@ class ExoPlayer(ApkWorkload):
.format(media_duration_s)) .format(media_duration_s))
self.monitor.wait_for(REGEXPS['end'], timeout = media_duration_s + 30) self.monitor.wait_for(REGEXPS['end'], timeout = media_duration_s + 30)
def update_output(self, context):
regex = re.compile(REGEXPS['dropped_frames'])
dropped_frames = 0
for line in self.monitor.get_log():
match = regex.match(line)
if match:
dropped_frames += int(match.group('count'))
context.add_metric('exoplayer_dropped_frames', dropped_frames,
lower_is_better=True)
def teardown(self, context): def teardown(self, context):
super(ExoPlayer, self).teardown(context) super(ExoPlayer, self).teardown(context)
self.monitor.stop() self.monitor.stop()