mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 1 | #!/usr/bin/env python |
| 2 | |
| 3 | usage = ''' |
| 4 | Write extra flags to outfile for DM based on the bot name: |
| 5 | $ python dm_flags.py outfile Test-Mac10.9-MacMini6.2-HD4000-x86_64-Release |
| 6 | Or run self-tests: |
| 7 | $ python dm_flags.py test |
| 8 | ''' |
| 9 | |
| 10 | import inspect |
| 11 | import json |
| 12 | import os |
| 13 | import sys |
| 14 | |
| 15 | |
| 16 | def lineno(): |
| 17 | caller = inspect.stack()[1] # Up one level to our caller. |
| 18 | return inspect.getframeinfo(caller[0]).lineno |
| 19 | |
| 20 | |
| 21 | cov_start = lineno()+1 # We care about coverage starting just past this def. |
mtklein | f73e589 | 2015-02-24 11:45:11 -0800 | [diff] [blame] | 22 | def get_args(bot): |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 23 | args = [] |
| 24 | |
mtklein | 341c808 | 2015-03-02 09:51:44 -0800 | [diff] [blame] | 25 | configs = ['565', '8888', 'gpu'] |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 26 | # The S4 crashes and the NP produces a long error stream when we run with |
| 27 | # MSAA. |
| 28 | if ('GalaxyS4' not in bot and |
| 29 | 'NexusPlayer' not in bot): |
| 30 | if 'Android' in bot: |
| 31 | configs.extend(['msaa4', 'nvprmsaa4']) |
| 32 | else: |
| 33 | configs.extend(['msaa16', 'nvprmsaa16']) |
mtklein | 82b33db | 2015-03-04 13:58:05 -0800 | [diff] [blame] | 34 | # Runs out of memory on Android bots and Daisy. Everyone else seems fine. |
mtklein | 150d350 | 2015-03-05 13:38:17 -0800 | [diff] [blame] | 35 | if 'Android' not in bot and 'Daisy' not in bot: |
mtklein | 84aada8 | 2015-03-04 11:47:11 -0800 | [diff] [blame] | 36 | configs.append('pdf') |
bsalomon | 5abf584 | 2015-02-27 10:13:36 -0800 | [diff] [blame] | 37 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 38 | # Xoom and NP are running out of RAM when we run all these modes. skia:3255 |
| 39 | if ('Xoom' not in bot and |
| 40 | 'NexusPlayer' not in bot): |
| 41 | configs.extend(mode + '-8888' for mode in |
| 42 | ['serialize', 'tiles_rt', 'pipe']) |
| 43 | configs.append('tiles_rt-gpu') |
mtklein | ee2a3ea | 2015-02-25 08:16:19 -0800 | [diff] [blame] | 44 | if 'ANGLE' in bot: |
| 45 | configs.append('angle') |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 46 | args.append('--config') |
| 47 | args.extend(configs) |
| 48 | |
| 49 | blacklist = [] |
| 50 | # This image is too large to be a texture for many GPUs. |
| 51 | blacklist.extend('gpu _ PANO_20121023_214540.jpg'.split(' ')) |
| 52 | blacklist.extend('msaa _ PANO_20121023_214540.jpg'.split(' ')) |
| 53 | |
mtklein | e2aab90 | 2015-03-17 12:52:16 -0700 | [diff] [blame] | 54 | # Leon doesn't care about this, so why run it? |
| 55 | if 'Win' in bot: |
| 56 | blacklist.extend('_ image _'.split(' ')) |
| 57 | blacklist.extend('_ subset _'.split(' ')) |
| 58 | |
egdaniel | 89c2a54 | 2015-03-19 13:09:17 -0700 | [diff] [blame] | 59 | # Certain gm's on win7 gpu and pdf are never finishing and keeping the test |
| 60 | # running forever |
| 61 | if 'Win7' in bot: |
| 62 | blacklist.extend('msaa16 gm colorwheelnative'.split(' ')) |
| 63 | blacklist.extend('pdf gm fontmgr_iter_factory'.split(' ')) |
| 64 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 65 | # Drawing SKPs or images into GPU canvases is a New Thing. |
| 66 | # It seems like we're running out of RAM on some Android bots, so start off |
| 67 | # with a very wide blacklist disabling all these tests on all Android bots. |
| 68 | if 'Android' in bot: # skia:3255 |
| 69 | blacklist.extend('gpu skp _ gpu image _ gpu subset _'.split(' ')) |
| 70 | blacklist.extend('msaa skp _ msaa image _ gpu subset _'.split(' ')) |
| 71 | |
mtklein | 150d350 | 2015-03-05 13:38:17 -0800 | [diff] [blame] | 72 | if 'Valgrind' in bot: |
mtklein | de7665a | 2015-03-14 07:24:29 -0700 | [diff] [blame] | 73 | # PDF + .webp -> jumps depending on uninitialized memory. skia:3505 |
mtklein | 150d350 | 2015-03-05 13:38:17 -0800 | [diff] [blame] | 74 | blacklist.extend('pdf _ .webp'.split(' ')) |
mtklein | de7665a | 2015-03-14 07:24:29 -0700 | [diff] [blame] | 75 | # These both take 18+ hours to run. |
| 76 | blacklist.extend('pdf gm fontmgr_iter'.split(' ')) |
| 77 | blacklist.extend('pdf _ PANO_20121023_214540.jpg'.split(' ')) |
mtklein | 7e78f3d | 2015-03-10 08:03:26 -0700 | [diff] [blame] | 78 | if 'Valgrind_GPU' in bot: |
borenet | 13e51f9 | 2015-03-09 06:59:16 -0700 | [diff] [blame] | 79 | args.append('--nocpu') |
mtklein | 7e78f3d | 2015-03-10 08:03:26 -0700 | [diff] [blame] | 80 | elif 'Valgrind_CPU' in bot: |
borenet | 13e51f9 | 2015-03-09 06:59:16 -0700 | [diff] [blame] | 81 | args.append('--nogpu') |
mtklein | 150d350 | 2015-03-05 13:38:17 -0800 | [diff] [blame] | 82 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 83 | if blacklist: |
| 84 | args.append('--blacklist') |
| 85 | args.extend(blacklist) |
| 86 | |
| 87 | match = [] |
| 88 | if 'Alex' in bot: # skia:2793 |
| 89 | # This machine looks to be running out of heap. |
| 90 | # Running with fewer threads may help. |
| 91 | args.extend(['--threads', '1']) |
| 92 | if 'Valgrind' in bot: # skia:3021 |
| 93 | match.append('~Threaded') |
mtklein | 905d01b | 2015-03-18 14:06:55 -0700 | [diff] [blame] | 94 | if 'TSAN' in bot: # skia:3562 |
| 95 | match.append('~Math') |
| 96 | |
mtklein | cc99dbc | 2015-03-11 08:43:43 -0700 | [diff] [blame] | 97 | if 'Xoom' in bot or 'GalaxyS3' in bot: # skia:1699 |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 98 | match.append('~WritePixels') |
| 99 | |
| 100 | # skia:3249: these images flakily don't decode on Android. |
| 101 | if 'Android' in bot: |
| 102 | match.append('~tabl_mozilla_0') |
| 103 | match.append('~desk_yahoonews_0') |
| 104 | |
mtklein | 4e2d3be | 2015-03-10 11:55:18 -0700 | [diff] [blame] | 105 | if 'NexusPlayer' in bot: |
| 106 | match.append('~ResourceCache') |
| 107 | |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 108 | if match: |
| 109 | args.append('--match') |
| 110 | args.extend(match) |
| 111 | |
| 112 | # Though their GPUs are interesting, these don't test anything on |
| 113 | # the CPU that other ARMv7+NEON bots don't test faster (N5). |
| 114 | if ('Nexus10' in bot or |
| 115 | 'Nexus7' in bot or |
| 116 | 'GalaxyS3' in bot or |
| 117 | 'GalaxyS4' in bot): |
| 118 | args.append('--nocpu') |
| 119 | return args |
| 120 | cov_end = lineno() # Don't care about code coverage past here. |
| 121 | |
| 122 | |
| 123 | def self_test(): |
| 124 | import coverage # This way the bots don't need coverage.py to be installed. |
| 125 | args = {} |
| 126 | cases = [ |
mtklein | cc99dbc | 2015-03-11 08:43:43 -0700 | [diff] [blame] | 127 | 'Test-Android-GalaxyS3-Mali400-Arm7-Debug', |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 128 | 'Test-Android-Nexus7-Tegra3-Arm7-Release', |
mtklein | 4e2d3be | 2015-03-10 11:55:18 -0700 | [diff] [blame] | 129 | 'Test-Android-NexusPlayer-PowerVR-x86-Release', |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 130 | 'Test-Android-Xoom-Tegra2-Arm7-Release', |
| 131 | 'Test-ChromeOS-Alex-GMA3150-x86-Debug', |
borenet | 13e51f9 | 2015-03-09 06:59:16 -0700 | [diff] [blame] | 132 | 'Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind_GPU', |
mtklein | 905d01b | 2015-03-18 14:06:55 -0700 | [diff] [blame] | 133 | 'Test-Ubuntu13.10-GCE-NoGPU-x86_64-Release-TSAN', |
mtklein | 4e2d3be | 2015-03-10 11:55:18 -0700 | [diff] [blame] | 134 | 'Test-Ubuntu14-GCE-NoGPU-x86_64-Release-Valgrind_CPU', |
mtklein | ee2a3ea | 2015-02-25 08:16:19 -0800 | [diff] [blame] | 135 | 'Test-Win7-ShuttleA-HD2000-x86-Debug-ANGLE', |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 136 | ] |
| 137 | |
| 138 | cov = coverage.coverage() |
| 139 | cov.start() |
| 140 | for case in cases: |
mtklein | f73e589 | 2015-02-24 11:45:11 -0800 | [diff] [blame] | 141 | args[case] = get_args(case) |
mtklein | 11a2c50 | 2015-02-24 09:25:16 -0800 | [diff] [blame] | 142 | cov.stop() |
| 143 | |
| 144 | this_file = os.path.basename(__file__) |
| 145 | _, _, not_run, _ = cov.analysis(this_file) |
| 146 | filtered = [line for line in not_run if line > cov_start and line < cov_end] |
| 147 | if filtered: |
| 148 | print 'Lines not covered by test cases: ', filtered |
| 149 | sys.exit(1) |
| 150 | |
| 151 | golden = this_file.replace('.py', '.json') |
| 152 | with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f: |
| 153 | json.dump(args, f, indent=2, sort_keys=True) |
| 154 | |
| 155 | |
| 156 | if __name__ == '__main__': |
| 157 | if len(sys.argv) == 2 and sys.argv[1] == 'test': |
| 158 | self_test() |
| 159 | sys.exit(0) |
| 160 | |
| 161 | if len(sys.argv) != 3: |
| 162 | print usage |
| 163 | sys.exit(1) |
| 164 | |
| 165 | with open(sys.argv[1], 'w') as out: |
mtklein | f73e589 | 2015-02-24 11:45:11 -0800 | [diff] [blame] | 166 | json.dump(get_args(sys.argv[2]), out) |