| OLD | NEW | 
|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python | 
| 2 | 2 | 
| 3 usage = ''' | 3 usage = ''' | 
| 4 Write extra flags to outfile for nanobench based on the bot name: | 4 Write extra flags to outfile for nanobench based on the bot name: | 
| 5   $ python nanobench_flags.py outfile Perf-Android-GalaxyS3-Mali400-Arm7-Release | 5   $ python nanobench_flags.py outfile Perf-Android-GalaxyS3-Mali400-Arm7-Release | 
| 6 Or run self-tests: | 6 Or run self-tests: | 
| 7   $ python nanobench_flags.py test | 7   $ python nanobench_flags.py test | 
| 8 ''' | 8 ''' | 
| 9 | 9 | 
| 10 import inspect | 10 import inspect | 
| (...skipping 22 matching lines...) Expand all  Loading... | 
| 33       config.extend(['msaa4', 'nvprmsaa4']) | 33       config.extend(['msaa4', 'nvprmsaa4']) | 
| 34     else: | 34     else: | 
| 35       config.extend(['msaa16', 'nvprmsaa16']) | 35       config.extend(['msaa16', 'nvprmsaa16']) | 
| 36   args.append('--config') | 36   args.append('--config') | 
| 37   args.extend(config) | 37   args.extend(config) | 
| 38 | 38 | 
| 39   if 'Valgrind' in bot: | 39   if 'Valgrind' in bot: | 
| 40     # Don't care about Valgrind performance. | 40     # Don't care about Valgrind performance. | 
| 41     args.extend(['--loops',   '1']) | 41     args.extend(['--loops',   '1']) | 
| 42     args.extend(['--samples', '1']) | 42     args.extend(['--samples', '1']) | 
|  | 43     if 'GPU' in bot: | 
|  | 44       args.append('--nocpu') | 
|  | 45     elif 'CPU' in bot: | 
|  | 46       args.append('--nogpu') | 
| 43 | 47 | 
| 44   match = [] | 48   match = [] | 
| 45   if 'Android' in bot: | 49   if 'Android' in bot: | 
| 46     # Segfaults when run as GPU bench. Very large texture? | 50     # Segfaults when run as GPU bench. Very large texture? | 
| 47     match.append('~blurroundrect') | 51     match.append('~blurroundrect') | 
| 48     match.append('~patch_grid')  # skia:2847 | 52     match.append('~patch_grid')  # skia:2847 | 
| 49     match.append('~desk_carsvg') | 53     match.append('~desk_carsvg') | 
| 50   if 'HD2000' in bot: | 54   if 'HD2000' in bot: | 
| 51     match.extend(['~gradient', '~etc1bitmap'])  # skia:2895 | 55     match.extend(['~gradient', '~etc1bitmap'])  # skia:2895 | 
| 52   if 'Nexus7' in bot: | 56   if 'Nexus7' in bot: | 
| 53     match = ['skp']  # skia:2774 | 57     match = ['skp']  # skia:2774 | 
| 54   if match: | 58   if match: | 
| 55     args.append('--match') | 59     args.append('--match') | 
| 56     args.extend(match) | 60     args.extend(match) | 
| 57 | 61 | 
| 58 | 62 | 
| 59   if ('GalaxyS3' in bot or | 63   if ('GalaxyS3' in bot or | 
| 60       'GalaxyS4' in bot): | 64       'GalaxyS4' in bot): | 
| 61     args.append('--nocpu') | 65     args.append('--nocpu') | 
| 62   return args | 66   return args | 
| 63 cov_end = lineno()   # Don't care about code coverage past here. | 67 cov_end = lineno()   # Don't care about code coverage past here. | 
| 64 | 68 | 
| 65 | 69 | 
| 66 def self_test(): | 70 def self_test(): | 
| 67   import coverage  # This way the bots don't need coverage.py to be installed. | 71   import coverage  # This way the bots don't need coverage.py to be installed. | 
| 68   args = {} | 72   args = {} | 
| 69   cases = [ | 73   cases = [ | 
| 70     'Perf-Android-GalaxyS3-Mali400-Arm7-Release', | 74     'Perf-Android-GalaxyS3-Mali400-Arm7-Release', | 
| 71     'Perf-Android-Nexus7-Tegra3-Arm7-Release', | 75     'Perf-Android-Nexus7-Tegra3-Arm7-Release', | 
| 72     'Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind', | 76     'Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind_CPU', | 
|  | 77     'Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind_GPU', | 
| 73     'Test-Win7-ShuttleA-HD2000-x86-Debug-ANGLE', | 78     'Test-Win7-ShuttleA-HD2000-x86-Debug-ANGLE', | 
| 74   ] | 79   ] | 
| 75 | 80 | 
| 76   cov = coverage.coverage() | 81   cov = coverage.coverage() | 
| 77   cov.start() | 82   cov.start() | 
| 78   for case in cases: | 83   for case in cases: | 
| 79     args[case] = get_args(case) | 84     args[case] = get_args(case) | 
| 80   cov.stop() | 85   cov.stop() | 
| 81 | 86 | 
| 82   this_file = os.path.basename(__file__) | 87   this_file = os.path.basename(__file__) | 
| (...skipping 12 matching lines...) Expand all  Loading... | 
| 95   if len(sys.argv) == 2 and sys.argv[1] == 'test': | 100   if len(sys.argv) == 2 and sys.argv[1] == 'test': | 
| 96     self_test() | 101     self_test() | 
| 97     sys.exit(0) | 102     sys.exit(0) | 
| 98 | 103 | 
| 99   if len(sys.argv) != 3: | 104   if len(sys.argv) != 3: | 
| 100     print usage | 105     print usage | 
| 101     sys.exit(1) | 106     sys.exit(1) | 
| 102 | 107 | 
| 103   with open(sys.argv[1], 'w') as out: | 108   with open(sys.argv[1], 'w') as out: | 
| 104     json.dump(get_args(sys.argv[2]), out) | 109     json.dump(get_args(sys.argv[2]), out) | 
| OLD | NEW | 
|---|