Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(11)

Side by Side Diff: tools/try_perf.py

Issue 1479483003: [test] Make try-perf script more convenient to use. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 import argparse 6 import argparse
7 import os 7 import os
8 import subprocess 8 import subprocess
9 import sys 9 import sys
10 10
11 BOTS = { 11 BOTS = {
12 '--arm32': 'v8_arm32_perf_try', 12 '--arm32': 'v8_arm32_perf_try',
13 '--linux32': 'v8_linux32_perf_try', 13 '--linux32': 'v8_linux32_perf_try',
14 '--linux64': 'v8_linux64_perf_try', 14 '--linux64': 'v8_linux64_perf_try',
15 '--linux64_atom': 'v8_linux64_atom_perf_try', 15 '--linux64_atom': 'v8_linux64_atom_perf_try',
16 '--linux64_haswell': 'v8_linux64_haswell_perf_try', 16 '--linux64_haswell': 'v8_linux64_haswell_perf_try',
17 '--nexus5': 'v8_nexus5_perf_try', 17 '--nexus5': 'v8_nexus5_perf_try',
18 '--nexus7': 'v8_nexus7_perf_try', 18 '--nexus7': 'v8_nexus7_perf_try',
19 '--nexus9': 'v8_nexus9_perf_try', 19 '--nexus9': 'v8_nexus9_perf_try',
20 '--nexus10': 'v8_nexus10_perf_try', 20 '--nexus10': 'v8_nexus10_perf_try',
21 } 21 }
22 22
23 DEFAULT_BOTS = [ 23 DEFAULT_BOTS = [
24 'v8_arm32_perf_try', 24 'v8_arm32_perf_try',
25 'v8_linux32_perf_try', 25 'v8_linux32_perf_try',
26 'v8_linux64_haswell_perf_try', 26 'v8_linux64_haswell_perf_try',
27 'v8_nexus10_perf_try', 27 'v8_nexus10_perf_try',
28 ] 28 ]
29 29
30 PUBLIC_BENCHMARKS = [
31 'arewefastyet',
32 'embenchen',
33 'emscripten',
34 'compile',
35 'jetstream',
36 'jsbench',
37 'jstests',
38 'kraken_orig',
39 'massive',
40 'memory',
41 'octane',
42 'octane-pr',
43 'octane-tf',
44 'octane-tf-pr',
45 'simdjs',
46 'sunspider',
47 ]
48
30 V8_BASE = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) 49 V8_BASE = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
31 50
32 def main(): 51 def main():
33 parser = argparse.ArgumentParser(description='') 52 parser = argparse.ArgumentParser(description='')
34 parser.add_argument('benchmarks', nargs='+', help='The benchmarks to run.') 53 parser.add_argument('benchmarks', nargs='+', help='The benchmarks to run.')
35 parser.add_argument('--extra-flags', default='', 54 parser.add_argument('--extra-flags', default='',
36 help='Extra flags to be passed to the executable.') 55 help='Extra flags to be passed to the executable.')
37 for option in sorted(BOTS): 56 for option in sorted(BOTS):
38 parser.add_argument( 57 parser.add_argument(
39 option, dest='bots', action='append_const', const=BOTS[option], 58 option, dest='bots', action='append_const', const=BOTS[option],
40 help='Add %s trybot.' % BOTS[option]) 59 help='Add %s trybot.' % BOTS[option])
41 options = parser.parse_args() 60 options = parser.parse_args()
42 if not options.bots: 61 if not options.bots:
43 print 'No trybots specified. Using default %s.' % ','.join(DEFAULT_BOTS) 62 print 'No trybots specified. Using default %s.' % ','.join(DEFAULT_BOTS)
44 options.bots = DEFAULT_BOTS 63 options.bots = DEFAULT_BOTS
45 64
46 if not options.benchmarks: 65 if not options.benchmarks:
47 print 'Please specify the benchmarks to run as arguments.' 66 print 'Please specify the benchmarks to run as arguments.'
48 return 1 67 return 1
49 68
69 for benchmark in options.benchmarks:
70 if benchmark not in PUBLIC_BENCHMARKS:
71 print ('%s not found in our benchmark list. The respective trybot might '
72 'fail, unless you run something this script isn\'t aware of. '
73 'Available public benchmarks: %s' % (benchmark, PUBLIC_BENCHMARKS))
74 print 'Proceed anyways? [Y/n] ',
75 answer = sys.stdin.readline().strip()
76 if answer != "" and answer != "Y" and answer != "y":
77 return 1
78
50 assert '"' not in options.extra_flags and '\'' not in options.extra_flags, ( 79 assert '"' not in options.extra_flags and '\'' not in options.extra_flags, (
51 'Invalid flag specification.') 80 'Invalid flag specification.')
52 81
53 # Ensure depot_tools are updated. 82 # Ensure depot_tools are updated.
54 subprocess.check_output( 83 subprocess.check_output(
55 'gclient', shell=True, stderr=subprocess.STDOUT, cwd=V8_BASE) 84 'gclient', shell=True, stderr=subprocess.STDOUT, cwd=V8_BASE)
56 85
57 cmd = ['git cl try -m internal.client.v8'] 86 cmd = ['git cl try -m internal.client.v8']
58 cmd += ['-b %s' % bot for bot in options.bots] 87 cmd += ['-b %s' % bot for bot in options.bots]
59 benchmarks = ['"%s"' % benchmark for benchmark in options.benchmarks] 88 benchmarks = ['"%s"' % benchmark for benchmark in options.benchmarks]
60 cmd += ['-p \'testfilter=[%s]\'' % ','.join(benchmarks)] 89 cmd += ['-p \'testfilter=[%s]\'' % ','.join(benchmarks)]
61 if options.extra_flags: 90 if options.extra_flags:
62 cmd += ['-p \'extra_flags="%s"\'' % options.extra_flags] 91 cmd += ['-p \'extra_flags="%s"\'' % options.extra_flags]
63 subprocess.check_call(' '.join(cmd), shell=True, cwd=V8_BASE) 92 subprocess.check_call(' '.join(cmd), shell=True, cwd=V8_BASE)
64 93
65 94
66 if __name__ == '__main__': # pragma: no cover 95 if __name__ == '__main__': # pragma: no cover
67 sys.exit(main()) 96 sys.exit(main())
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698