1[ 2 { 3 "cmd": [ 4 "vpython", 5 "-u", 6 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 7 "--json-output", 8 "/path/to/tmp/json", 9 "ensure-directory", 10 "--mode", 11 "0777", 12 "[START_DIR]/tmp" 13 ], 14 "infra_step": true, 15 "name": "makedirs tmp_dir" 16 }, 17 { 18 "cmd": [ 19 "vpython", 20 "-u", 21 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 22 "--json-output", 23 "/path/to/tmp/json", 24 "copy", 25 "[START_DIR]/skia/infra/bots/assets/lottie-samples/VERSION", 26 "/path/to/tmp/" 27 ], 28 "infra_step": true, 29 "name": "Get lottie-samples VERSION", 30 "~followup_annotations": [ 31 "@@@STEP_LOG_LINE@VERSION@42@@@", 32 "@@@STEP_LOG_END@VERSION@@@" 33 ] 34 }, 35 { 36 "cmd": [ 37 "vpython", 38 "-u", 39 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 40 "--json-output", 41 "/path/to/tmp/json", 42 "copy", 43 "42", 44 "[START_DIR]/tmp/LOTTIE_VERSION" 45 ], 46 "infra_step": true, 47 "name": "write LOTTIE_VERSION", 48 "~followup_annotations": [ 49 "@@@STEP_LOG_LINE@LOTTIE_VERSION@42@@@", 50 "@@@STEP_LOG_END@LOTTIE_VERSION@@@" 51 ] 52 }, 53 { 54 "cmd": [ 55 "vpython", 56 "-u", 57 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 58 "--json-output", 59 "/path/to/tmp/json", 60 "rmtree", 61 "[START_DIR]/[SWARM_OUT_DIR]" 62 ], 63 "infra_step": true, 64 "name": "rmtree [SWARM_OUT_DIR]" 65 }, 66 { 67 "cmd": [ 68 "vpython", 69 "-u", 70 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 71 "--json-output", 72 "/path/to/tmp/json", 73 "ensure-directory", 74 "--mode", 75 "0777", 76 "[START_DIR]/[SWARM_OUT_DIR]" 77 ], 78 "infra_step": true, 79 "name": "makedirs [SWARM_OUT_DIR]" 80 }, 81 { 82 "cmd": [ 83 "vpython", 84 "-u", 85 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 86 "--json-output", 87 "/path/to/tmp/json", 88 "listdir", 89 "[START_DIR]/lottie-samples" 90 ], 91 "infra_step": true, 92 "name": "list lottie files", 93 "~followup_annotations": [ 94 "@@@STEP_LOG_LINE@listdir@[START_DIR]/lottie-samples/LICENSE@@@", 95 "@@@STEP_LOG_LINE@listdir@[START_DIR]/lottie-samples/lottie 3!.json@@@", 96 "@@@STEP_LOG_LINE@listdir@[START_DIR]/lottie-samples/lottie(test)'!2.json@@@", 97 "@@@STEP_LOG_LINE@listdir@[START_DIR]/lottie-samples/lottie1.json@@@", 98 "@@@STEP_LOG_END@listdir@@@" 99 ] 100 }, 101 { 102 "cmd": [ 103 "python", 104 "-u", 105 "RECIPE_MODULE[skia::flavor]/resources/symbolize_stack_trace.py", 106 "[START_DIR]", 107 "catchsegv", 108 "[START_DIR]/build/dm", 109 "--resourcePath", 110 "[START_DIR]/skia/resources", 111 "--lotties", 112 "[START_DIR]/lottie-samples", 113 "--src", 114 "lottie", 115 "--nonativeFonts", 116 "--verbose", 117 "--traceMatch", 118 "skottie", 119 "--trace", 120 "[START_DIR]/[SWARM_OUT_DIR]/2.json", 121 "--match", 122 "^lottie 3!.json$", 123 "--config", 124 "8888", 125 "--nogpu" 126 ], 127 "cwd": "[START_DIR]/skia", 128 "env": { 129 "CHROME_HEADLESS": "1", 130 "PATH": "<PATH>:RECIPE_REPO[depot_tools]" 131 }, 132 "name": "symbolized dm" 133 }, 134 { 135 "cmd": [ 136 "vpython", 137 "-u", 138 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 139 "--json-output", 140 "/path/to/tmp/json", 141 "copy", 142 "[START_DIR]/[SWARM_OUT_DIR]/2.json", 143 "/path/to/tmp/" 144 ], 145 "infra_step": true, 146 "name": "read [START_DIR]/[SWARM_OUT_DIR]/2.json", 147 "~followup_annotations": [ 148 "@@@STEP_LOG_END@2.json@@@" 149 ] 150 }, 151 { 152 "cmd": [ 153 "python", 154 "-u", 155 "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\ntrace_json = json.loads(trace_output)\nlottie_filename = sys.argv[2]\noutput_json_file = sys.argv[3]\n\nperf_results = {}\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_start = False\nfor trace in trace_json:\n if 'skottie::Animation::seek' in trace['name']:\n if frame_start:\n raise Exception('We got consecutive Animation::seek without a ' +\n 'render. Something is wrong.')\n frame_start = True\n current_frame_duration = trace['dur']\n elif 'skottie::Animation::render' in trace['name']:\n if not frame_start:\n raise Exception('We got an Animation::render without a seek first. ' +\n 'Something is wrong.')\n\n current_frame_duration += trace['dur']\n frame_start = False\n total_frames += 1\n frame_max = max(frame_max, current_frame_duration)\n frame_min = (min(frame_min, current_frame_duration)\n if frame_min else current_frame_duration)\n frame_cumulative += current_frame_duration\n\nexpected_dm_frames = 25\nif total_frames != expected_dm_frames:\n raise Exception(\n 'Got ' + str(total_frames) + ' frames instead of ' +\n str(expected_dm_frames))\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/total_frames\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n f.write(json.dumps(perf_results))\n", 156 "\n[{\"ph\":\"X\",\"name\":\"void skottie::Animation::seek(SkScalar)\",\"ts\":452,\"dur\":2.57,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void SkCanvas::drawPaint(const SkPaint &)\",\"ts\":473,\"dur\":2.67e+03,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::seek(SkScalar)\",\"ts\":3.15e+03,\"dur\":2.25,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::render(SkCanvas *, const SkRect *, RenderFlags) const\",\"ts\":3.15e+03,\"dur\":216,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void SkCanvas::drawPath(const SkPath &, const SkPaint &)\",\"ts\":3.35e+03,\"dur\":15.1,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::seek(SkScalar)\",\"ts\":3.37e+03,\"dur\":1.17,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::render(SkCanvas *, const SkRect *, RenderFlags) const\",\"ts\":3.37e+03,\"dur\":140,\"tid\":1,\"pid\":0}]\n", 157 "lottie 3!.json", 158 "/path/to/tmp/json" 159 ], 160 "env": { 161 "CHROME_HEADLESS": "1", 162 "PATH": "<PATH>:RECIPE_REPO[depot_tools]" 163 }, 164 "name": "parse lottie 3!.json trace", 165 "~followup_annotations": [ 166 "@@@STEP_LOG_LINE@json.output@{@@@", 167 "@@@STEP_LOG_LINE@json.output@ \"frame_avg_us\": 179.71, @@@", 168 "@@@STEP_LOG_LINE@json.output@ \"frame_max_us\": 218.25, @@@", 169 "@@@STEP_LOG_LINE@json.output@ \"frame_min_us\": 141.17@@@", 170 "@@@STEP_LOG_LINE@json.output@}@@@", 171 "@@@STEP_LOG_END@json.output@@@", 172 "@@@STEP_LOG_LINE@python.inline@@@@", 173 "@@@STEP_LOG_LINE@python.inline@import json@@@", 174 "@@@STEP_LOG_LINE@python.inline@import sys@@@", 175 "@@@STEP_LOG_LINE@python.inline@@@@", 176 "@@@STEP_LOG_LINE@python.inline@trace_output = sys.argv[1]@@@", 177 "@@@STEP_LOG_LINE@python.inline@trace_json = json.loads(trace_output)@@@", 178 "@@@STEP_LOG_LINE@python.inline@lottie_filename = sys.argv[2]@@@", 179 "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[3]@@@", 180 "@@@STEP_LOG_LINE@python.inline@@@@", 181 "@@@STEP_LOG_LINE@python.inline@perf_results = {}@@@", 182 "@@@STEP_LOG_LINE@python.inline@frame_max = 0@@@", 183 "@@@STEP_LOG_LINE@python.inline@frame_min = 0@@@", 184 "@@@STEP_LOG_LINE@python.inline@frame_cumulative = 0@@@", 185 "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@", 186 "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@", 187 "@@@STEP_LOG_LINE@python.inline@frame_start = False@@@", 188 "@@@STEP_LOG_LINE@python.inline@for trace in trace_json:@@@", 189 "@@@STEP_LOG_LINE@python.inline@ if 'skottie::Animation::seek' in trace['name']:@@@", 190 "@@@STEP_LOG_LINE@python.inline@ if frame_start:@@@", 191 "@@@STEP_LOG_LINE@python.inline@ raise Exception('We got consecutive Animation::seek without a ' +@@@", 192 "@@@STEP_LOG_LINE@python.inline@ 'render. Something is wrong.')@@@", 193 "@@@STEP_LOG_LINE@python.inline@ frame_start = True@@@", 194 "@@@STEP_LOG_LINE@python.inline@ current_frame_duration = trace['dur']@@@", 195 "@@@STEP_LOG_LINE@python.inline@ elif 'skottie::Animation::render' in trace['name']:@@@", 196 "@@@STEP_LOG_LINE@python.inline@ if not frame_start:@@@", 197 "@@@STEP_LOG_LINE@python.inline@ raise Exception('We got an Animation::render without a seek first. ' +@@@", 198 "@@@STEP_LOG_LINE@python.inline@ 'Something is wrong.')@@@", 199 "@@@STEP_LOG_LINE@python.inline@@@@", 200 "@@@STEP_LOG_LINE@python.inline@ current_frame_duration += trace['dur']@@@", 201 "@@@STEP_LOG_LINE@python.inline@ frame_start = False@@@", 202 "@@@STEP_LOG_LINE@python.inline@ total_frames += 1@@@", 203 "@@@STEP_LOG_LINE@python.inline@ frame_max = max(frame_max, current_frame_duration)@@@", 204 "@@@STEP_LOG_LINE@python.inline@ frame_min = (min(frame_min, current_frame_duration)@@@", 205 "@@@STEP_LOG_LINE@python.inline@ if frame_min else current_frame_duration)@@@", 206 "@@@STEP_LOG_LINE@python.inline@ frame_cumulative += current_frame_duration@@@", 207 "@@@STEP_LOG_LINE@python.inline@@@@", 208 "@@@STEP_LOG_LINE@python.inline@expected_dm_frames = 25@@@", 209 "@@@STEP_LOG_LINE@python.inline@if total_frames != expected_dm_frames:@@@", 210 "@@@STEP_LOG_LINE@python.inline@ raise Exception(@@@", 211 "@@@STEP_LOG_LINE@python.inline@ 'Got ' + str(total_frames) + ' frames instead of ' +@@@", 212 "@@@STEP_LOG_LINE@python.inline@ str(expected_dm_frames))@@@", 213 "@@@STEP_LOG_LINE@python.inline@perf_results['frame_max_us'] = frame_max@@@", 214 "@@@STEP_LOG_LINE@python.inline@perf_results['frame_min_us'] = frame_min@@@", 215 "@@@STEP_LOG_LINE@python.inline@perf_results['frame_avg_us'] = frame_cumulative/total_frames@@@", 216 "@@@STEP_LOG_LINE@python.inline@@@@", 217 "@@@STEP_LOG_LINE@python.inline@# Write perf_results to the output json.@@@", 218 "@@@STEP_LOG_LINE@python.inline@with open(output_json_file, 'w') as f:@@@", 219 "@@@STEP_LOG_LINE@python.inline@ f.write(json.dumps(perf_results))@@@", 220 "@@@STEP_LOG_END@python.inline@@@" 221 ] 222 }, 223 { 224 "cmd": [ 225 "vpython", 226 "-u", 227 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 228 "--json-output", 229 "/path/to/tmp/json", 230 "remove", 231 "[START_DIR]/[SWARM_OUT_DIR]/2.json" 232 ], 233 "infra_step": true, 234 "name": "remove [START_DIR]/[SWARM_OUT_DIR]/2.json" 235 }, 236 { 237 "cmd": [ 238 "python", 239 "-u", 240 "RECIPE_MODULE[skia::flavor]/resources/symbolize_stack_trace.py", 241 "[START_DIR]", 242 "catchsegv", 243 "[START_DIR]/build/dm", 244 "--resourcePath", 245 "[START_DIR]/skia/resources", 246 "--lotties", 247 "[START_DIR]/lottie-samples", 248 "--src", 249 "lottie", 250 "--nonativeFonts", 251 "--verbose", 252 "--traceMatch", 253 "skottie", 254 "--trace", 255 "[START_DIR]/[SWARM_OUT_DIR]/3.json", 256 "--match", 257 "^lottie(test)'!2.json$", 258 "--config", 259 "8888", 260 "--nogpu" 261 ], 262 "cwd": "[START_DIR]/skia", 263 "env": { 264 "CHROME_HEADLESS": "1", 265 "PATH": "<PATH>:RECIPE_REPO[depot_tools]" 266 }, 267 "name": "symbolized dm (2)" 268 }, 269 { 270 "cmd": [ 271 "vpython", 272 "-u", 273 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 274 "--json-output", 275 "/path/to/tmp/json", 276 "copy", 277 "[START_DIR]/[SWARM_OUT_DIR]/3.json", 278 "/path/to/tmp/" 279 ], 280 "infra_step": true, 281 "name": "read [START_DIR]/[SWARM_OUT_DIR]/3.json", 282 "~followup_annotations": [ 283 "@@@STEP_LOG_END@3.json@@@" 284 ] 285 }, 286 { 287 "cmd": [ 288 "python", 289 "-u", 290 "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\ntrace_json = json.loads(trace_output)\nlottie_filename = sys.argv[2]\noutput_json_file = sys.argv[3]\n\nperf_results = {}\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_start = False\nfor trace in trace_json:\n if 'skottie::Animation::seek' in trace['name']:\n if frame_start:\n raise Exception('We got consecutive Animation::seek without a ' +\n 'render. Something is wrong.')\n frame_start = True\n current_frame_duration = trace['dur']\n elif 'skottie::Animation::render' in trace['name']:\n if not frame_start:\n raise Exception('We got an Animation::render without a seek first. ' +\n 'Something is wrong.')\n\n current_frame_duration += trace['dur']\n frame_start = False\n total_frames += 1\n frame_max = max(frame_max, current_frame_duration)\n frame_min = (min(frame_min, current_frame_duration)\n if frame_min else current_frame_duration)\n frame_cumulative += current_frame_duration\n\nexpected_dm_frames = 25\nif total_frames != expected_dm_frames:\n raise Exception(\n 'Got ' + str(total_frames) + ' frames instead of ' +\n str(expected_dm_frames))\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/total_frames\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n f.write(json.dumps(perf_results))\n", 291 "\n[{\"ph\":\"X\",\"name\":\"void skottie::Animation::seek(SkScalar)\",\"ts\":452,\"dur\":2.57,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void SkCanvas::drawPaint(const SkPaint &)\",\"ts\":473,\"dur\":2.67e+03,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::seek(SkScalar)\",\"ts\":3.15e+03,\"dur\":2.25,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::render(SkCanvas *, const SkRect *, RenderFlags) const\",\"ts\":3.15e+03,\"dur\":216,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void SkCanvas::drawPath(const SkPath &, const SkPaint &)\",\"ts\":3.35e+03,\"dur\":15.1,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::seek(SkScalar)\",\"ts\":3.37e+03,\"dur\":1.17,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::render(SkCanvas *, const SkRect *, RenderFlags) const\",\"ts\":3.37e+03,\"dur\":140,\"tid\":1,\"pid\":0}]\n", 292 "lottie(test)'!2.json", 293 "/path/to/tmp/json" 294 ], 295 "env": { 296 "CHROME_HEADLESS": "1", 297 "PATH": "<PATH>:RECIPE_REPO[depot_tools]" 298 }, 299 "name": "parse lottie(test)'!2.json trace", 300 "~followup_annotations": [ 301 "@@@STEP_LOG_LINE@json.output@{@@@", 302 "@@@STEP_LOG_LINE@json.output@ \"frame_avg_us\": 179.71, @@@", 303 "@@@STEP_LOG_LINE@json.output@ \"frame_max_us\": 218.25, @@@", 304 "@@@STEP_LOG_LINE@json.output@ \"frame_min_us\": 141.17@@@", 305 "@@@STEP_LOG_LINE@json.output@}@@@", 306 "@@@STEP_LOG_END@json.output@@@", 307 "@@@STEP_LOG_LINE@python.inline@@@@", 308 "@@@STEP_LOG_LINE@python.inline@import json@@@", 309 "@@@STEP_LOG_LINE@python.inline@import sys@@@", 310 "@@@STEP_LOG_LINE@python.inline@@@@", 311 "@@@STEP_LOG_LINE@python.inline@trace_output = sys.argv[1]@@@", 312 "@@@STEP_LOG_LINE@python.inline@trace_json = json.loads(trace_output)@@@", 313 "@@@STEP_LOG_LINE@python.inline@lottie_filename = sys.argv[2]@@@", 314 "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[3]@@@", 315 "@@@STEP_LOG_LINE@python.inline@@@@", 316 "@@@STEP_LOG_LINE@python.inline@perf_results = {}@@@", 317 "@@@STEP_LOG_LINE@python.inline@frame_max = 0@@@", 318 "@@@STEP_LOG_LINE@python.inline@frame_min = 0@@@", 319 "@@@STEP_LOG_LINE@python.inline@frame_cumulative = 0@@@", 320 "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@", 321 "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@", 322 "@@@STEP_LOG_LINE@python.inline@frame_start = False@@@", 323 "@@@STEP_LOG_LINE@python.inline@for trace in trace_json:@@@", 324 "@@@STEP_LOG_LINE@python.inline@ if 'skottie::Animation::seek' in trace['name']:@@@", 325 "@@@STEP_LOG_LINE@python.inline@ if frame_start:@@@", 326 "@@@STEP_LOG_LINE@python.inline@ raise Exception('We got consecutive Animation::seek without a ' +@@@", 327 "@@@STEP_LOG_LINE@python.inline@ 'render. Something is wrong.')@@@", 328 "@@@STEP_LOG_LINE@python.inline@ frame_start = True@@@", 329 "@@@STEP_LOG_LINE@python.inline@ current_frame_duration = trace['dur']@@@", 330 "@@@STEP_LOG_LINE@python.inline@ elif 'skottie::Animation::render' in trace['name']:@@@", 331 "@@@STEP_LOG_LINE@python.inline@ if not frame_start:@@@", 332 "@@@STEP_LOG_LINE@python.inline@ raise Exception('We got an Animation::render without a seek first. ' +@@@", 333 "@@@STEP_LOG_LINE@python.inline@ 'Something is wrong.')@@@", 334 "@@@STEP_LOG_LINE@python.inline@@@@", 335 "@@@STEP_LOG_LINE@python.inline@ current_frame_duration += trace['dur']@@@", 336 "@@@STEP_LOG_LINE@python.inline@ frame_start = False@@@", 337 "@@@STEP_LOG_LINE@python.inline@ total_frames += 1@@@", 338 "@@@STEP_LOG_LINE@python.inline@ frame_max = max(frame_max, current_frame_duration)@@@", 339 "@@@STEP_LOG_LINE@python.inline@ frame_min = (min(frame_min, current_frame_duration)@@@", 340 "@@@STEP_LOG_LINE@python.inline@ if frame_min else current_frame_duration)@@@", 341 "@@@STEP_LOG_LINE@python.inline@ frame_cumulative += current_frame_duration@@@", 342 "@@@STEP_LOG_LINE@python.inline@@@@", 343 "@@@STEP_LOG_LINE@python.inline@expected_dm_frames = 25@@@", 344 "@@@STEP_LOG_LINE@python.inline@if total_frames != expected_dm_frames:@@@", 345 "@@@STEP_LOG_LINE@python.inline@ raise Exception(@@@", 346 "@@@STEP_LOG_LINE@python.inline@ 'Got ' + str(total_frames) + ' frames instead of ' +@@@", 347 "@@@STEP_LOG_LINE@python.inline@ str(expected_dm_frames))@@@", 348 "@@@STEP_LOG_LINE@python.inline@perf_results['frame_max_us'] = frame_max@@@", 349 "@@@STEP_LOG_LINE@python.inline@perf_results['frame_min_us'] = frame_min@@@", 350 "@@@STEP_LOG_LINE@python.inline@perf_results['frame_avg_us'] = frame_cumulative/total_frames@@@", 351 "@@@STEP_LOG_LINE@python.inline@@@@", 352 "@@@STEP_LOG_LINE@python.inline@# Write perf_results to the output json.@@@", 353 "@@@STEP_LOG_LINE@python.inline@with open(output_json_file, 'w') as f:@@@", 354 "@@@STEP_LOG_LINE@python.inline@ f.write(json.dumps(perf_results))@@@", 355 "@@@STEP_LOG_END@python.inline@@@" 356 ] 357 }, 358 { 359 "cmd": [ 360 "vpython", 361 "-u", 362 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 363 "--json-output", 364 "/path/to/tmp/json", 365 "remove", 366 "[START_DIR]/[SWARM_OUT_DIR]/3.json" 367 ], 368 "infra_step": true, 369 "name": "remove [START_DIR]/[SWARM_OUT_DIR]/3.json" 370 }, 371 { 372 "cmd": [ 373 "python", 374 "-u", 375 "RECIPE_MODULE[skia::flavor]/resources/symbolize_stack_trace.py", 376 "[START_DIR]", 377 "catchsegv", 378 "[START_DIR]/build/dm", 379 "--resourcePath", 380 "[START_DIR]/skia/resources", 381 "--lotties", 382 "[START_DIR]/lottie-samples", 383 "--src", 384 "lottie", 385 "--nonativeFonts", 386 "--verbose", 387 "--traceMatch", 388 "skottie", 389 "--trace", 390 "[START_DIR]/[SWARM_OUT_DIR]/4.json", 391 "--match", 392 "^lottie1.json$", 393 "--config", 394 "8888", 395 "--nogpu" 396 ], 397 "cwd": "[START_DIR]/skia", 398 "env": { 399 "CHROME_HEADLESS": "1", 400 "PATH": "<PATH>:RECIPE_REPO[depot_tools]" 401 }, 402 "name": "symbolized dm (3)" 403 }, 404 { 405 "cmd": [ 406 "vpython", 407 "-u", 408 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 409 "--json-output", 410 "/path/to/tmp/json", 411 "copy", 412 "[START_DIR]/[SWARM_OUT_DIR]/4.json", 413 "/path/to/tmp/" 414 ], 415 "infra_step": true, 416 "name": "read [START_DIR]/[SWARM_OUT_DIR]/4.json", 417 "~followup_annotations": [ 418 "@@@STEP_LOG_END@4.json@@@" 419 ] 420 }, 421 { 422 "cmd": [ 423 "python", 424 "-u", 425 "\nimport json\nimport sys\n\ntrace_output = sys.argv[1]\ntrace_json = json.loads(trace_output)\nlottie_filename = sys.argv[2]\noutput_json_file = sys.argv[3]\n\nperf_results = {}\nframe_max = 0\nframe_min = 0\nframe_cumulative = 0\ncurrent_frame_duration = 0\ntotal_frames = 0\nframe_start = False\nfor trace in trace_json:\n if 'skottie::Animation::seek' in trace['name']:\n if frame_start:\n raise Exception('We got consecutive Animation::seek without a ' +\n 'render. Something is wrong.')\n frame_start = True\n current_frame_duration = trace['dur']\n elif 'skottie::Animation::render' in trace['name']:\n if not frame_start:\n raise Exception('We got an Animation::render without a seek first. ' +\n 'Something is wrong.')\n\n current_frame_duration += trace['dur']\n frame_start = False\n total_frames += 1\n frame_max = max(frame_max, current_frame_duration)\n frame_min = (min(frame_min, current_frame_duration)\n if frame_min else current_frame_duration)\n frame_cumulative += current_frame_duration\n\nexpected_dm_frames = 25\nif total_frames != expected_dm_frames:\n raise Exception(\n 'Got ' + str(total_frames) + ' frames instead of ' +\n str(expected_dm_frames))\nperf_results['frame_max_us'] = frame_max\nperf_results['frame_min_us'] = frame_min\nperf_results['frame_avg_us'] = frame_cumulative/total_frames\n\n# Write perf_results to the output json.\nwith open(output_json_file, 'w') as f:\n f.write(json.dumps(perf_results))\n", 426 "\n[{\"ph\":\"X\",\"name\":\"void skottie::Animation::seek(SkScalar)\",\"ts\":452,\"dur\":2.57,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void SkCanvas::drawPaint(const SkPaint &)\",\"ts\":473,\"dur\":2.67e+03,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::seek(SkScalar)\",\"ts\":3.15e+03,\"dur\":2.25,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::render(SkCanvas *, const SkRect *, RenderFlags) const\",\"ts\":3.15e+03,\"dur\":216,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void SkCanvas::drawPath(const SkPath &, const SkPaint &)\",\"ts\":3.35e+03,\"dur\":15.1,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::seek(SkScalar)\",\"ts\":3.37e+03,\"dur\":1.17,\"tid\":1,\"pid\":0},{\"ph\":\"X\",\"name\":\"void skottie::Animation::render(SkCanvas *, const SkRect *, RenderFlags) const\",\"ts\":3.37e+03,\"dur\":140,\"tid\":1,\"pid\":0}]\n", 427 "lottie1.json", 428 "/path/to/tmp/json" 429 ], 430 "env": { 431 "CHROME_HEADLESS": "1", 432 "PATH": "<PATH>:RECIPE_REPO[depot_tools]" 433 }, 434 "name": "parse lottie1.json trace", 435 "~followup_annotations": [ 436 "@@@STEP_LOG_LINE@json.output@{@@@", 437 "@@@STEP_LOG_LINE@json.output@ \"frame_avg_us\": 179.71, @@@", 438 "@@@STEP_LOG_LINE@json.output@ \"frame_max_us\": 218.25, @@@", 439 "@@@STEP_LOG_LINE@json.output@ \"frame_min_us\": 141.17@@@", 440 "@@@STEP_LOG_LINE@json.output@}@@@", 441 "@@@STEP_LOG_END@json.output@@@", 442 "@@@STEP_LOG_LINE@python.inline@@@@", 443 "@@@STEP_LOG_LINE@python.inline@import json@@@", 444 "@@@STEP_LOG_LINE@python.inline@import sys@@@", 445 "@@@STEP_LOG_LINE@python.inline@@@@", 446 "@@@STEP_LOG_LINE@python.inline@trace_output = sys.argv[1]@@@", 447 "@@@STEP_LOG_LINE@python.inline@trace_json = json.loads(trace_output)@@@", 448 "@@@STEP_LOG_LINE@python.inline@lottie_filename = sys.argv[2]@@@", 449 "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[3]@@@", 450 "@@@STEP_LOG_LINE@python.inline@@@@", 451 "@@@STEP_LOG_LINE@python.inline@perf_results = {}@@@", 452 "@@@STEP_LOG_LINE@python.inline@frame_max = 0@@@", 453 "@@@STEP_LOG_LINE@python.inline@frame_min = 0@@@", 454 "@@@STEP_LOG_LINE@python.inline@frame_cumulative = 0@@@", 455 "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@", 456 "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@", 457 "@@@STEP_LOG_LINE@python.inline@frame_start = False@@@", 458 "@@@STEP_LOG_LINE@python.inline@for trace in trace_json:@@@", 459 "@@@STEP_LOG_LINE@python.inline@ if 'skottie::Animation::seek' in trace['name']:@@@", 460 "@@@STEP_LOG_LINE@python.inline@ if frame_start:@@@", 461 "@@@STEP_LOG_LINE@python.inline@ raise Exception('We got consecutive Animation::seek without a ' +@@@", 462 "@@@STEP_LOG_LINE@python.inline@ 'render. Something is wrong.')@@@", 463 "@@@STEP_LOG_LINE@python.inline@ frame_start = True@@@", 464 "@@@STEP_LOG_LINE@python.inline@ current_frame_duration = trace['dur']@@@", 465 "@@@STEP_LOG_LINE@python.inline@ elif 'skottie::Animation::render' in trace['name']:@@@", 466 "@@@STEP_LOG_LINE@python.inline@ if not frame_start:@@@", 467 "@@@STEP_LOG_LINE@python.inline@ raise Exception('We got an Animation::render without a seek first. ' +@@@", 468 "@@@STEP_LOG_LINE@python.inline@ 'Something is wrong.')@@@", 469 "@@@STEP_LOG_LINE@python.inline@@@@", 470 "@@@STEP_LOG_LINE@python.inline@ current_frame_duration += trace['dur']@@@", 471 "@@@STEP_LOG_LINE@python.inline@ frame_start = False@@@", 472 "@@@STEP_LOG_LINE@python.inline@ total_frames += 1@@@", 473 "@@@STEP_LOG_LINE@python.inline@ frame_max = max(frame_max, current_frame_duration)@@@", 474 "@@@STEP_LOG_LINE@python.inline@ frame_min = (min(frame_min, current_frame_duration)@@@", 475 "@@@STEP_LOG_LINE@python.inline@ if frame_min else current_frame_duration)@@@", 476 "@@@STEP_LOG_LINE@python.inline@ frame_cumulative += current_frame_duration@@@", 477 "@@@STEP_LOG_LINE@python.inline@@@@", 478 "@@@STEP_LOG_LINE@python.inline@expected_dm_frames = 25@@@", 479 "@@@STEP_LOG_LINE@python.inline@if total_frames != expected_dm_frames:@@@", 480 "@@@STEP_LOG_LINE@python.inline@ raise Exception(@@@", 481 "@@@STEP_LOG_LINE@python.inline@ 'Got ' + str(total_frames) + ' frames instead of ' +@@@", 482 "@@@STEP_LOG_LINE@python.inline@ str(expected_dm_frames))@@@", 483 "@@@STEP_LOG_LINE@python.inline@perf_results['frame_max_us'] = frame_max@@@", 484 "@@@STEP_LOG_LINE@python.inline@perf_results['frame_min_us'] = frame_min@@@", 485 "@@@STEP_LOG_LINE@python.inline@perf_results['frame_avg_us'] = frame_cumulative/total_frames@@@", 486 "@@@STEP_LOG_LINE@python.inline@@@@", 487 "@@@STEP_LOG_LINE@python.inline@# Write perf_results to the output json.@@@", 488 "@@@STEP_LOG_LINE@python.inline@with open(output_json_file, 'w') as f:@@@", 489 "@@@STEP_LOG_LINE@python.inline@ f.write(json.dumps(perf_results))@@@", 490 "@@@STEP_LOG_END@python.inline@@@" 491 ] 492 }, 493 { 494 "cmd": [ 495 "vpython", 496 "-u", 497 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 498 "--json-output", 499 "/path/to/tmp/json", 500 "remove", 501 "[START_DIR]/[SWARM_OUT_DIR]/4.json" 502 ], 503 "infra_step": true, 504 "name": "remove [START_DIR]/[SWARM_OUT_DIR]/4.json" 505 }, 506 { 507 "cmd": [ 508 "python", 509 "-u", 510 "import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n" 511 ], 512 "name": "get swarming bot id", 513 "~followup_annotations": [ 514 "@@@STEP_LOG_LINE@python.inline@import os@@@", 515 "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@", 516 "@@@STEP_LOG_END@python.inline@@@" 517 ] 518 }, 519 { 520 "cmd": [ 521 "python", 522 "-u", 523 "import os\nprint os.environ.get('SWARMING_TASK_ID', '')\n" 524 ], 525 "name": "get swarming task id", 526 "~followup_annotations": [ 527 "@@@STEP_LOG_LINE@python.inline@import os@@@", 528 "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_TASK_ID', '')@@@", 529 "@@@STEP_LOG_END@python.inline@@@" 530 ] 531 }, 532 { 533 "cmd": [ 534 "vpython", 535 "-u", 536 "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py", 537 "--json-output", 538 "/path/to/tmp/json", 539 "ensure-directory", 540 "--mode", 541 "0777", 542 "[START_DIR]/[SWARM_OUT_DIR]" 543 ], 544 "infra_step": true, 545 "name": "makedirs perf_dir" 546 }, 547 { 548 "cmd": [ 549 "python", 550 "-u", 551 "import json\nwith open('[START_DIR]/[SWARM_OUT_DIR]/perf_abc123_1337000001.json', 'w') as outfile:\n json.dump(obj={'gitHash': 'abc123', 'results': {\"lottie(test)'!2.json\": {'gles': {'frame_avg_us': 179.71, 'frame_max_us': 218.25, 'frame_min_us': 141.17}}, 'lottie1.json': {'gles': {'frame_avg_us': 179.71, 'frame_max_us': 218.25, 'frame_min_us': 141.17}}, 'lottie 3!.json': {'gles': {'frame_avg_us': 179.71, 'frame_max_us': 218.25, 'frame_min_us': 141.17}}}, 'swarming_task_id': '', 'renderer': 'skottie', 'key': {'extra_config': 'SkottieTracing', 'bench_type': 'tracing', 'cpu_or_gpu_value': 'AVX2', 'arch': 'x86_64', 'source_type': 'skottie', 'cpu_or_gpu': 'CPU', 'model': 'GCE', 'configuration': 'Release', 'os': 'Debian9', 'compiler': 'Clang'}, 'swarming_bot_id': ''}, fp=outfile, indent=4)\n" 552 ], 553 "env": { 554 "CHROME_HEADLESS": "1", 555 "PATH": "<PATH>:RECIPE_REPO[depot_tools]" 556 }, 557 "name": "write output JSON", 558 "~followup_annotations": [ 559 "@@@STEP_LOG_LINE@python.inline@import json@@@", 560 "@@@STEP_LOG_LINE@python.inline@with open('[START_DIR]/[SWARM_OUT_DIR]/perf_abc123_1337000001.json', 'w') as outfile:@@@", 561 "@@@STEP_LOG_LINE@python.inline@ json.dump(obj={'gitHash': 'abc123', 'results': {\"lottie(test)'!2.json\": {'gles': {'frame_avg_us': 179.71, 'frame_max_us': 218.25, 'frame_min_us': 141.17}}, 'lottie1.json': {'gles': {'frame_avg_us': 179.71, 'frame_max_us': 218.25, 'frame_min_us': 141.17}}, 'lottie 3!.json': {'gles': {'frame_avg_us': 179.71, 'frame_max_us': 218.25, 'frame_min_us': 141.17}}}, 'swarming_task_id': '', 'renderer': 'skottie', 'key': {'extra_config': 'SkottieTracing', 'bench_type': 'tracing', 'cpu_or_gpu_value': 'AVX2', 'arch': 'x86_64', 'source_type': 'skottie', 'cpu_or_gpu': 'CPU', 'model': 'GCE', 'configuration': 'Release', 'os': 'Debian9', 'compiler': 'Clang'}, 'swarming_bot_id': ''}, fp=outfile, indent=4)@@@", 562 "@@@STEP_LOG_END@python.inline@@@" 563 ] 564 }, 565 { 566 "name": "$result" 567 } 568]