| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. | 2 # Copyright (c) 2013 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 """ Run the Skia bench_pictures executable. """ | 6 """ Run the Skia bench_pictures executable. """ |
| 7 | 7 |
| 8 from build_step import BuildStep | 8 from build_step import BuildStep |
| 9 from run_bench import BenchArgs, GetSvnRevision | 9 from run_bench import BenchArgs |
| 10 import os | 10 import os |
| 11 import sys | 11 import sys |
| 12 | 12 |
| 13 | 13 |
| 14 BENCH_REPEAT_COUNT = 20 | 14 BENCH_REPEAT_COUNT = 20 |
| 15 | 15 |
| 16 | 16 |
| 17 class BenchPictures(BuildStep): | 17 class BenchPictures(BuildStep): |
| 18 def __init__(self, timeout=16800, no_output_timeout=16800, **kwargs): | 18 def __init__(self, timeout=16800, no_output_timeout=16800, **kwargs): |
| 19 super(BenchPictures, self).__init__(timeout=timeout, | 19 super(BenchPictures, self).__init__(timeout=timeout, |
| 20 no_output_timeout=no_output_timeout, | 20 no_output_timeout=no_output_timeout, |
| 21 **kwargs) | 21 **kwargs) |
| 22 | 22 |
| 23 # pylint: disable=W0221 | 23 # pylint: disable=W0221 |
| 24 def _BuildDataFile(self, args): | 24 def _BuildDataFile(self, args): |
| 25 filename = '_'.join(['bench', 'r%s' % GetSvnRevision(self._got_revision), | 25 filename = '_'.join(['bench', self._got_revision, |
| 26 'data', 'skp'] + args) | 26 'data', 'skp'] + args) |
| 27 full_path = os.path.join(self._device_dirs.PerfDir(), | 27 full_path = os.path.join(self._device_dirs.PerfDir(), |
| 28 filename.replace('-', '').replace(':', '-')) | 28 filename.replace('-', '').replace(':', '-')) |
| 29 return full_path | 29 return full_path |
| 30 | 30 |
| 31 def _DoBenchPictures(self, args): | 31 def _DoBenchPictures(self, args): |
| 32 arguments = ['-r', self._device_dirs.SKPDir()] + args | 32 arguments = ['-r', self._device_dirs.SKPDir()] + args |
| 33 if self._perf_data_dir: | 33 if self._perf_data_dir: |
| 34 arguments.extend(BenchArgs(data_file=self._BuildDataFile(args))) | 34 arguments.extend(BenchArgs(data_file=self._BuildDataFile(args))) |
| 35 # For bench_pictures we use the --repeat and --logPerIter flags so that we | 35 # For bench_pictures we use the --repeat and --logPerIter flags so that we |
| (...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 71 self._DoBenchPictures(args) | 71 self._DoBenchPictures(args) |
| 72 except Exception as e: | 72 except Exception as e: |
| 73 print e | 73 print e |
| 74 errors.append(e) | 74 errors.append(e) |
| 75 if errors: | 75 if errors: |
| 76 raise errors[0] | 76 raise errors[0] |
| 77 | 77 |
| 78 | 78 |
| 79 if '__main__' == __name__: | 79 if '__main__' == __name__: |
| 80 sys.exit(BuildStep.RunBuildStep(BenchPictures)) | 80 sys.exit(BuildStep.RunBuildStep(BenchPictures)) |
| OLD | NEW |