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

Side by Side Diff: tools/try_perf.py

Issue 1342263003: [test] Allow passing extra flags to perf tryjobs. (Closed) Base URL: https://chromium.googlesource.com/v8/v8.git@master
Patch Set: Created 5 years, 3 months 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
(...skipping 12 matching lines...) Expand all
23 'v8_arm32_perf_try', 23 'v8_arm32_perf_try',
24 'v8_linux32_perf_try', 24 'v8_linux32_perf_try',
25 'v8_linux64_haswell_perf_try', 25 'v8_linux64_haswell_perf_try',
26 'v8_nexus10_perf_try', 26 'v8_nexus10_perf_try',
27 ] 27 ]
28 28
29 V8_BASE = os.path.abspath(os.path.dirname(os.path.dirname(__file__))) 29 V8_BASE = os.path.abspath(os.path.dirname(os.path.dirname(__file__)))
30 30
31 def main(): 31 def main():
32 parser = argparse.ArgumentParser(description='') 32 parser = argparse.ArgumentParser(description='')
33 parser.add_argument("benchmarks", nargs="+", help="The benchmarks to run.") 33 parser.add_argument('benchmarks', nargs='+', help='The benchmarks to run.')
34 parser.add_argument('--extra-flags', default='',
35 help='Extra flags to be passed to the executable.')
34 for option in sorted(BOTS): 36 for option in sorted(BOTS):
35 parser.add_argument( 37 parser.add_argument(
36 option, dest='bots', action='append_const', const=BOTS[option], 38 option, dest='bots', action='append_const', const=BOTS[option],
37 help='Add %s trybot.' % BOTS[option]) 39 help='Add %s trybot.' % BOTS[option])
38 options = parser.parse_args() 40 options = parser.parse_args()
39 if not options.bots: 41 if not options.bots:
40 print 'No trybots specified. Using default %s.' % ','.join(DEFAULT_BOTS) 42 print 'No trybots specified. Using default %s.' % ','.join(DEFAULT_BOTS)
41 options.bots = DEFAULT_BOTS 43 options.bots = DEFAULT_BOTS
42 44
43 if not options.benchmarks: 45 if not options.benchmarks:
44 print 'Please specify the benchmarks to run as arguments.' 46 print 'Please specify the benchmarks to run as arguments.'
45 return 1 47 return 1
46 48
49 assert '"' not in options.extra_flags and '\'' not in options.extra_flags, (
50 'Invalid flag specification.')
51
47 # Ensure depot_tools are updated. 52 # Ensure depot_tools are updated.
48 subprocess.check_output( 53 subprocess.check_output(
49 'gclient', shell=True, stderr=subprocess.STDOUT, cwd=V8_BASE) 54 'gclient', shell=True, stderr=subprocess.STDOUT, cwd=V8_BASE)
50 55
51 cmd = ['git cl try -m internal.client.v8'] 56 cmd = ['git cl try -m internal.client.v8']
52 cmd += ['-b %s' % bot for bot in options.bots] 57 cmd += ['-b %s' % bot for bot in options.bots]
53 benchmarks = ['"%s"' % benchmark for benchmark in options.benchmarks] 58 benchmarks = ['"%s"' % benchmark for benchmark in options.benchmarks]
54 cmd += ['-p \'testfilter=[%s]\'' % ','.join(benchmarks)] 59 cmd += ['-p \'testfilter=[%s]\'' % ','.join(benchmarks)]
60 if options.extra_flags:
61 cmd += ['-p \'extra_flags="%s"\'' % options.extra_flags]
55 subprocess.check_call(' '.join(cmd), shell=True, cwd=V8_BASE) 62 subprocess.check_call(' '.join(cmd), shell=True, cwd=V8_BASE)
56 63
57 64
58 if __name__ == "__main__": # pragma: no cover 65 if __name__ == '__main__': # pragma: no cover
59 sys.exit(main()) 66 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