2 # Copyright 2015 Google Inc.
4 # Use of this source code is governed by a BSD-style license that can be
5 # found in the LICENSE file.
11 Write extra flags to outfile for nanobench based on the bot name:
12 $ python nanobench_flags.py outfile Perf-Android-GCC-GalaxyS3-GPU-Mali400-Arm7-Release
14 $ python nanobench_flags.py test
24 caller = inspect.stack()[1] # Up one level to our caller.
25 return inspect.getframeinfo(caller[0]).lineno
28 cov_start = lineno()+1 # We care about coverage starting just past this def.
33 args.append('--images')
35 if 'Appurify' not in bot:
36 args.extend(['--scales', '1.0', '1.1'])
39 args.extend(['--skps', 'ignore_skps'])
41 if 'Appurify' not in bot:
42 config = ['565', '8888', 'gpu', 'nonrendering', 'angle', 'hwui']
43 # The S4 crashes and the NP produces a long error stream when we run with
45 if ('GalaxyS4' not in bot and
46 'NexusPlayer' not in bot):
48 config.extend(['msaa4', 'nvprmsaa4'])
50 config.extend(['msaa16', 'nvprmsaa16'])
51 args.append('--config')
55 # Don't care about Valgrind performance.
56 args.extend(['--loops', '1'])
57 args.extend(['--samples', '1'])
60 args.extend(['--GPUbenchTileW', '256'])
61 args.extend(['--GPUbenchTileH', '256'])
65 # Segfaults when run as GPU bench. Very large texture?
66 match.append('~blurroundrect')
67 match.append('~patch_grid') # skia:2847
68 match.append('~desk_carsvg')
70 match.extend(['~gradient', '~etc1bitmap']) # skia:2895
71 if 'NexusPlayer' in bot:
72 match.append('~desk_unicodetable')
74 match.append('~GLInstancedArraysBench') # skia:4371
77 match.append('~blurroundrect')
78 match.append('~patch_grid') # skia:2847
79 match.append('~desk_carsvg')
80 match.append('~keymobi')
81 match.append('~path_hairline')
83 # the 32-bit GCE bots run out of memory in DM when running these large images
84 # so defensively disable them in nanobench, too.
85 # FIXME (scroggo): This may have just been due to SkImageDecoder's
86 # buildTileIndex leaking memory (https://bug.skia.org/4360). That is
87 # disabled by default for nanobench, so we may not need this.
88 # FIXME (scroggo): Share image blacklists between dm and nanobench?
89 if 'x86' in bot and not 'x86-64' in bot:
90 match.append('~interlaced1.png')
91 match.append('~interlaced2.png')
92 match.append('~interlaced3.png')
94 # We do not need or want to benchmark the decodes of incomplete images.
95 # In fact, in nanobench we assert that the full image decode succeeds.
96 match.append('~inc0.gif')
97 match.append('~inc1.gif')
98 match.append('~incInterlaced.gif')
99 match.append('~inc0.jpg')
100 match.append('~incGray.jpg')
101 match.append('~inc0.wbmp')
102 match.append('~inc1.wbmp')
103 match.append('~inc0.webp')
104 match.append('~inc1.webp')
105 match.append('~inc0.ico')
106 match.append('~inc1.ico')
107 match.append('~inc0.png')
108 match.append('~inc1.png')
109 match.append('~inc2.png')
110 match.append('~inc12.png')
111 match.append('~inc13.png')
112 match.append('~inc14.png')
113 match.append('~inc0.webp')
114 match.append('~inc1.webp')
117 args.append('--match')
121 cov_end = lineno() # Don't care about code coverage past here.
125 import coverage # This way the bots don't need coverage.py to be installed.
128 'Perf-Android-Nexus7-Tegra3-Arm7-Release',
129 'Perf-Android-GCC-NexusPlayer-GPU-PowerVR-x86-Release',
130 'Test-Ubuntu-GCC-ShuttleA-GPU-GTX550Ti-x86_64-Release-Valgrind',
131 'Test-Win7-MSVC-ShuttleA-GPU-HD2000-x86-Debug-ANGLE',
132 'Test-iOS-Clang-iPad4-GPU-SGX554-Arm7-Debug',
133 'Test-Android-GCC-GalaxyS4-GPU-SGX544-Arm7-Release',
136 cov = coverage.coverage()
139 args[case] = get_args(case)
142 this_file = os.path.basename(__file__)
143 _, _, not_run, _ = cov.analysis(this_file)
144 filtered = [line for line in not_run if line > cov_start and line < cov_end]
146 print 'Lines not covered by test cases: ', filtered
149 golden = this_file.replace('.py', '.json')
150 with open(os.path.join(os.path.dirname(__file__), golden), 'w') as f:
151 json.dump(args, f, indent=2, sort_keys=True)
154 if __name__ == '__main__':
155 if len(sys.argv) == 2 and sys.argv[1] == 'test':
159 if len(sys.argv) != 3:
163 with open(sys.argv[1], 'w') as out:
164 json.dump(get_args(sys.argv[2]), out)