diff options
author | csmartdalton <csmartdalton@google.com> | 2016-11-09 13:25:23 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2016-11-09 13:25:24 -0800 |
commit | f2b024db6777a904d986c68a21ba0bc41f956f6e (patch) | |
tree | 4be4d6c6eead649f199f945bbeb56409ada95f61 /tools/skpbench | |
parent | 072a198656b80f8f713aaa8d917436a58190e439 (diff) |
skpbench: filter out junk spewed by Pixel C driver
BUG=skia:
GOLD_TRYBOT_URL= https://gold.skia.org/search?issue=2488043003
Review-Url: https://codereview.chromium.org/2488043003
Diffstat (limited to 'tools/skpbench')
-rw-r--r-- | tools/skpbench/_hardware.py | 4 | ||||
-rw-r--r-- | tools/skpbench/_hardware_pixel_c.py | 5 | ||||
-rwxr-xr-x | tools/skpbench/skpbench.py | 12 |
3 files changed, 16 insertions, 5 deletions
diff --git a/tools/skpbench/_hardware.py b/tools/skpbench/_hardware.py index 525c4c1e49..de8848df78 100644 --- a/tools/skpbench/_hardware.py +++ b/tools/skpbench/_hardware.py @@ -29,6 +29,10 @@ class Hardware: def __exit__(self, exception_type, exception_value, traceback): pass + def filter_line(self, line): + """Returns False if the provided output line can be suppressed.""" + return True + def sanity_check(self): """Raises a HardwareException if any hardware state is not as expected.""" pass diff --git a/tools/skpbench/_hardware_pixel_c.py b/tools/skpbench/_hardware_pixel_c.py index 47f3ec4b0b..a1cd17a084 100644 --- a/tools/skpbench/_hardware_pixel_c.py +++ b/tools/skpbench/_hardware_pixel_c.py @@ -23,6 +23,11 @@ class HardwarePixelC(HardwareAndroid): exception_value, exception_traceback) self._unlock_clocks() + def filter_line(self, line): + JUNK = ['NvRmPrivGetChipPlatform: Could not read platform information', + 'Expected on kernels without fuse support, using silicon'] + return False if line in JUNK else HardwareAndroid.filter_line(self, line) + def _lock_clocks(self): if not self._adb.is_root(): return diff --git a/tools/skpbench/skpbench.py b/tools/skpbench/skpbench.py index fc5082b94e..907d193d4e 100755 --- a/tools/skpbench/skpbench.py +++ b/tools/skpbench/skpbench.py @@ -129,9 +129,10 @@ class SKPBench: '--config', 'gpu', '--skp', 'warmup'] dump_commandline_if_verbose(commandline) - output = subprocess.check_output(commandline).decode('utf-8') + output = subprocess.check_output(commandline, stderr=subprocess.STDOUT) + # validate the warmup run output. - for line in output.split('\n'): + for line in output.decode('utf-8').split('\n'): match = BenchResult.match(line.rstrip()) if match and match.bench == 'warmup': return @@ -168,7 +169,8 @@ class SKPBench: _path.basename(self.skp) + '.png') commandline.extend(['--png', pngfile]) dump_commandline_if_verbose(commandline) - self._proc = subprocess.Popen(commandline, stdout=subprocess.PIPE) + self._proc = subprocess.Popen(commandline, stdout=subprocess.PIPE, + stderr=subprocess.STDOUT) self._monitor = SubprocessMonitor(self._queue, self._proc) self._monitor.start() @@ -179,9 +181,8 @@ class SKPBench: if result: hardware.sanity_check() self._process_result(result) - else: + elif hardware.filter_line(message.value): print(message.value, file=sys.stderr) - sys.stdout.flush() continue if message.message == Message.POLL_HARDWARE: hardware.sanity_check() @@ -211,6 +212,7 @@ class SKPBench: "(%s%% instead of %s%%)." % (result.config, result.bench, self.best_result.stddev, result.stddev), file=sys.stderr) + sys.stdout.flush() if self.max_stddev and self.best_result.stddev > self.max_stddev: raise StddevException() |