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