OLD | NEW |
1 # | 1 # |
2 # Copyright 2015 Google Inc. | 2 # Copyright 2015 Google Inc. |
3 # | 3 # |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 # | 6 # |
7 | 7 |
8 #!/usr/bin/env python | 8 #!/usr/bin/env python |
9 | 9 |
10 usage = ''' | 10 usage = ''' |
11 Write extra flags to outfile for DM based on the bot name: | 11 Write extra flags to outfile for DM based on the bot name: |
12 $ python dm_flags.py outfile Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug | 12 $ python dm_flags.py outfile Test-Ubuntu-GCC-GCE-CPU-AVX2-x86-Debug |
13 Or run self-tests: | 13 Or run self-tests: |
14 $ python dm_flags.py test | 14 $ python dm_flags.py test |
15 ''' | 15 ''' |
16 | 16 |
17 import inspect | 17 import inspect |
18 import json | 18 import json |
19 import os | 19 import os |
20 import sys | 20 import sys |
21 | 21 |
22 | 22 |
23 def lineno(): | 23 def lineno(): |
24 caller = inspect.stack()[1] # Up one level to our caller. | 24 caller = inspect.stack()[1] # Up one level to our caller. |
25 return inspect.getframeinfo(caller[0]).lineno | 25 return inspect.getframeinfo(caller[0]).lineno |
26 | 26 |
27 | 27 |
28 cov_start = lineno()+1 # We care about coverage starting just past this def. | 28 cov_start = lineno()+1 # We care about coverage starting just past this def. |
29 def get_args(bot): | 29 def get_args(bot): |
30 args = [] | 30 args = ['--threads','0'] |
31 | 31 |
32 # 32-bit desktop bots tend to run out of memory, because they have relatively | 32 # 32-bit desktop bots tend to run out of memory, because they have relatively |
33 # far more cores than RAM (e.g. 32 cores, 3G RAM). Hold them back a bit. | 33 # far more cores than RAM (e.g. 32 cores, 3G RAM). Hold them back a bit. |
34 if '-x86-' in bot and not 'NexusPlayer' in bot: | 34 if '-x86-' in bot and not 'NexusPlayer' in bot: |
35 args.extend('--threads 4'.split(' ')) | 35 args.extend('--threads 4'.split(' ')) |
36 | 36 |
37 # These are the canonical configs that we would ideally run on all bots. We | 37 # These are the canonical configs that we would ideally run on all bots. We |
38 # may opt out or substitute some below for specific bots | 38 # may opt out or substitute some below for specific bots |
39 configs = ['565', '8888', 'gpu', 'gpusrgb', 'pdf'] | 39 configs = ['565', '8888', 'gpu', 'gpusrgb', 'pdf'] |
40 # Add in either msaa4 or msaa16 to the canonical set of configs to run | 40 # Add in either msaa4 or msaa16 to the canonical set of configs to run |
(...skipping 258 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
299 if len(sys.argv) == 2 and sys.argv[1] == 'test': | 299 if len(sys.argv) == 2 and sys.argv[1] == 'test': |
300 self_test() | 300 self_test() |
301 sys.exit(0) | 301 sys.exit(0) |
302 | 302 |
303 if len(sys.argv) != 3: | 303 if len(sys.argv) != 3: |
304 print usage | 304 print usage |
305 sys.exit(1) | 305 sys.exit(1) |
306 | 306 |
307 with open(sys.argv[1], 'w') as out: | 307 with open(sys.argv[1], 'w') as out: |
308 json.dump(get_args(sys.argv[2]), out) | 308 json.dump(get_args(sys.argv[2]), out) |
OLD | NEW |