| OLD | NEW |
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2014 the V8 project authors. All rights reserved. | 2 # Copyright 2014 the V8 project 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 """ | 6 """ |
| 7 Performance runner for d8. | 7 Performance runner for d8. |
| 8 | 8 |
| 9 Call e.g. with tools/run-perf.py --arch ia32 some_suite.json | 9 Call e.g. with tools/run-perf.py --arch ia32 some_suite.json |
| 10 | 10 |
| (...skipping 516 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 527 if file_on_host in self.pushed: | 527 if file_on_host in self.pushed: |
| 528 return | 528 return |
| 529 else: | 529 else: |
| 530 self.pushed.add(file_on_host) | 530 self.pushed.add(file_on_host) |
| 531 | 531 |
| 532 logging.info("adb push %s %s" % (file_on_host, file_on_device)) | 532 logging.info("adb push %s %s" % (file_on_host, file_on_device)) |
| 533 self.adb.Push(file_on_host, file_on_device) | 533 self.adb.Push(file_on_host, file_on_device) |
| 534 | 534 |
| 535 def PreTests(self, node, path): | 535 def PreTests(self, node, path): |
| 536 suite_dir = os.path.abspath(os.path.dirname(path)) | 536 suite_dir = os.path.abspath(os.path.dirname(path)) |
| 537 bench_dir = os.path.join(suite_dir, | 537 if node.path: |
| 538 os.path.normpath(os.path.join(*node.path))) | 538 bench_dir = os.path.join(suite_dir, |
| 539 os.path.normpath(os.path.join(*node.path))) |
| 540 else: |
| 541 bench_dir = suite_dir |
| 539 | 542 |
| 540 self._PushFile(self.shell_dir, node.binary) | 543 self._PushFile(self.shell_dir, node.binary) |
| 541 if isinstance(node, Runnable): | 544 if isinstance(node, Runnable): |
| 542 self._PushFile(bench_dir, node.main) | 545 self._PushFile(bench_dir, node.main) |
| 543 for resource in node.resources: | 546 for resource in node.resources: |
| 544 self._PushFile(bench_dir, resource) | 547 self._PushFile(bench_dir, resource) |
| 545 | 548 |
| 546 def Run(self, runnable, count): | 549 def Run(self, runnable, count): |
| 547 cache = cache_control.CacheControl(self.device) | 550 cache = cache_control.CacheControl(self.device) |
| 548 cache.DropRamCaches() | 551 cache.DropRamCaches() |
| (...skipping 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 660 | 663 |
| 661 if options.json_test_results: | 664 if options.json_test_results: |
| 662 results.WriteToFile(options.json_test_results) | 665 results.WriteToFile(options.json_test_results) |
| 663 else: # pragma: no cover | 666 else: # pragma: no cover |
| 664 print results | 667 print results |
| 665 | 668 |
| 666 return min(1, len(results.errors)) | 669 return min(1, len(results.errors)) |
| 667 | 670 |
| 668 if __name__ == "__main__": # pragma: no cover | 671 if __name__ == "__main__": # pragma: no cover |
| 669 sys.exit(Main(sys.argv[1:])) | 672 sys.exit(Main(sys.argv[1:])) |
| OLD | NEW |