1
0
mirror of https://github.com/ARM-software/workload-automation.git synced 2025-01-31 02:01:16 +00:00

workloads/gfxbenchmark: Fix score matching

On some devices the score string obtained can contain extra characters.
Only use the numerical values from the score when converting, otherwise
if not found set the result to 'NaN'.
This commit is contained in:
Marc Bonnici 2018-11-19 15:12:36 +00:00 committed by setrofim
parent a2eb6e96e2
commit e4283729c1

View File

@ -29,6 +29,7 @@ class Gfxbench(ApkUiautoWorkload):
re.compile(r'1440p Manhattan 3.1 Offscreen score (.+)'),
re.compile(r'Tessellation score (.+)'),
re.compile(r'Tessellation Offscreen score (.+)')]
score_regex = re.compile(r'.*?([\d.]+).*')
description = '''
Execute a subset of graphical performance benchmarks
@ -55,10 +56,13 @@ class Gfxbench(ApkUiautoWorkload):
for line in fh:
for regex in self.regex_matches:
match = regex.search(line)
# Check if we have matched the score string in logcat
if match:
try:
result = float(match.group(1))
except ValueError:
score_match = self.score_regex.search(match.group(1))
# Check if there is valid number found for the score.
if score_match:
result = float(score_match.group(1))
else:
result = 'NaN'
entry = regex.pattern.rsplit(None, 1)[0]
context.add_metric(entry, result, 'FPS', lower_is_better=False)