| 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 565 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 576 | 576 |
| 577 def PreTests(self, node, path): | 577 def PreTests(self, node, path): |
| 578 suite_dir = os.path.abspath(os.path.dirname(path)) | 578 suite_dir = os.path.abspath(os.path.dirname(path)) |
| 579 if node.path: | 579 if node.path: |
| 580 bench_rel = os.path.normpath(os.path.join(*node.path)) | 580 bench_rel = os.path.normpath(os.path.join(*node.path)) |
| 581 bench_abs = os.path.join(suite_dir, bench_rel) | 581 bench_abs = os.path.join(suite_dir, bench_rel) |
| 582 else: | 582 else: |
| 583 bench_rel = "." | 583 bench_rel = "." |
| 584 bench_abs = suite_dir | 584 bench_abs = suite_dir |
| 585 | 585 |
| 586 self._PushFile(self.shell_dir, node.binary) | 586 self._PushFile(self.shell_dir, node.binary, "bin") |
| 587 | 587 |
| 588 # Push external startup data. Backwards compatible for revisions where | 588 # Push external startup data. Backwards compatible for revisions where |
| 589 # these files didn't exist. | 589 # these files didn't exist. |
| 590 self._PushFile(self.shell_dir, "natives_blob.bin", skip_if_missing=True) | 590 self._PushFile( |
| 591 self._PushFile(self.shell_dir, "snapshot_blob.bin", skip_if_missing=True) | 591 self.shell_dir, |
| 592 "natives_blob.bin", |
| 593 "bin", |
| 594 skip_if_missing=True, |
| 595 ) |
| 596 self._PushFile( |
| 597 self.shell_dir, |
| 598 "snapshot_blob.bin", |
| 599 "bin", |
| 600 skip_if_missing=True, |
| 601 ) |
| 592 | 602 |
| 593 if isinstance(node, Runnable): | 603 if isinstance(node, Runnable): |
| 594 self._PushFile(bench_abs, node.main, bench_rel) | 604 self._PushFile(bench_abs, node.main, bench_rel) |
| 595 for resource in node.resources: | 605 for resource in node.resources: |
| 596 self._PushFile(bench_abs, resource, bench_rel) | 606 self._PushFile(bench_abs, resource, bench_rel) |
| 597 | 607 |
| 598 def Run(self, runnable, count): | 608 def Run(self, runnable, count): |
| 599 cache = cache_control.CacheControl(self.device) | 609 cache = cache_control.CacheControl(self.device) |
| 600 cache.DropRamCaches() | 610 cache.DropRamCaches() |
| 601 binary_on_device = AndroidPlatform.DEVICE_DIR + runnable.binary | 611 binary_on_device = os.path.join( |
| 612 AndroidPlatform.DEVICE_DIR, "bin", runnable.binary) |
| 602 cmd = [binary_on_device] + runnable.GetCommandFlags(self.extra_flags) | 613 cmd = [binary_on_device] + runnable.GetCommandFlags(self.extra_flags) |
| 603 | 614 |
| 604 # Relative path to benchmark directory. | 615 # Relative path to benchmark directory. |
| 605 if runnable.path: | 616 if runnable.path: |
| 606 bench_rel = os.path.normpath(os.path.join(*runnable.path)) | 617 bench_rel = os.path.normpath(os.path.join(*runnable.path)) |
| 607 else: | 618 else: |
| 608 bench_rel = "." | 619 bench_rel = "." |
| 609 | 620 |
| 610 try: | 621 try: |
| 611 output = self.device.RunShellCommand( | 622 output = self.device.RunShellCommand( |
| (...skipping 104 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 716 | 727 |
| 717 if options.json_test_results: | 728 if options.json_test_results: |
| 718 results.WriteToFile(options.json_test_results) | 729 results.WriteToFile(options.json_test_results) |
| 719 else: # pragma: no cover | 730 else: # pragma: no cover |
| 720 print results | 731 print results |
| 721 | 732 |
| 722 return min(1, len(results.errors)) | 733 return min(1, len(results.errors)) |
| 723 | 734 |
| 724 if __name__ == "__main__": # pragma: no cover | 735 if __name__ == "__main__": # pragma: no cover |
| 725 sys.exit(Main(sys.argv[1:])) | 736 sys.exit(Main(sys.argv[1:])) |
| OLD | NEW |