| 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 498 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 509 def PreExecution(self): | 509 def PreExecution(self): |
| 510 perf = perf_control.PerfControl(self.device) | 510 perf = perf_control.PerfControl(self.device) |
| 511 perf.SetHighPerfMode() | 511 perf.SetHighPerfMode() |
| 512 | 512 |
| 513 # Remember what we have already pushed to the device. | 513 # Remember what we have already pushed to the device. |
| 514 self.pushed = set() | 514 self.pushed = set() |
| 515 | 515 |
| 516 def PostExecution(self): | 516 def PostExecution(self): |
| 517 perf = perf_control.PerfControl(self.device) | 517 perf = perf_control.PerfControl(self.device) |
| 518 perf.SetDefaultPerfMode() | 518 perf.SetDefaultPerfMode() |
| 519 self.device.RunShellCommand( | 519 self.device.RunShellCommand(["rm", "-rf", AndroidPlatform.DEVICE_DIR]) |
| 520 ["rm", "-rf", "*"], | |
| 521 cwd=AndroidPlatform.DEVICE_DIR, | |
| 522 ) | |
| 523 | 520 |
| 524 def _PushFile(self, host_dir, file_name, target_rel="."): | 521 def _PushFile(self, host_dir, file_name, target_rel="."): |
| 525 file_on_host = os.path.join(host_dir, file_name) | 522 file_on_host = os.path.join(host_dir, file_name) |
| 526 file_on_device = os.path.join( | 523 file_on_device = os.path.join( |
| 527 AndroidPlatform.DEVICE_DIR, target_rel, file_name) | 524 AndroidPlatform.DEVICE_DIR, target_rel, file_name) |
| 528 | 525 |
| 529 # Only push files not yet pushed in one execution. | 526 # Only push files not yet pushed in one execution. |
| 530 if file_on_host in self.pushed: | 527 if file_on_host in self.pushed: |
| 531 return | 528 return |
| 532 else: | 529 else: |
| (...skipping 141 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 674 | 671 |
| 675 if options.json_test_results: | 672 if options.json_test_results: |
| 676 results.WriteToFile(options.json_test_results) | 673 results.WriteToFile(options.json_test_results) |
| 677 else: # pragma: no cover | 674 else: # pragma: no cover |
| 678 print results | 675 print results |
| 679 | 676 |
| 680 return min(1, len(results.errors)) | 677 return min(1, len(results.errors)) |
| 681 | 678 |
| 682 if __name__ == "__main__": # pragma: no cover | 679 if __name__ == "__main__": # pragma: no cover |
| 683 sys.exit(Main(sys.argv[1:])) | 680 sys.exit(Main(sys.argv[1:])) |
| OLD | NEW |