diff options
author | Marc Bonnici <marc.bonnici@arm.com> | 2018-11-19 15:12:36 +0000 |
---|---|---|
committer | setrofim <setrofim@gmail.com> | 2018-11-20 10:10:19 +0000 |
commit | e4283729c18ab5c1a42b65f093fd3b4ba007f642 (patch) | |
tree | b62df502fb367484d6a2071669275e1580450867 /wa/workloads | |
parent | a2eb6e96e2a5e3bbba4cb26f786f792177eac078 (diff) |
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'.
Diffstat (limited to 'wa/workloads')
-rwxr-xr-x | wa/workloads/gfxbench/__init__.py | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/wa/workloads/gfxbench/__init__.py b/wa/workloads/gfxbench/__init__.py index b34ece26..d640f558 100755 --- a/wa/workloads/gfxbench/__init__.py +++ b/wa/workloads/gfxbench/__init__.py @@ -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) |