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: | 43 if 'Valgrind_GPU' in bot: |
44 args.append('--nocpu') | 44 args.append('--nocpu') |
45 elif 'CPU' in bot: | 45 elif 'Valgrind_CPU' in bot: |
46 args.append('--nogpu') | 46 args.append('--nogpu') |
47 | 47 |
48 match = [] | 48 match = [] |
49 if 'Android' in bot: | 49 if 'Android' in bot: |
50 # Segfaults when run as GPU bench. Very large texture? | 50 # Segfaults when run as GPU bench. Very large texture? |
51 match.append('~blurroundrect') | 51 match.append('~blurroundrect') |
52 match.append('~patch_grid') # skia:2847 | 52 match.append('~patch_grid') # skia:2847 |
53 match.append('~desk_carsvg') | 53 match.append('~desk_carsvg') |
54 if 'HD2000' in bot: | 54 if 'HD2000' in bot: |
55 match.extend(['~gradient', '~etc1bitmap']) # skia:2895 | 55 match.extend(['~gradient', '~etc1bitmap']) # skia:2895 |
56 if 'Nexus7' in bot: | 56 if 'Nexus7' in bot: |
57 match = ['skp'] # skia:2774 | 57 match = ['skp'] # skia:2774 |
58 if match: | 58 if match: |
59 args.append('--match') | 59 args.append('--match') |
60 args.extend(match) | 60 args.extend(match) |
61 | 61 |
62 | 62 |
63 if ('GalaxyS3' in bot or | 63 if ('GalaxyS3' in bot or |
64 'GalaxyS4' in bot): | 64 'GalaxyS4' in bot): |
65 args.append('--nocpu') | 65 args.append('--nocpu') |
66 return args | 66 return args |
67 cov_end = lineno() # Don't care about code coverage past here. | 67 cov_end = lineno() # Don't care about code coverage past here. |
68 | 68 |
69 | 69 |
70 def self_test(): | 70 def self_test(): |
71 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. |
72 args = {} | 72 args = {} |
73 cases = [ | 73 cases = [ |
74 'Perf-Android-GalaxyS3-Mali400-Arm7-Release', | 74 'Perf-Android-GalaxyS3-Mali400-Arm7-Release', |
75 'Perf-Android-Nexus7-Tegra3-Arm7-Release', | 75 'Perf-Android-Nexus7-Tegra3-Arm7-Release', |
76 'Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind_CPU', | 76 'Test-Ubuntu14-GCE-NoGPU-x86_64-Release-Valgrind_CPU', |
77 'Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind_GPU', | 77 'Test-Ubuntu12-ShuttleA-GTX550Ti-x86_64-Release-Valgrind_GPU', |
78 'Test-Win7-ShuttleA-HD2000-x86-Debug-ANGLE', | 78 'Test-Win7-ShuttleA-HD2000-x86-Debug-ANGLE', |
79 ] | 79 ] |
80 | 80 |
81 cov = coverage.coverage() | 81 cov = coverage.coverage() |
82 cov.start() | 82 cov.start() |
83 for case in cases: | 83 for case in cases: |
84 args[case] = get_args(case) | 84 args[case] = get_args(case) |
85 cov.stop() | 85 cov.stop() |
86 | 86 |
(...skipping 13 matching lines...) Expand all Loading... |
100 if len(sys.argv) == 2 and sys.argv[1] == 'test': | 100 if len(sys.argv) == 2 and sys.argv[1] == 'test': |
101 self_test() | 101 self_test() |
102 sys.exit(0) | 102 sys.exit(0) |
103 | 103 |
104 if len(sys.argv) != 3: | 104 if len(sys.argv) != 3: |
105 print usage | 105 print usage |
106 sys.exit(1) | 106 sys.exit(1) |
107 | 107 |
108 with open(sys.argv[1], 'w') as out: | 108 with open(sys.argv[1], 'w') as out: |
109 json.dump(get_args(sys.argv[2]), out) | 109 json.dump(get_args(sys.argv[2]), out) |
OLD | NEW |