borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 1 | # Copyright 2016 The Chromium Authors. All rights reserved. |
| 2 | # Use of this source code is governed by a BSD-style license that can be |
| 3 | # found in the LICENSE file. |
| 4 | |
| 5 | |
| 6 | # Recipe module for Skia Swarming perf. |
| 7 | |
| 8 | |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 9 | import calendar |
Kevin Lubick | 587afc9 | 2017-10-12 12:21:47 -0400 | [diff] [blame] | 10 | import os |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 11 | |
| 12 | |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 13 | DEPS = [ |
Eric Boren | 896af75 | 2017-04-24 13:22:56 -0400 | [diff] [blame] | 14 | 'env', |
| 15 | 'flavor', |
Robert Iannucci | 8cd5041 | 2017-07-07 14:36:58 -0700 | [diff] [blame] | 16 | 'recipe_engine/file', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 17 | 'recipe_engine/json', |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 18 | 'recipe_engine/path', |
| 19 | 'recipe_engine/platform', |
| 20 | 'recipe_engine/properties', |
| 21 | 'recipe_engine/raw_io', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 22 | 'recipe_engine/step', |
| 23 | 'recipe_engine/time', |
| 24 | 'run', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 25 | 'vars', |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 26 | ] |
| 27 | |
| 28 | |
Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 29 | def upload_perf_results(buildername): |
| 30 | if 'Release' not in buildername: |
| 31 | return False |
| 32 | skip_upload_bots = [ |
| 33 | 'ASAN', |
| 34 | 'Coverage', |
| 35 | 'MSAN', |
| 36 | 'TSAN', |
| 37 | 'UBSAN', |
| 38 | 'Valgrind', |
| 39 | ] |
| 40 | for s in skip_upload_bots: |
| 41 | if s in buildername: |
| 42 | return False |
| 43 | return True |
| 44 | |
| 45 | |
Eric Boren | 89cd357 | 2017-06-28 13:50:22 -0400 | [diff] [blame] | 46 | def nanobench_flags(api, bot): |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 47 | args = ['--pre_log'] |
| 48 | |
| 49 | if 'GPU' in bot: |
| 50 | args.append('--images') |
| 51 | args.extend(['--gpuStatsDump', 'true']) |
| 52 | |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 53 | args.extend(['--scales', '1.0', '1.1']) |
| 54 | |
| 55 | if 'iOS' in bot: |
| 56 | args.extend(['--skps', 'ignore_skps']) |
| 57 | |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 58 | configs = [] |
| 59 | if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU': |
| 60 | args.append('--nogpu') |
| 61 | configs.extend(['8888', 'nonrendering']) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 62 | |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 63 | if '-GCE-' in bot: |
Mike Klein | 0e4041f | 2018-06-19 16:00:40 -0400 | [diff] [blame] | 64 | configs += [ |
| 65 | 'f16', |
| 66 | 'srgb', |
| 67 | 'esrgb', |
| 68 | 'narrow', |
| 69 | 'enarrow', |
| 70 | ] |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 71 | |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 72 | elif api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU': |
| 73 | args.append('--nocpu') |
| 74 | |
| 75 | gl_prefix = 'gl' |
| 76 | sample_count = '8' |
| 77 | if 'Android' in bot or 'iOS' in bot: |
| 78 | sample_count = '4' |
| 79 | # The NVIDIA_Shield has a regular OpenGL implementation. We bench that |
| 80 | # instead of ES. |
| 81 | if 'NVIDIA_Shield' not in bot: |
| 82 | gl_prefix = 'gles' |
| 83 | # The NP produces a long error stream when we run with MSAA. |
| 84 | # iOS crashes (skia:6399) |
| 85 | # Nexus7 (Tegra3) does not support MSAA. |
| 86 | if ('NexusPlayer' in bot or |
| 87 | 'iOS' in bot or |
| 88 | 'Nexus7' in bot): |
| 89 | sample_count = '' |
| 90 | elif 'Intel' in bot: |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 91 | sample_count = '' |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 92 | elif 'ChromeOS' in bot: |
| 93 | gl_prefix = 'gles' |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 94 | |
Brian Osman | 2a284de | 2018-06-20 20:59:06 +0000 | [diff] [blame] | 95 | configs.extend([gl_prefix, gl_prefix + 'srgb']) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 96 | if sample_count is not '': |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 97 | configs.append(gl_prefix + 'msaa' + sample_count) |
| 98 | if ('TegraX1' in bot or |
| 99 | 'Quadro' in bot or |
| 100 | 'GTX' in bot or |
| 101 | ('GT610' in bot and 'Ubuntu17' not in bot)): |
Robert Phillips | 0b33cc4 | 2018-02-08 08:29:21 -0500 | [diff] [blame] | 102 | configs.extend([gl_prefix + 'nvpr' + sample_count]) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 103 | |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 104 | # We want to test both the OpenGL config and the GLES config on Linux Intel: |
| 105 | # GL is used by Chrome, GLES is used by ChromeOS. |
| 106 | if 'Intel' in bot and api.vars.is_linux: |
Brian Osman | 2a284de | 2018-06-20 20:59:06 +0000 | [diff] [blame] | 107 | configs.extend(['gles', 'glessrgb']) |
| 108 | |
| 109 | # The following devices do not support glessrgb. |
| 110 | if 'glessrgb' in configs: |
| 111 | if ('IntelHD405' in bot or |
| 112 | 'IntelIris640' in bot or |
| 113 | 'IntelBayTrail' in bot or |
| 114 | 'IntelHD2000' in bot or |
| 115 | 'AndroidOne' in bot or |
| 116 | 'Nexus7' in bot or |
| 117 | 'NexusPlayer' in bot): |
| 118 | configs.remove('glessrgb') |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 119 | |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 120 | if 'CommandBuffer' in bot: |
| 121 | configs = ['commandbuffer'] |
| 122 | if 'Vulkan' in bot: |
Chris Dalton | aec79e6 | 2018-05-29 12:02:19 -0600 | [diff] [blame] | 123 | configs = ['vk'] |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 124 | |
| 125 | if 'ANGLE' in bot: |
| 126 | # Test only ANGLE configs. |
| 127 | configs = ['angle_d3d11_es2'] |
| 128 | if sample_count is not '': |
| 129 | configs.append('angle_d3d11_es2_msaa' + sample_count) |
Ben Wagner | 7464a26 | 2018-04-19 15:49:18 -0400 | [diff] [blame] | 130 | if 'QuadroP400' in bot: |
| 131 | # See skia:7823 and chromium:693090. |
| 132 | configs.append('angle_gl_es2') |
| 133 | if sample_count is not '': |
| 134 | configs.append('angle_gl_es2_msaa' + sample_count) |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 135 | |
| 136 | if 'ChromeOS' in bot: |
| 137 | # Just run GLES for now - maybe add gles_msaa4 in the future |
| 138 | configs = ['gles'] |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 139 | |
| 140 | args.append('--config') |
| 141 | args.extend(configs) |
| 142 | |
Ben Wagner | 6f96c02 | 2018-06-21 12:12:01 -0400 | [diff] [blame^] | 143 | # By default, we test with GPU threading enabled, unless specifically |
| 144 | # disabled. |
| 145 | if 'NoGPUThreads' in bot: |
| 146 | args.extend(['--gpuThreads', '0']) |
| 147 | |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 148 | if 'Valgrind' in bot: |
| 149 | # Don't care about Valgrind performance. |
| 150 | args.extend(['--loops', '1']) |
| 151 | args.extend(['--samples', '1']) |
| 152 | # Ensure that the bot framework does not think we have timed out. |
| 153 | args.extend(['--keepAlive', 'true']) |
| 154 | |
Ben Wagner | 47ac024 | 2017-06-27 13:44:36 -0400 | [diff] [blame] | 155 | # Some people don't like verbose output. |
| 156 | verbose = False |
| 157 | |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 158 | match = [] |
| 159 | if 'Android' in bot: |
| 160 | # Segfaults when run as GPU bench. Very large texture? |
| 161 | match.append('~blurroundrect') |
| 162 | match.append('~patch_grid') # skia:2847 |
| 163 | match.append('~desk_carsvg') |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 164 | if 'Nexus5' in bot: |
| 165 | match.append('~keymobi_shop_mobileweb_ebay_com.skp') # skia:5178 |
| 166 | if 'iOS' in bot: |
| 167 | match.append('~blurroundrect') |
| 168 | match.append('~patch_grid') # skia:2847 |
| 169 | match.append('~desk_carsvg') |
| 170 | match.append('~keymobi') |
| 171 | match.append('~path_hairline') |
| 172 | match.append('~GLInstancedArraysBench') # skia:4714 |
| 173 | if 'IntelIris540' in bot and 'ANGLE' in bot: |
| 174 | match.append('~tile_image_filter_tiled_64') # skia:6082 |
Ben Wagner | 2219544 | 2017-11-30 15:34:24 -0500 | [diff] [blame] | 175 | if 'Vulkan' in bot and 'IntelIris540' in bot and 'Win' in bot: |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 176 | # skia:6398 |
| 177 | match.append('~GM_varied_text_clipped_lcd') |
| 178 | match.append('~GM_varied_text_ignorable_clip_lcd') |
Mike Reed | 1d2678f | 2017-07-05 13:10:42 -0400 | [diff] [blame] | 179 | match.append('~blendmode_mask_DstATop') |
| 180 | match.append('~blendmode_mask_SrcIn') |
| 181 | match.append('~blendmode_mask_SrcOut') |
| 182 | match.append('~blendmode_mask_Src') |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 183 | match.append('~fontscaler_lcd') |
| 184 | match.append('~rotated_rects_aa_alternating_transparent_and_opaque_src') |
| 185 | match.append('~rotated_rects_aa_changing_transparent_src') |
| 186 | match.append('~rotated_rects_aa_same_transparent_src') |
| 187 | match.append('~shadermask_LCD_FF') |
| 188 | match.append('~srcmode_rects_1') |
| 189 | match.append('~text_16_LCD_88') |
| 190 | match.append('~text_16_LCD_BK') |
| 191 | match.append('~text_16_LCD_FF') |
| 192 | match.append('~text_16_LCD_WT') |
Greg Daniel | 139eb80 | 2017-07-19 10:12:49 -0400 | [diff] [blame] | 193 | # skia:6863 |
| 194 | match.append('~desk_skbug6850overlay2') |
Greg Daniel | e099653 | 2017-08-07 14:56:26 -0400 | [diff] [blame] | 195 | match.append('~desk_googlespreadsheet') |
Greg Daniel | a6717ce | 2018-01-29 10:04:41 -0500 | [diff] [blame] | 196 | match.append('~desk_carsvg') |
Ben Wagner | a7f3205 | 2018-03-01 15:25:16 -0500 | [diff] [blame] | 197 | if ('Vulkan' in bot and ('RadeonR9M470X' in bot or 'RadeonHD7770' in bot) and |
| 198 | 'Win' in bot): |
Ben Wagner | 84447e0 | 2018-02-28 15:51:30 -0500 | [diff] [blame] | 199 | # skia:7677 |
| 200 | match.append('~path_text_clipped_uncached') |
Chris Dalton | 2b937f5 | 2018-05-17 10:17:10 -0600 | [diff] [blame] | 201 | if 'MoltenVK' in bot: |
| 202 | # skbug.com/7962 |
| 203 | match.append('~^path_text_clipped_uncached$') |
| 204 | match.append('~^path_text_uncached$') |
Eric Boren | 89cd357 | 2017-06-28 13:50:22 -0400 | [diff] [blame] | 205 | if ('Intel' in bot and api.vars.is_linux and not 'Vulkan' in bot): |
Ben Wagner | 47ac024 | 2017-06-27 13:44:36 -0400 | [diff] [blame] | 206 | # TODO(dogben): Track down what's causing bots to die. |
| 207 | verbose = True |
Ben Wagner | b842703 | 2017-11-18 19:04:25 -0500 | [diff] [blame] | 208 | if 'IntelHD405' in bot and api.vars.is_linux and 'Vulkan' in bot: |
Ben Wagner | 32eb5ba | 2017-11-20 13:46:20 -0500 | [diff] [blame] | 209 | # skia:7322 |
Greg Daniel | e81f7b3 | 2018-05-22 13:13:18 -0400 | [diff] [blame] | 210 | match.append('~desk_carsvg.skp_1') |
Ben Wagner | b842703 | 2017-11-18 19:04:25 -0500 | [diff] [blame] | 211 | match.append('~desk_tiger8svg.skp_1') |
Greg Daniel | e81f7b3 | 2018-05-22 13:13:18 -0400 | [diff] [blame] | 212 | match.append('~desk_wowwiki.skp') |
Stephan Altmueller | e9a284d | 2018-03-14 15:02:22 -0400 | [diff] [blame] | 213 | match.append('~keymobi_sfgate.skp_1') |
Ben Wagner | b842703 | 2017-11-18 19:04:25 -0500 | [diff] [blame] | 214 | match.append('~keymobi_techcrunch_com.skp_1.1') |
Stephan Altmueller | e9a284d | 2018-03-14 15:02:22 -0400 | [diff] [blame] | 215 | match.append('~keymobi_techcrunch.skp_1.1') |
| 216 | match.append('~keymobi_techcrunch.skp_1.1_mpd') |
Ben Wagner | b842703 | 2017-11-18 19:04:25 -0500 | [diff] [blame] | 217 | match.append('~tabl_gamedeksiam.skp_1.1') |
| 218 | match.append('~tabl_pravda.skp_1') |
| 219 | match.append('~top25desk_ebay_com.skp_1.1') |
Stephan Altmueller | e9a284d | 2018-03-14 15:02:22 -0400 | [diff] [blame] | 220 | match.append('~top25desk_ebay.skp_1.1') |
| 221 | match.append('~top25desk_ebay.skp_1.1_mpd') |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 222 | if 'Vulkan' in bot and 'NexusPlayer' in bot: |
Greg Daniel | 514e9d8 | 2017-07-06 09:25:15 -0400 | [diff] [blame] | 223 | match.append('~blendmode_') # skia:6691 |
Ben Wagner | 314d7c2 | 2018-01-03 11:04:30 -0500 | [diff] [blame] | 224 | if ('ASAN' in bot or 'UBSAN' in bot) and 'CPU' in bot: |
Ben Wagner | 7d0cd9c | 2017-12-04 12:28:37 -0500 | [diff] [blame] | 225 | # floor2int_undef benches undefined behavior, so ASAN correctly complains. |
Ben Wagner | adf17dc | 2017-09-12 23:41:00 -0400 | [diff] [blame] | 226 | match.append('~^floor2int_undef$') |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 227 | |
| 228 | # We do not need or want to benchmark the decodes of incomplete images. |
| 229 | # In fact, in nanobench we assert that the full image decode succeeds. |
| 230 | match.append('~inc0.gif') |
| 231 | match.append('~inc1.gif') |
| 232 | match.append('~incInterlaced.gif') |
| 233 | match.append('~inc0.jpg') |
| 234 | match.append('~incGray.jpg') |
| 235 | match.append('~inc0.wbmp') |
| 236 | match.append('~inc1.wbmp') |
| 237 | match.append('~inc0.webp') |
| 238 | match.append('~inc1.webp') |
| 239 | match.append('~inc0.ico') |
| 240 | match.append('~inc1.ico') |
| 241 | match.append('~inc0.png') |
| 242 | match.append('~inc1.png') |
| 243 | match.append('~inc2.png') |
| 244 | match.append('~inc12.png') |
| 245 | match.append('~inc13.png') |
| 246 | match.append('~inc14.png') |
| 247 | match.append('~inc0.webp') |
| 248 | match.append('~inc1.webp') |
| 249 | |
| 250 | if match: |
| 251 | args.append('--match') |
| 252 | args.extend(match) |
| 253 | |
Ben Wagner | 47ac024 | 2017-06-27 13:44:36 -0400 | [diff] [blame] | 254 | if verbose: |
| 255 | args.append('--verbose') |
| 256 | |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 257 | return args |
| 258 | |
| 259 | |
| 260 | def perf_steps(api): |
| 261 | """Run Skia benchmarks.""" |
Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 262 | b = api.properties['buildername'] |
| 263 | if upload_perf_results(b): |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 264 | api.flavor.create_clean_device_dir( |
| 265 | api.flavor.device_dirs.perf_data_dir) |
| 266 | |
| 267 | # Run nanobench. |
| 268 | properties = [ |
| 269 | '--properties', |
Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 270 | 'gitHash', api.properties['revision'], |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 271 | ] |
| 272 | if api.vars.is_trybot: |
| 273 | properties.extend([ |
| 274 | 'issue', api.vars.issue, |
| 275 | 'patchset', api.vars.patchset, |
| 276 | 'patch_storage', api.vars.patch_storage, |
| 277 | ]) |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 278 | properties.extend(['swarming_bot_id', api.vars.swarming_bot_id]) |
| 279 | properties.extend(['swarming_task_id', api.vars.swarming_task_id]) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 280 | |
| 281 | target = 'nanobench' |
| 282 | args = [ |
| 283 | target, |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 284 | '-i', api.flavor.device_dirs.resource_dir, |
| 285 | '--skps', api.flavor.device_dirs.skp_dir, |
| 286 | '--images', api.flavor.device_path_join( |
| 287 | api.flavor.device_dirs.images_dir, 'nanobench'), |
| 288 | ] |
| 289 | |
| 290 | # Do not run svgs on Valgrind. |
| 291 | if 'Valgrind' not in api.vars.builder_name: |
Ben Wagner | 0ecc2b7e | 2017-11-09 22:10:44 -0500 | [diff] [blame] | 292 | args.extend(['--svgs', api.flavor.device_dirs.svg_dir]) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 293 | |
Eric Boren | 89cd357 | 2017-06-28 13:50:22 -0400 | [diff] [blame] | 294 | args.extend(nanobench_flags(api, api.vars.builder_name)) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 295 | |
| 296 | if 'Chromecast' in api.vars.builder_cfg.get('os', ''): |
| 297 | # Due to limited disk space, run a watered down perf run on Chromecast. |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 298 | args = [target] |
Kevin Lubick | b6d09b7 | 2017-06-15 15:21:17 -0400 | [diff] [blame] | 299 | if api.vars.builder_cfg.get('cpu_or_gpu') == 'CPU': |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 300 | args.extend(['--nogpu', '--config', '8888']) |
Kevin Lubick | b6d09b7 | 2017-06-15 15:21:17 -0400 | [diff] [blame] | 301 | elif api.vars.builder_cfg.get('cpu_or_gpu') == 'GPU': |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 302 | args.extend(['--nocpu', '--config', 'gles']) |
Kevin Lubick | b6d09b7 | 2017-06-15 15:21:17 -0400 | [diff] [blame] | 303 | args.extend([ |
Kevin Lubick | ffce079 | 2017-05-24 15:30:35 -0400 | [diff] [blame] | 304 | '-i', api.flavor.device_dirs.resource_dir, |
| 305 | '--images', api.flavor.device_path_join( |
Kevin Lubick | c2f3e8d | 2018-01-24 15:48:26 -0500 | [diff] [blame] | 306 | api.flavor.device_dirs.resource_dir, 'images', 'color_wheel.jpg'), |
Kevin Lubick | c78a2d7 | 2017-06-01 15:51:06 -0400 | [diff] [blame] | 307 | '--skps', api.flavor.device_dirs.skp_dir, |
Kevin Lubick | ffce079 | 2017-05-24 15:30:35 -0400 | [diff] [blame] | 308 | '--pre_log', |
Kevin Lubick | 5d750ed | 2018-01-22 11:32:39 -0500 | [diff] [blame] | 309 | '--match', # skia:6687 |
Kevin Lubick | ffce079 | 2017-05-24 15:30:35 -0400 | [diff] [blame] | 310 | '~matrixconvolution', |
| 311 | '~blur_image_filter', |
| 312 | '~blur_0.01', |
| 313 | '~GM_animated-image-blurs', |
Brian Salomon | 44acb5b | 2017-07-18 19:59:24 -0400 | [diff] [blame] | 314 | '~blendmode_mask_', |
Kevin Lubick | 5d750ed | 2018-01-22 11:32:39 -0500 | [diff] [blame] | 315 | '~desk_carsvg.skp', |
Chris Dalton | 035fcdf | 2017-11-07 15:34:22 -0700 | [diff] [blame] | 316 | '~^path_text_clipped', # Bot times out; skia:7190 |
Kevin Lubick | 03bd9ee | 2018-01-29 10:30:02 -0500 | [diff] [blame] | 317 | '~shapes_rrect_inner_rrect_50_500x500', # skia:7551 |
Kevin Lubick | b6d09b7 | 2017-06-15 15:21:17 -0400 | [diff] [blame] | 318 | ]) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 319 | |
Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 320 | if upload_perf_results(b): |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 321 | now = api.time.utcnow() |
| 322 | ts = int(calendar.timegm(now.utctimetuple())) |
| 323 | json_path = api.flavor.device_path_join( |
| 324 | api.flavor.device_dirs.perf_data_dir, |
Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 325 | 'nanobench_%s_%d.json' % (api.properties['revision'], ts)) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 326 | args.extend(['--outResultsFile', json_path]) |
| 327 | args.extend(properties) |
| 328 | |
Kevin Lubick | 9ef6de7 | 2017-10-15 21:05:58 -0400 | [diff] [blame] | 329 | keys_blacklist = ['configuration', 'role', 'test_filter'] |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 330 | args.append('--key') |
| 331 | for k in sorted(api.vars.builder_cfg.keys()): |
| 332 | if not k in keys_blacklist: |
| 333 | args.extend([k, api.vars.builder_cfg[k]]) |
| 334 | |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 335 | # See skia:2789. |
Ben Wagner | 37491d2 | 2017-12-13 13:00:47 -0500 | [diff] [blame] | 336 | if 'AbandonGpuContext' in api.vars.extra_tokens: |
Ben Wagner | 32fa510 | 2017-08-10 21:25:55 -0400 | [diff] [blame] | 337 | args.extend(['--abandonGpuContext']) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 338 | |
Ben Wagner | 5655ba4 | 2017-10-02 10:48:32 -0400 | [diff] [blame] | 339 | api.run(api.flavor.step, target, cmd=args, |
| 340 | abort_on_failure=False) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 341 | |
| 342 | # Copy results to swarming out dir. |
Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 343 | if upload_perf_results(b): |
| 344 | api.file.ensure_directory( |
| 345 | 'makedirs perf_dir', |
Eric Boren | cd0a98c | 2018-06-20 13:23:16 -0400 | [diff] [blame] | 346 | api.flavor.host_dirs.perf_data_dir) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 347 | api.flavor.copy_directory_contents_to_host( |
| 348 | api.flavor.device_dirs.perf_data_dir, |
Eric Boren | 72f6668 | 2018-05-18 07:36:55 -0400 | [diff] [blame] | 349 | api.flavor.host_dirs.perf_data_dir) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 350 | |
| 351 | |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 352 | def RunSteps(api): |
Eric Boren | b702316 | 2018-05-04 13:46:15 -0400 | [diff] [blame] | 353 | api.vars.setup() |
| 354 | api.file.ensure_directory('makedirs tmp_dir', api.vars.tmp_dir) |
| 355 | api.flavor.setup() |
| 356 | |
Eric Boren | 896af75 | 2017-04-24 13:22:56 -0400 | [diff] [blame] | 357 | env = {} |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 358 | if 'iOS' in api.vars.builder_name: |
| 359 | env['IOS_BUNDLE_ID'] = 'com.google.nanobench' |
Stephan Altmueller | 63e843d | 2017-04-25 11:38:38 -0400 | [diff] [blame] | 360 | env['IOS_MOUNT_POINT'] = api.vars.slave_dir.join('mnt_iosdevice') |
Eric Boren | 896af75 | 2017-04-24 13:22:56 -0400 | [diff] [blame] | 361 | with api.env(env): |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 362 | try: |
| 363 | if 'Chromecast' in api.vars.builder_name: |
| 364 | api.flavor.install(resources=True, skps=True) |
| 365 | else: |
| 366 | api.flavor.install_everything() |
| 367 | perf_steps(api) |
| 368 | finally: |
| 369 | api.flavor.cleanup_steps() |
| 370 | api.run.check_failure() |
| 371 | |
| 372 | |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 373 | TEST_BUILDERS = [ |
Kevin Lubick | 9ef6de7 | 2017-10-15 21:05:58 -0400 | [diff] [blame] | 374 | 'Perf-Android-Clang-Nexus5-GPU-Adreno330-arm-Debug-All-Android', |
Ben Wagner | 6f96c02 | 2018-06-21 12:12:01 -0400 | [diff] [blame^] | 375 | ('Perf-Android-Clang-Nexus5x-GPU-Adreno418-arm64-Release-All-' |
| 376 | 'Android_NoGPUThreads'), |
Kevin Lubick | 9ef6de7 | 2017-10-15 21:05:58 -0400 | [diff] [blame] | 377 | 'Perf-Android-Clang-NexusPlayer-GPU-PowerVR-x86-Release-All-Android_Vulkan', |
Kevin Lubick | d7af1db | 2017-11-02 12:03:22 -0400 | [diff] [blame] | 378 | 'Perf-ChromeOS-Clang-ASUSChromebookFlipC100-GPU-MaliT764-arm-Release-All', |
Kevin Lubick | 9ef6de7 | 2017-10-15 21:05:58 -0400 | [diff] [blame] | 379 | 'Perf-Chromecast-GCC-Chorizo-CPU-Cortex_A7-arm-Debug-All', |
| 380 | 'Perf-Chromecast-GCC-Chorizo-GPU-Cortex_A7-arm-Release-All', |
Ben Wagner | bee6cac | 2017-12-04 11:15:58 -0500 | [diff] [blame] | 381 | 'Perf-Debian9-Clang-GCE-CPU-AVX2-x86_64-Debug-All-ASAN', |
Kevin Lubick | 88611a1 | 2018-04-26 09:46:45 -0400 | [diff] [blame] | 382 | 'Perf-Debian9-Clang-NUC5PPYH-GPU-IntelHD405-x86_64-Debug-All-Vulkan', |
Kevin Lubick | 88611a1 | 2018-04-26 09:46:45 -0400 | [diff] [blame] | 383 | 'Perf-Debian9-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All', |
Kevin Lubick | 9ef6de7 | 2017-10-15 21:05:58 -0400 | [diff] [blame] | 384 | ('Perf-Mac-Clang-MacMini7.1-GPU-IntelIris5100-x86_64-Release-All-' |
Kevin Lubick | 88611a1 | 2018-04-26 09:46:45 -0400 | [diff] [blame] | 385 | 'CommandBuffer'), |
Chris Dalton | 2b937f5 | 2018-05-17 10:17:10 -0600 | [diff] [blame] | 386 | ('Perf-Mac-Clang-MacBookPro11.5-GPU-RadeonHD8870M-x86_64-Release-All-' |
| 387 | 'MoltenVK_Vulkan'), |
Kevin Lubick | 9ef6de7 | 2017-10-15 21:05:58 -0400 | [diff] [blame] | 388 | ('Perf-Ubuntu17-GCC-Golo-GPU-QuadroP400-x86_64-Release-All-' |
Kevin Lubick | 88611a1 | 2018-04-26 09:46:45 -0400 | [diff] [blame] | 389 | 'Valgrind_AbandonGpuContext_SK_CPU_LIMIT_SSE41'), |
Ben Wagner | 84447e0 | 2018-02-28 15:51:30 -0500 | [diff] [blame] | 390 | 'Perf-Win10-Clang-AlphaR2-GPU-RadeonR9M470X-x86_64-Release-All-Vulkan', |
Ben Wagner | 7464a26 | 2018-04-19 15:49:18 -0400 | [diff] [blame] | 391 | 'Perf-Win10-Clang-Golo-GPU-QuadroP400-x86_64-Release-All-ANGLE', |
Ben Wagner | b2fd61a | 2017-10-23 16:01:44 -0400 | [diff] [blame] | 392 | 'Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-All-ANGLE', |
Kevin Lubick | 9ef6de7 | 2017-10-15 21:05:58 -0400 | [diff] [blame] | 393 | 'Perf-Win10-Clang-NUC6i5SYK-GPU-IntelIris540-x86_64-Release-All-Vulkan', |
Kevin Lubick | 9ef6de7 | 2017-10-15 21:05:58 -0400 | [diff] [blame] | 394 | 'Perf-iOS-Clang-iPadPro-GPU-GT7800-arm64-Release-All', |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 395 | ] |
borenet | 1ed2ae4 | 2016-07-26 11:52:17 -0700 | [diff] [blame] | 396 | |
| 397 | |
| 398 | def GenTests(api): |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 399 | for builder in TEST_BUILDERS: |
| 400 | test = ( |
| 401 | api.test(builder) + |
| 402 | api.properties(buildername=builder, |
| 403 | revision='abc123', |
| 404 | path_config='kitchen', |
| 405 | swarm_out_dir='[SWARM_OUT_DIR]') + |
| 406 | api.path.exists( |
| 407 | api.path['start_dir'].join('skia'), |
| 408 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 409 | 'skimage', 'VERSION'), |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 410 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 411 | 'skp', 'VERSION'), |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 412 | api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt') |
Ben Wagner | f835c22 | 2017-04-30 11:14:51 -0400 | [diff] [blame] | 413 | ) + |
| 414 | api.step_data('get swarming bot id', |
| 415 | stdout=api.raw_io.output('skia-bot-123')) + |
| 416 | api.step_data('get swarming task id', |
| 417 | stdout=api.raw_io.output('123456')) |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 418 | ) |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 419 | if 'Win' in builder: |
| 420 | test += api.platform('win', 64) |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 421 | |
Eric Boren | f9aa9e5 | 2017-04-10 09:56:10 -0400 | [diff] [blame] | 422 | if 'Chromecast' in builder: |
| 423 | test += api.step_data( |
| 424 | 'read chromecast ip', |
| 425 | stdout=api.raw_io.output('192.168.1.2:5555')) |
| 426 | |
| 427 | if 'ChromeOS' in builder: |
| 428 | test += api.step_data( |
| 429 | 'read chromeos ip', |
| 430 | stdout=api.raw_io.output('{"user_ip":"foo@127.0.0.1"}')) |
| 431 | |
| 432 | yield test |
Eric Boren | 4c7754c | 2017-04-10 08:19:10 -0400 | [diff] [blame] | 433 | |
Kevin Lubick | 9ef6de7 | 2017-10-15 21:05:58 -0400 | [diff] [blame] | 434 | builder = 'Perf-Win10-Clang-NUCD34010WYKH-GPU-IntelHD4400-x86_64-Release-All' |
Kevin Lubick | fe079d4 | 2017-04-12 08:31:48 -0400 | [diff] [blame] | 435 | yield ( |
| 436 | api.test('trybot') + |
| 437 | api.properties(buildername=builder, |
| 438 | revision='abc123', |
| 439 | path_config='kitchen', |
| 440 | swarm_out_dir='[SWARM_OUT_DIR]') + |
| 441 | api.properties(patch_storage='gerrit') + |
| 442 | api.properties.tryserver( |
| 443 | buildername=builder, |
| 444 | gerrit_project='skia', |
| 445 | gerrit_url='https://skia-review.googlesource.com/', |
| 446 | )+ |
| 447 | api.path.exists( |
| 448 | api.path['start_dir'].join('skia'), |
| 449 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
| 450 | 'skimage', 'VERSION'), |
| 451 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
| 452 | 'skp', 'VERSION'), |
| 453 | api.path['start_dir'].join('skia', 'infra', 'bots', 'assets', |
| 454 | 'svg', 'VERSION'), |
| 455 | api.path['start_dir'].join('tmp', 'uninteresting_hashes.txt') |
| 456 | ) |
| 457 | ) |