• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
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      "gles",
121      "--nocpu"
122    ],
123    "cwd": "[START_DIR]/skia",
124    "env": {
125      "CHROME_HEADLESS": "1",
126      "LD_LIBRARY_PATH": "[START_DIR]/mesa_intel_driver_linux",
127      "LIBGL_DRIVERS_PATH": "[START_DIR]/mesa_intel_driver_linux",
128      "PATH": "<PATH>:RECIPE_REPO[depot_tools]",
129      "VK_ICD_FILENAMES": "[START_DIR]/mesa_intel_driver_linux/intel_icd.x86_64.json"
130    },
131    "name": "symbolized dm"
132  },
133  {
134    "cmd": [
135      "python",
136      "-u",
137      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
138      "--json-output",
139      "/path/to/tmp/json",
140      "copy",
141      "[START_DIR]/[SWARM_OUT_DIR]/2.json",
142      "/path/to/tmp/"
143    ],
144    "infra_step": true,
145    "name": "read [START_DIR]/[SWARM_OUT_DIR]/2.json"
146  },
147  {
148    "cmd": [
149      "python",
150      "-u",
151      "\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",
152      "\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",
153      "lottie 3!.json",
154      "/path/to/tmp/json"
155    ],
156    "env": {
157      "CHROME_HEADLESS": "1",
158      "PATH": "<PATH>:RECIPE_REPO[depot_tools]"
159    },
160    "name": "parse lottie 3!.json trace",
161    "~followup_annotations": [
162      "@@@STEP_LOG_LINE@json.output@{@@@",
163      "@@@STEP_LOG_LINE@json.output@  \"frame_avg_us\": 179.71, @@@",
164      "@@@STEP_LOG_LINE@json.output@  \"frame_max_us\": 218.25, @@@",
165      "@@@STEP_LOG_LINE@json.output@  \"frame_min_us\": 141.17@@@",
166      "@@@STEP_LOG_LINE@json.output@}@@@",
167      "@@@STEP_LOG_END@json.output@@@",
168      "@@@STEP_LOG_LINE@python.inline@@@@",
169      "@@@STEP_LOG_LINE@python.inline@import json@@@",
170      "@@@STEP_LOG_LINE@python.inline@import sys@@@",
171      "@@@STEP_LOG_LINE@python.inline@@@@",
172      "@@@STEP_LOG_LINE@python.inline@trace_output = sys.argv[1]@@@",
173      "@@@STEP_LOG_LINE@python.inline@trace_json = json.loads(trace_output)@@@",
174      "@@@STEP_LOG_LINE@python.inline@lottie_filename = sys.argv[2]@@@",
175      "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[3]@@@",
176      "@@@STEP_LOG_LINE@python.inline@@@@",
177      "@@@STEP_LOG_LINE@python.inline@perf_results = {}@@@",
178      "@@@STEP_LOG_LINE@python.inline@frame_max = 0@@@",
179      "@@@STEP_LOG_LINE@python.inline@frame_min = 0@@@",
180      "@@@STEP_LOG_LINE@python.inline@frame_cumulative = 0@@@",
181      "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
182      "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
183      "@@@STEP_LOG_LINE@python.inline@frame_start = False@@@",
184      "@@@STEP_LOG_LINE@python.inline@skipped_first_seek = False  # Skip the first seek constructor call.@@@",
185      "@@@STEP_LOG_LINE@python.inline@for trace in trace_json:@@@",
186      "@@@STEP_LOG_LINE@python.inline@  if 'skottie::Animation::seek' in trace['name']:@@@",
187      "@@@STEP_LOG_LINE@python.inline@    if not skipped_first_seek:@@@",
188      "@@@STEP_LOG_LINE@python.inline@      skipped_first_seek = True@@@",
189      "@@@STEP_LOG_LINE@python.inline@      continue@@@",
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      "python",
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      "gles",
260      "--nocpu"
261    ],
262    "cwd": "[START_DIR]/skia",
263    "env": {
264      "CHROME_HEADLESS": "1",
265      "LD_LIBRARY_PATH": "[START_DIR]/mesa_intel_driver_linux",
266      "LIBGL_DRIVERS_PATH": "[START_DIR]/mesa_intel_driver_linux",
267      "PATH": "<PATH>:RECIPE_REPO[depot_tools]",
268      "VK_ICD_FILENAMES": "[START_DIR]/mesa_intel_driver_linux/intel_icd.x86_64.json"
269    },
270    "name": "symbolized dm (2)"
271  },
272  {
273    "cmd": [
274      "python",
275      "-u",
276      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
277      "--json-output",
278      "/path/to/tmp/json",
279      "copy",
280      "[START_DIR]/[SWARM_OUT_DIR]/3.json",
281      "/path/to/tmp/"
282    ],
283    "infra_step": true,
284    "name": "read [START_DIR]/[SWARM_OUT_DIR]/3.json"
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\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",
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@skipped_first_seek = False  # Skip the first seek constructor call.@@@",
324      "@@@STEP_LOG_LINE@python.inline@for trace in trace_json:@@@",
325      "@@@STEP_LOG_LINE@python.inline@  if 'skottie::Animation::seek' in trace['name']:@@@",
326      "@@@STEP_LOG_LINE@python.inline@    if not skipped_first_seek:@@@",
327      "@@@STEP_LOG_LINE@python.inline@      skipped_first_seek = True@@@",
328      "@@@STEP_LOG_LINE@python.inline@      continue@@@",
329      "@@@STEP_LOG_LINE@python.inline@    if frame_start:@@@",
330      "@@@STEP_LOG_LINE@python.inline@      raise Exception('We got consecutive Animation::seek without a ' +@@@",
331      "@@@STEP_LOG_LINE@python.inline@                      'render. Something is wrong.')@@@",
332      "@@@STEP_LOG_LINE@python.inline@    frame_start = True@@@",
333      "@@@STEP_LOG_LINE@python.inline@    current_frame_duration = trace['dur']@@@",
334      "@@@STEP_LOG_LINE@python.inline@  elif 'skottie::Animation::render' in trace['name']:@@@",
335      "@@@STEP_LOG_LINE@python.inline@    if not frame_start:@@@",
336      "@@@STEP_LOG_LINE@python.inline@      raise Exception('We got an Animation::render without a seek first. ' +@@@",
337      "@@@STEP_LOG_LINE@python.inline@                      'Something is wrong.')@@@",
338      "@@@STEP_LOG_LINE@python.inline@@@@",
339      "@@@STEP_LOG_LINE@python.inline@    current_frame_duration += trace['dur']@@@",
340      "@@@STEP_LOG_LINE@python.inline@    frame_start = False@@@",
341      "@@@STEP_LOG_LINE@python.inline@    total_frames += 1@@@",
342      "@@@STEP_LOG_LINE@python.inline@    frame_max = max(frame_max, current_frame_duration)@@@",
343      "@@@STEP_LOG_LINE@python.inline@    frame_min = (min(frame_min, current_frame_duration)@@@",
344      "@@@STEP_LOG_LINE@python.inline@                 if frame_min else current_frame_duration)@@@",
345      "@@@STEP_LOG_LINE@python.inline@    frame_cumulative += current_frame_duration@@@",
346      "@@@STEP_LOG_LINE@python.inline@@@@",
347      "@@@STEP_LOG_LINE@python.inline@expected_dm_frames = 25@@@",
348      "@@@STEP_LOG_LINE@python.inline@if total_frames != expected_dm_frames:@@@",
349      "@@@STEP_LOG_LINE@python.inline@  raise Exception(@@@",
350      "@@@STEP_LOG_LINE@python.inline@      'Got ' + str(total_frames) + ' frames instead of ' +@@@",
351      "@@@STEP_LOG_LINE@python.inline@      str(expected_dm_frames))@@@",
352      "@@@STEP_LOG_LINE@python.inline@perf_results['frame_max_us'] = frame_max@@@",
353      "@@@STEP_LOG_LINE@python.inline@perf_results['frame_min_us'] = frame_min@@@",
354      "@@@STEP_LOG_LINE@python.inline@perf_results['frame_avg_us'] = frame_cumulative/total_frames@@@",
355      "@@@STEP_LOG_LINE@python.inline@@@@",
356      "@@@STEP_LOG_LINE@python.inline@# Write perf_results to the output json.@@@",
357      "@@@STEP_LOG_LINE@python.inline@with open(output_json_file, 'w') as f:@@@",
358      "@@@STEP_LOG_LINE@python.inline@  f.write(json.dumps(perf_results))@@@",
359      "@@@STEP_LOG_END@python.inline@@@"
360    ]
361  },
362  {
363    "cmd": [
364      "python",
365      "-u",
366      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
367      "--json-output",
368      "/path/to/tmp/json",
369      "remove",
370      "[START_DIR]/[SWARM_OUT_DIR]/3.json"
371    ],
372    "infra_step": true,
373    "name": "remove [START_DIR]/[SWARM_OUT_DIR]/3.json"
374  },
375  {
376    "cmd": [
377      "python",
378      "-u",
379      "RECIPE_MODULE[skia::flavor]/resources/symbolize_stack_trace.py",
380      "[START_DIR]",
381      "catchsegv",
382      "[START_DIR]/build/dm",
383      "--resourcePath",
384      "[START_DIR]/skia/resources",
385      "--lotties",
386      "[START_DIR]/lottie-samples",
387      "--src",
388      "lottie",
389      "--nonativeFonts",
390      "--verbose",
391      "--traceMatch",
392      "skottie",
393      "--trace",
394      "[START_DIR]/[SWARM_OUT_DIR]/4.json",
395      "--match",
396      "^lottie1.json$",
397      "--config",
398      "gles",
399      "--nocpu"
400    ],
401    "cwd": "[START_DIR]/skia",
402    "env": {
403      "CHROME_HEADLESS": "1",
404      "LD_LIBRARY_PATH": "[START_DIR]/mesa_intel_driver_linux",
405      "LIBGL_DRIVERS_PATH": "[START_DIR]/mesa_intel_driver_linux",
406      "PATH": "<PATH>:RECIPE_REPO[depot_tools]",
407      "VK_ICD_FILENAMES": "[START_DIR]/mesa_intel_driver_linux/intel_icd.x86_64.json"
408    },
409    "name": "symbolized dm (3)"
410  },
411  {
412    "cmd": [
413      "python",
414      "-u",
415      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
416      "--json-output",
417      "/path/to/tmp/json",
418      "copy",
419      "[START_DIR]/[SWARM_OUT_DIR]/4.json",
420      "/path/to/tmp/"
421    ],
422    "infra_step": true,
423    "name": "read [START_DIR]/[SWARM_OUT_DIR]/4.json"
424  },
425  {
426    "cmd": [
427      "python",
428      "-u",
429      "\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",
430      "\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",
431      "lottie1.json",
432      "/path/to/tmp/json"
433    ],
434    "env": {
435      "CHROME_HEADLESS": "1",
436      "PATH": "<PATH>:RECIPE_REPO[depot_tools]"
437    },
438    "name": "parse lottie1.json trace",
439    "~followup_annotations": [
440      "@@@STEP_LOG_LINE@json.output@{@@@",
441      "@@@STEP_LOG_LINE@json.output@  \"frame_avg_us\": 179.71, @@@",
442      "@@@STEP_LOG_LINE@json.output@  \"frame_max_us\": 218.25, @@@",
443      "@@@STEP_LOG_LINE@json.output@  \"frame_min_us\": 141.17@@@",
444      "@@@STEP_LOG_LINE@json.output@}@@@",
445      "@@@STEP_LOG_END@json.output@@@",
446      "@@@STEP_LOG_LINE@python.inline@@@@",
447      "@@@STEP_LOG_LINE@python.inline@import json@@@",
448      "@@@STEP_LOG_LINE@python.inline@import sys@@@",
449      "@@@STEP_LOG_LINE@python.inline@@@@",
450      "@@@STEP_LOG_LINE@python.inline@trace_output = sys.argv[1]@@@",
451      "@@@STEP_LOG_LINE@python.inline@trace_json = json.loads(trace_output)@@@",
452      "@@@STEP_LOG_LINE@python.inline@lottie_filename = sys.argv[2]@@@",
453      "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[3]@@@",
454      "@@@STEP_LOG_LINE@python.inline@@@@",
455      "@@@STEP_LOG_LINE@python.inline@perf_results = {}@@@",
456      "@@@STEP_LOG_LINE@python.inline@frame_max = 0@@@",
457      "@@@STEP_LOG_LINE@python.inline@frame_min = 0@@@",
458      "@@@STEP_LOG_LINE@python.inline@frame_cumulative = 0@@@",
459      "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
460      "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
461      "@@@STEP_LOG_LINE@python.inline@frame_start = False@@@",
462      "@@@STEP_LOG_LINE@python.inline@skipped_first_seek = False  # Skip the first seek constructor call.@@@",
463      "@@@STEP_LOG_LINE@python.inline@for trace in trace_json:@@@",
464      "@@@STEP_LOG_LINE@python.inline@  if 'skottie::Animation::seek' in trace['name']:@@@",
465      "@@@STEP_LOG_LINE@python.inline@    if not skipped_first_seek:@@@",
466      "@@@STEP_LOG_LINE@python.inline@      skipped_first_seek = True@@@",
467      "@@@STEP_LOG_LINE@python.inline@      continue@@@",
468      "@@@STEP_LOG_LINE@python.inline@    if frame_start:@@@",
469      "@@@STEP_LOG_LINE@python.inline@      raise Exception('We got consecutive Animation::seek without a ' +@@@",
470      "@@@STEP_LOG_LINE@python.inline@                      'render. Something is wrong.')@@@",
471      "@@@STEP_LOG_LINE@python.inline@    frame_start = True@@@",
472      "@@@STEP_LOG_LINE@python.inline@    current_frame_duration = trace['dur']@@@",
473      "@@@STEP_LOG_LINE@python.inline@  elif 'skottie::Animation::render' in trace['name']:@@@",
474      "@@@STEP_LOG_LINE@python.inline@    if not frame_start:@@@",
475      "@@@STEP_LOG_LINE@python.inline@      raise Exception('We got an Animation::render without a seek first. ' +@@@",
476      "@@@STEP_LOG_LINE@python.inline@                      'Something is wrong.')@@@",
477      "@@@STEP_LOG_LINE@python.inline@@@@",
478      "@@@STEP_LOG_LINE@python.inline@    current_frame_duration += trace['dur']@@@",
479      "@@@STEP_LOG_LINE@python.inline@    frame_start = False@@@",
480      "@@@STEP_LOG_LINE@python.inline@    total_frames += 1@@@",
481      "@@@STEP_LOG_LINE@python.inline@    frame_max = max(frame_max, current_frame_duration)@@@",
482      "@@@STEP_LOG_LINE@python.inline@    frame_min = (min(frame_min, current_frame_duration)@@@",
483      "@@@STEP_LOG_LINE@python.inline@                 if frame_min else current_frame_duration)@@@",
484      "@@@STEP_LOG_LINE@python.inline@    frame_cumulative += current_frame_duration@@@",
485      "@@@STEP_LOG_LINE@python.inline@@@@",
486      "@@@STEP_LOG_LINE@python.inline@expected_dm_frames = 25@@@",
487      "@@@STEP_LOG_LINE@python.inline@if total_frames != expected_dm_frames:@@@",
488      "@@@STEP_LOG_LINE@python.inline@  raise Exception(@@@",
489      "@@@STEP_LOG_LINE@python.inline@      'Got ' + str(total_frames) + ' frames instead of ' +@@@",
490      "@@@STEP_LOG_LINE@python.inline@      str(expected_dm_frames))@@@",
491      "@@@STEP_LOG_LINE@python.inline@perf_results['frame_max_us'] = frame_max@@@",
492      "@@@STEP_LOG_LINE@python.inline@perf_results['frame_min_us'] = frame_min@@@",
493      "@@@STEP_LOG_LINE@python.inline@perf_results['frame_avg_us'] = frame_cumulative/total_frames@@@",
494      "@@@STEP_LOG_LINE@python.inline@@@@",
495      "@@@STEP_LOG_LINE@python.inline@# Write perf_results to the output json.@@@",
496      "@@@STEP_LOG_LINE@python.inline@with open(output_json_file, 'w') as f:@@@",
497      "@@@STEP_LOG_LINE@python.inline@  f.write(json.dumps(perf_results))@@@",
498      "@@@STEP_LOG_END@python.inline@@@"
499    ]
500  },
501  {
502    "cmd": [
503      "python",
504      "-u",
505      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
506      "--json-output",
507      "/path/to/tmp/json",
508      "remove",
509      "[START_DIR]/[SWARM_OUT_DIR]/4.json"
510    ],
511    "infra_step": true,
512    "name": "remove [START_DIR]/[SWARM_OUT_DIR]/4.json"
513  },
514  {
515    "cmd": [
516      "python",
517      "-u",
518      "import os\nprint os.environ.get('SWARMING_BOT_ID', '')\n"
519    ],
520    "name": "get swarming bot id",
521    "~followup_annotations": [
522      "@@@STEP_LOG_LINE@python.inline@import os@@@",
523      "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_BOT_ID', '')@@@",
524      "@@@STEP_LOG_END@python.inline@@@"
525    ]
526  },
527  {
528    "cmd": [
529      "python",
530      "-u",
531      "import os\nprint os.environ.get('SWARMING_TASK_ID', '')\n"
532    ],
533    "name": "get swarming task id",
534    "~followup_annotations": [
535      "@@@STEP_LOG_LINE@python.inline@import os@@@",
536      "@@@STEP_LOG_LINE@python.inline@print os.environ.get('SWARMING_TASK_ID', '')@@@",
537      "@@@STEP_LOG_END@python.inline@@@"
538    ]
539  },
540  {
541    "cmd": [
542      "python",
543      "-u",
544      "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
545      "--json-output",
546      "/path/to/tmp/json",
547      "ensure-directory",
548      "--mode",
549      "0777",
550      "[START_DIR]/[SWARM_OUT_DIR]"
551    ],
552    "infra_step": true,
553    "name": "makedirs perf_dir"
554  },
555  {
556    "cmd": [
557      "python",
558      "-u",
559      "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': 'IntelIris640', 'arch': 'x86_64', 'source_type': 'skottie', 'cpu_or_gpu': 'GPU', 'model': 'NUC7i5BNK', 'configuration': 'Release', 'os': 'Debian9', 'compiler': 'Clang'}, 'swarming_bot_id': ''}, fp=outfile, indent=4)\n"
560    ],
561    "env": {
562      "CHROME_HEADLESS": "1",
563      "PATH": "<PATH>:RECIPE_REPO[depot_tools]"
564    },
565    "name": "write output JSON",
566    "~followup_annotations": [
567      "@@@STEP_LOG_LINE@python.inline@import json@@@",
568      "@@@STEP_LOG_LINE@python.inline@with open('[START_DIR]/[SWARM_OUT_DIR]/perf_abc123_1337000001.json', 'w') as outfile:@@@",
569      "@@@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': 'IntelIris640', 'arch': 'x86_64', 'source_type': 'skottie', 'cpu_or_gpu': 'GPU', 'model': 'NUC7i5BNK', 'configuration': 'Release', 'os': 'Debian9', 'compiler': 'Clang'}, 'swarming_bot_id': ''}, fp=outfile, indent=4)@@@",
570      "@@@STEP_LOG_END@python.inline@@@"
571    ]
572  },
573  {
574    "name": "$result"
575  }
576]