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