Update rive-cpp to 2.0 version
[platform/core/uifw/rive-tizen.git] / submodule / skia / infra / bots / recipes / perf_skottietrace.expected / Perf-Debian10-Clang-NUC7i5BNK-GPU-IntelIris640-x86_64-Release-All-SkottieTracing.json
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       "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     "env": {
124       "CHROME_HEADLESS": "1",
125       "LD_LIBRARY_PATH": "[START_DIR]/mesa_intel_driver_linux",
126       "LIBGL_DRIVERS_PATH": "[START_DIR]/mesa_intel_driver_linux",
127       "PATH": "<PATH>:RECIPE_REPO[depot_tools]",
128       "VK_ICD_FILENAMES": "[START_DIR]/mesa_intel_driver_linux/intel_icd.x86_64.json"
129     },
130     "name": "dm"
131   },
132   {
133     "cmd": [
134       "vpython",
135       "-u",
136       "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
137       "--json-output",
138       "/path/to/tmp/json",
139       "copy",
140       "[START_DIR]/[SWARM_OUT_DIR]/2.json",
141       "/path/to/tmp/"
142     ],
143     "infra_step": true,
144     "name": "read [START_DIR]/[SWARM_OUT_DIR]/2.json",
145     "~followup_annotations": [
146       "@@@STEP_LOG_END@2.json@@@"
147     ]
148   },
149   {
150     "cmd": [
151       "python",
152       "-u",
153       "\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",
154       "\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",
155       "lottie 3!.json",
156       "/path/to/tmp/json"
157     ],
158     "env": {
159       "CHROME_HEADLESS": "1",
160       "PATH": "<PATH>:RECIPE_REPO[depot_tools]"
161     },
162     "name": "parse lottie 3!.json trace",
163     "~followup_annotations": [
164       "@@@STEP_LOG_LINE@json.output@{@@@",
165       "@@@STEP_LOG_LINE@json.output@  \"frame_avg_us\": 179.71, @@@",
166       "@@@STEP_LOG_LINE@json.output@  \"frame_max_us\": 218.25, @@@",
167       "@@@STEP_LOG_LINE@json.output@  \"frame_min_us\": 141.17@@@",
168       "@@@STEP_LOG_LINE@json.output@}@@@",
169       "@@@STEP_LOG_END@json.output@@@",
170       "@@@STEP_LOG_LINE@python.inline@@@@",
171       "@@@STEP_LOG_LINE@python.inline@import json@@@",
172       "@@@STEP_LOG_LINE@python.inline@import sys@@@",
173       "@@@STEP_LOG_LINE@python.inline@@@@",
174       "@@@STEP_LOG_LINE@python.inline@trace_output = sys.argv[1]@@@",
175       "@@@STEP_LOG_LINE@python.inline@trace_json = json.loads(trace_output)@@@",
176       "@@@STEP_LOG_LINE@python.inline@lottie_filename = sys.argv[2]@@@",
177       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[3]@@@",
178       "@@@STEP_LOG_LINE@python.inline@@@@",
179       "@@@STEP_LOG_LINE@python.inline@perf_results = {}@@@",
180       "@@@STEP_LOG_LINE@python.inline@frame_max = 0@@@",
181       "@@@STEP_LOG_LINE@python.inline@frame_min = 0@@@",
182       "@@@STEP_LOG_LINE@python.inline@frame_cumulative = 0@@@",
183       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
184       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
185       "@@@STEP_LOG_LINE@python.inline@frame_start = False@@@",
186       "@@@STEP_LOG_LINE@python.inline@for trace in trace_json:@@@",
187       "@@@STEP_LOG_LINE@python.inline@  if 'skottie::Animation::seek' in trace['name']:@@@",
188       "@@@STEP_LOG_LINE@python.inline@    if frame_start:@@@",
189       "@@@STEP_LOG_LINE@python.inline@      raise Exception('We got consecutive Animation::seek without a ' +@@@",
190       "@@@STEP_LOG_LINE@python.inline@                      'render. Something is wrong.')@@@",
191       "@@@STEP_LOG_LINE@python.inline@    frame_start = True@@@",
192       "@@@STEP_LOG_LINE@python.inline@    current_frame_duration = trace['dur']@@@",
193       "@@@STEP_LOG_LINE@python.inline@  elif 'skottie::Animation::render' in trace['name']:@@@",
194       "@@@STEP_LOG_LINE@python.inline@    if not frame_start:@@@",
195       "@@@STEP_LOG_LINE@python.inline@      raise Exception('We got an Animation::render without a seek first. ' +@@@",
196       "@@@STEP_LOG_LINE@python.inline@                      'Something is wrong.')@@@",
197       "@@@STEP_LOG_LINE@python.inline@@@@",
198       "@@@STEP_LOG_LINE@python.inline@    current_frame_duration += trace['dur']@@@",
199       "@@@STEP_LOG_LINE@python.inline@    frame_start = False@@@",
200       "@@@STEP_LOG_LINE@python.inline@    total_frames += 1@@@",
201       "@@@STEP_LOG_LINE@python.inline@    frame_max = max(frame_max, current_frame_duration)@@@",
202       "@@@STEP_LOG_LINE@python.inline@    frame_min = (min(frame_min, current_frame_duration)@@@",
203       "@@@STEP_LOG_LINE@python.inline@                 if frame_min else current_frame_duration)@@@",
204       "@@@STEP_LOG_LINE@python.inline@    frame_cumulative += current_frame_duration@@@",
205       "@@@STEP_LOG_LINE@python.inline@@@@",
206       "@@@STEP_LOG_LINE@python.inline@expected_dm_frames = 25@@@",
207       "@@@STEP_LOG_LINE@python.inline@if total_frames != expected_dm_frames:@@@",
208       "@@@STEP_LOG_LINE@python.inline@  raise Exception(@@@",
209       "@@@STEP_LOG_LINE@python.inline@      'Got ' + str(total_frames) + ' frames instead of ' +@@@",
210       "@@@STEP_LOG_LINE@python.inline@      str(expected_dm_frames))@@@",
211       "@@@STEP_LOG_LINE@python.inline@perf_results['frame_max_us'] = frame_max@@@",
212       "@@@STEP_LOG_LINE@python.inline@perf_results['frame_min_us'] = frame_min@@@",
213       "@@@STEP_LOG_LINE@python.inline@perf_results['frame_avg_us'] = frame_cumulative/total_frames@@@",
214       "@@@STEP_LOG_LINE@python.inline@@@@",
215       "@@@STEP_LOG_LINE@python.inline@# Write perf_results to the output json.@@@",
216       "@@@STEP_LOG_LINE@python.inline@with open(output_json_file, 'w') as f:@@@",
217       "@@@STEP_LOG_LINE@python.inline@  f.write(json.dumps(perf_results))@@@",
218       "@@@STEP_LOG_END@python.inline@@@"
219     ]
220   },
221   {
222     "cmd": [
223       "vpython",
224       "-u",
225       "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
226       "--json-output",
227       "/path/to/tmp/json",
228       "remove",
229       "[START_DIR]/[SWARM_OUT_DIR]/2.json"
230     ],
231     "infra_step": true,
232     "name": "remove [START_DIR]/[SWARM_OUT_DIR]/2.json"
233   },
234   {
235     "cmd": [
236       "catchsegv",
237       "[START_DIR]/build/dm",
238       "--resourcePath",
239       "[START_DIR]/skia/resources",
240       "--lotties",
241       "[START_DIR]/lottie-samples",
242       "--src",
243       "lottie",
244       "--nonativeFonts",
245       "--verbose",
246       "--traceMatch",
247       "skottie",
248       "--trace",
249       "[START_DIR]/[SWARM_OUT_DIR]/3.json",
250       "--match",
251       "^lottie(test)'!2.json$",
252       "--config",
253       "gles",
254       "--nocpu"
255     ],
256     "env": {
257       "CHROME_HEADLESS": "1",
258       "LD_LIBRARY_PATH": "[START_DIR]/mesa_intel_driver_linux",
259       "LIBGL_DRIVERS_PATH": "[START_DIR]/mesa_intel_driver_linux",
260       "PATH": "<PATH>:RECIPE_REPO[depot_tools]",
261       "VK_ICD_FILENAMES": "[START_DIR]/mesa_intel_driver_linux/intel_icd.x86_64.json"
262     },
263     "name": "dm (2)"
264   },
265   {
266     "cmd": [
267       "vpython",
268       "-u",
269       "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
270       "--json-output",
271       "/path/to/tmp/json",
272       "copy",
273       "[START_DIR]/[SWARM_OUT_DIR]/3.json",
274       "/path/to/tmp/"
275     ],
276     "infra_step": true,
277     "name": "read [START_DIR]/[SWARM_OUT_DIR]/3.json",
278     "~followup_annotations": [
279       "@@@STEP_LOG_END@3.json@@@"
280     ]
281   },
282   {
283     "cmd": [
284       "python",
285       "-u",
286       "\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",
287       "\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",
288       "lottie(test)'!2.json",
289       "/path/to/tmp/json"
290     ],
291     "env": {
292       "CHROME_HEADLESS": "1",
293       "PATH": "<PATH>:RECIPE_REPO[depot_tools]"
294     },
295     "name": "parse lottie(test)'!2.json trace",
296     "~followup_annotations": [
297       "@@@STEP_LOG_LINE@json.output@{@@@",
298       "@@@STEP_LOG_LINE@json.output@  \"frame_avg_us\": 179.71, @@@",
299       "@@@STEP_LOG_LINE@json.output@  \"frame_max_us\": 218.25, @@@",
300       "@@@STEP_LOG_LINE@json.output@  \"frame_min_us\": 141.17@@@",
301       "@@@STEP_LOG_LINE@json.output@}@@@",
302       "@@@STEP_LOG_END@json.output@@@",
303       "@@@STEP_LOG_LINE@python.inline@@@@",
304       "@@@STEP_LOG_LINE@python.inline@import json@@@",
305       "@@@STEP_LOG_LINE@python.inline@import sys@@@",
306       "@@@STEP_LOG_LINE@python.inline@@@@",
307       "@@@STEP_LOG_LINE@python.inline@trace_output = sys.argv[1]@@@",
308       "@@@STEP_LOG_LINE@python.inline@trace_json = json.loads(trace_output)@@@",
309       "@@@STEP_LOG_LINE@python.inline@lottie_filename = sys.argv[2]@@@",
310       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[3]@@@",
311       "@@@STEP_LOG_LINE@python.inline@@@@",
312       "@@@STEP_LOG_LINE@python.inline@perf_results = {}@@@",
313       "@@@STEP_LOG_LINE@python.inline@frame_max = 0@@@",
314       "@@@STEP_LOG_LINE@python.inline@frame_min = 0@@@",
315       "@@@STEP_LOG_LINE@python.inline@frame_cumulative = 0@@@",
316       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
317       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
318       "@@@STEP_LOG_LINE@python.inline@frame_start = False@@@",
319       "@@@STEP_LOG_LINE@python.inline@for trace in trace_json:@@@",
320       "@@@STEP_LOG_LINE@python.inline@  if 'skottie::Animation::seek' in trace['name']:@@@",
321       "@@@STEP_LOG_LINE@python.inline@    if frame_start:@@@",
322       "@@@STEP_LOG_LINE@python.inline@      raise Exception('We got consecutive Animation::seek without a ' +@@@",
323       "@@@STEP_LOG_LINE@python.inline@                      'render. Something is wrong.')@@@",
324       "@@@STEP_LOG_LINE@python.inline@    frame_start = True@@@",
325       "@@@STEP_LOG_LINE@python.inline@    current_frame_duration = trace['dur']@@@",
326       "@@@STEP_LOG_LINE@python.inline@  elif 'skottie::Animation::render' in trace['name']:@@@",
327       "@@@STEP_LOG_LINE@python.inline@    if not frame_start:@@@",
328       "@@@STEP_LOG_LINE@python.inline@      raise Exception('We got an Animation::render without a seek first. ' +@@@",
329       "@@@STEP_LOG_LINE@python.inline@                      'Something is wrong.')@@@",
330       "@@@STEP_LOG_LINE@python.inline@@@@",
331       "@@@STEP_LOG_LINE@python.inline@    current_frame_duration += trace['dur']@@@",
332       "@@@STEP_LOG_LINE@python.inline@    frame_start = False@@@",
333       "@@@STEP_LOG_LINE@python.inline@    total_frames += 1@@@",
334       "@@@STEP_LOG_LINE@python.inline@    frame_max = max(frame_max, current_frame_duration)@@@",
335       "@@@STEP_LOG_LINE@python.inline@    frame_min = (min(frame_min, current_frame_duration)@@@",
336       "@@@STEP_LOG_LINE@python.inline@                 if frame_min else current_frame_duration)@@@",
337       "@@@STEP_LOG_LINE@python.inline@    frame_cumulative += current_frame_duration@@@",
338       "@@@STEP_LOG_LINE@python.inline@@@@",
339       "@@@STEP_LOG_LINE@python.inline@expected_dm_frames = 25@@@",
340       "@@@STEP_LOG_LINE@python.inline@if total_frames != expected_dm_frames:@@@",
341       "@@@STEP_LOG_LINE@python.inline@  raise Exception(@@@",
342       "@@@STEP_LOG_LINE@python.inline@      'Got ' + str(total_frames) + ' frames instead of ' +@@@",
343       "@@@STEP_LOG_LINE@python.inline@      str(expected_dm_frames))@@@",
344       "@@@STEP_LOG_LINE@python.inline@perf_results['frame_max_us'] = frame_max@@@",
345       "@@@STEP_LOG_LINE@python.inline@perf_results['frame_min_us'] = frame_min@@@",
346       "@@@STEP_LOG_LINE@python.inline@perf_results['frame_avg_us'] = frame_cumulative/total_frames@@@",
347       "@@@STEP_LOG_LINE@python.inline@@@@",
348       "@@@STEP_LOG_LINE@python.inline@# Write perf_results to the output json.@@@",
349       "@@@STEP_LOG_LINE@python.inline@with open(output_json_file, 'w') as f:@@@",
350       "@@@STEP_LOG_LINE@python.inline@  f.write(json.dumps(perf_results))@@@",
351       "@@@STEP_LOG_END@python.inline@@@"
352     ]
353   },
354   {
355     "cmd": [
356       "vpython",
357       "-u",
358       "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
359       "--json-output",
360       "/path/to/tmp/json",
361       "remove",
362       "[START_DIR]/[SWARM_OUT_DIR]/3.json"
363     ],
364     "infra_step": true,
365     "name": "remove [START_DIR]/[SWARM_OUT_DIR]/3.json"
366   },
367   {
368     "cmd": [
369       "catchsegv",
370       "[START_DIR]/build/dm",
371       "--resourcePath",
372       "[START_DIR]/skia/resources",
373       "--lotties",
374       "[START_DIR]/lottie-samples",
375       "--src",
376       "lottie",
377       "--nonativeFonts",
378       "--verbose",
379       "--traceMatch",
380       "skottie",
381       "--trace",
382       "[START_DIR]/[SWARM_OUT_DIR]/4.json",
383       "--match",
384       "^lottie1.json$",
385       "--config",
386       "gles",
387       "--nocpu"
388     ],
389     "env": {
390       "CHROME_HEADLESS": "1",
391       "LD_LIBRARY_PATH": "[START_DIR]/mesa_intel_driver_linux",
392       "LIBGL_DRIVERS_PATH": "[START_DIR]/mesa_intel_driver_linux",
393       "PATH": "<PATH>:RECIPE_REPO[depot_tools]",
394       "VK_ICD_FILENAMES": "[START_DIR]/mesa_intel_driver_linux/intel_icd.x86_64.json"
395     },
396     "name": "dm (3)"
397   },
398   {
399     "cmd": [
400       "vpython",
401       "-u",
402       "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
403       "--json-output",
404       "/path/to/tmp/json",
405       "copy",
406       "[START_DIR]/[SWARM_OUT_DIR]/4.json",
407       "/path/to/tmp/"
408     ],
409     "infra_step": true,
410     "name": "read [START_DIR]/[SWARM_OUT_DIR]/4.json",
411     "~followup_annotations": [
412       "@@@STEP_LOG_END@4.json@@@"
413     ]
414   },
415   {
416     "cmd": [
417       "python",
418       "-u",
419       "\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",
420       "\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",
421       "lottie1.json",
422       "/path/to/tmp/json"
423     ],
424     "env": {
425       "CHROME_HEADLESS": "1",
426       "PATH": "<PATH>:RECIPE_REPO[depot_tools]"
427     },
428     "name": "parse lottie1.json trace",
429     "~followup_annotations": [
430       "@@@STEP_LOG_LINE@json.output@{@@@",
431       "@@@STEP_LOG_LINE@json.output@  \"frame_avg_us\": 179.71, @@@",
432       "@@@STEP_LOG_LINE@json.output@  \"frame_max_us\": 218.25, @@@",
433       "@@@STEP_LOG_LINE@json.output@  \"frame_min_us\": 141.17@@@",
434       "@@@STEP_LOG_LINE@json.output@}@@@",
435       "@@@STEP_LOG_END@json.output@@@",
436       "@@@STEP_LOG_LINE@python.inline@@@@",
437       "@@@STEP_LOG_LINE@python.inline@import json@@@",
438       "@@@STEP_LOG_LINE@python.inline@import sys@@@",
439       "@@@STEP_LOG_LINE@python.inline@@@@",
440       "@@@STEP_LOG_LINE@python.inline@trace_output = sys.argv[1]@@@",
441       "@@@STEP_LOG_LINE@python.inline@trace_json = json.loads(trace_output)@@@",
442       "@@@STEP_LOG_LINE@python.inline@lottie_filename = sys.argv[2]@@@",
443       "@@@STEP_LOG_LINE@python.inline@output_json_file = sys.argv[3]@@@",
444       "@@@STEP_LOG_LINE@python.inline@@@@",
445       "@@@STEP_LOG_LINE@python.inline@perf_results = {}@@@",
446       "@@@STEP_LOG_LINE@python.inline@frame_max = 0@@@",
447       "@@@STEP_LOG_LINE@python.inline@frame_min = 0@@@",
448       "@@@STEP_LOG_LINE@python.inline@frame_cumulative = 0@@@",
449       "@@@STEP_LOG_LINE@python.inline@current_frame_duration = 0@@@",
450       "@@@STEP_LOG_LINE@python.inline@total_frames = 0@@@",
451       "@@@STEP_LOG_LINE@python.inline@frame_start = False@@@",
452       "@@@STEP_LOG_LINE@python.inline@for trace in trace_json:@@@",
453       "@@@STEP_LOG_LINE@python.inline@  if 'skottie::Animation::seek' in trace['name']:@@@",
454       "@@@STEP_LOG_LINE@python.inline@    if frame_start:@@@",
455       "@@@STEP_LOG_LINE@python.inline@      raise Exception('We got consecutive Animation::seek without a ' +@@@",
456       "@@@STEP_LOG_LINE@python.inline@                      'render. Something is wrong.')@@@",
457       "@@@STEP_LOG_LINE@python.inline@    frame_start = True@@@",
458       "@@@STEP_LOG_LINE@python.inline@    current_frame_duration = trace['dur']@@@",
459       "@@@STEP_LOG_LINE@python.inline@  elif 'skottie::Animation::render' in trace['name']:@@@",
460       "@@@STEP_LOG_LINE@python.inline@    if not frame_start:@@@",
461       "@@@STEP_LOG_LINE@python.inline@      raise Exception('We got an Animation::render without a seek first. ' +@@@",
462       "@@@STEP_LOG_LINE@python.inline@                      'Something is wrong.')@@@",
463       "@@@STEP_LOG_LINE@python.inline@@@@",
464       "@@@STEP_LOG_LINE@python.inline@    current_frame_duration += trace['dur']@@@",
465       "@@@STEP_LOG_LINE@python.inline@    frame_start = False@@@",
466       "@@@STEP_LOG_LINE@python.inline@    total_frames += 1@@@",
467       "@@@STEP_LOG_LINE@python.inline@    frame_max = max(frame_max, current_frame_duration)@@@",
468       "@@@STEP_LOG_LINE@python.inline@    frame_min = (min(frame_min, current_frame_duration)@@@",
469       "@@@STEP_LOG_LINE@python.inline@                 if frame_min else current_frame_duration)@@@",
470       "@@@STEP_LOG_LINE@python.inline@    frame_cumulative += current_frame_duration@@@",
471       "@@@STEP_LOG_LINE@python.inline@@@@",
472       "@@@STEP_LOG_LINE@python.inline@expected_dm_frames = 25@@@",
473       "@@@STEP_LOG_LINE@python.inline@if total_frames != expected_dm_frames:@@@",
474       "@@@STEP_LOG_LINE@python.inline@  raise Exception(@@@",
475       "@@@STEP_LOG_LINE@python.inline@      'Got ' + str(total_frames) + ' frames instead of ' +@@@",
476       "@@@STEP_LOG_LINE@python.inline@      str(expected_dm_frames))@@@",
477       "@@@STEP_LOG_LINE@python.inline@perf_results['frame_max_us'] = frame_max@@@",
478       "@@@STEP_LOG_LINE@python.inline@perf_results['frame_min_us'] = frame_min@@@",
479       "@@@STEP_LOG_LINE@python.inline@perf_results['frame_avg_us'] = frame_cumulative/total_frames@@@",
480       "@@@STEP_LOG_LINE@python.inline@@@@",
481       "@@@STEP_LOG_LINE@python.inline@# Write perf_results to the output json.@@@",
482       "@@@STEP_LOG_LINE@python.inline@with open(output_json_file, 'w') as f:@@@",
483       "@@@STEP_LOG_LINE@python.inline@  f.write(json.dumps(perf_results))@@@",
484       "@@@STEP_LOG_END@python.inline@@@"
485     ]
486   },
487   {
488     "cmd": [
489       "vpython",
490       "-u",
491       "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
492       "--json-output",
493       "/path/to/tmp/json",
494       "remove",
495       "[START_DIR]/[SWARM_OUT_DIR]/4.json"
496     ],
497     "infra_step": true,
498     "name": "remove [START_DIR]/[SWARM_OUT_DIR]/4.json"
499   },
500   {
501     "cmd": [
502       "python",
503       "-u",
504       "import os\nprint(os.environ.get('SWARMING_BOT_ID', ''))\n"
505     ],
506     "name": "get swarming bot id",
507     "~followup_annotations": [
508       "@@@STEP_LOG_LINE@python.inline@import os@@@",
509       "@@@STEP_LOG_LINE@python.inline@print(os.environ.get('SWARMING_BOT_ID', ''))@@@",
510       "@@@STEP_LOG_END@python.inline@@@"
511     ]
512   },
513   {
514     "cmd": [
515       "python",
516       "-u",
517       "import os\nprint(os.environ.get('SWARMING_TASK_ID', ''))\n"
518     ],
519     "name": "get swarming task id",
520     "~followup_annotations": [
521       "@@@STEP_LOG_LINE@python.inline@import os@@@",
522       "@@@STEP_LOG_LINE@python.inline@print(os.environ.get('SWARMING_TASK_ID', ''))@@@",
523       "@@@STEP_LOG_END@python.inline@@@"
524     ]
525   },
526   {
527     "cmd": [
528       "vpython",
529       "-u",
530       "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
531       "--json-output",
532       "/path/to/tmp/json",
533       "ensure-directory",
534       "--mode",
535       "0777",
536       "[START_DIR]/[SWARM_OUT_DIR]"
537     ],
538     "infra_step": true,
539     "name": "makedirs perf_dir"
540   },
541   {
542     "cmd": [
543       "vpython",
544       "-u",
545       "RECIPE_MODULE[recipe_engine::file]/resources/fileutil.py",
546       "--json-output",
547       "/path/to/tmp/json",
548       "copy",
549       "{\n    \"gitHash\": \"abc123\",\n    \"key\": {\n        \"arch\": \"x86_64\",\n        \"bench_type\": \"tracing\",\n        \"compiler\": \"Clang\",\n        \"configuration\": \"Release\",\n        \"cpu_or_gpu\": \"GPU\",\n        \"cpu_or_gpu_value\": \"IntelIris640\",\n        \"extra_config\": \"SkottieTracing\",\n        \"model\": \"NUC7i5BNK\",\n        \"os\": \"Debian10\",\n        \"source_type\": \"skottie\"\n    },\n    \"renderer\": \"skottie\",\n    \"results\": {\n        \"lottie 3!.json\": {\n            \"gles\": {\n                \"frame_avg_us\": 179.71,\n                \"frame_max_us\": 218.25,\n                \"frame_min_us\": 141.17\n            }\n        },\n        \"lottie(test)'!2.json\": {\n            \"gles\": {\n                \"frame_avg_us\": 179.71,\n                \"frame_max_us\": 218.25,\n                \"frame_min_us\": 141.17\n            }\n        },\n        \"lottie1.json\": {\n            \"gles\": {\n                \"frame_avg_us\": 179.71,\n                \"frame_max_us\": 218.25,\n                \"frame_min_us\": 141.17\n            }\n        }\n    },\n    \"swarming_bot_id\": \"\",\n    \"swarming_task_id\": \"\"\n}",
550       "[START_DIR]/[SWARM_OUT_DIR]/perf_abc123_1337000001.json"
551     ],
552     "infra_step": true,
553     "name": "write output JSON",
554     "~followup_annotations": [
555       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@{@@@",
556       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@    \"gitHash\": \"abc123\",@@@",
557       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@    \"key\": {@@@",
558       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"arch\": \"x86_64\",@@@",
559       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"bench_type\": \"tracing\",@@@",
560       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"compiler\": \"Clang\",@@@",
561       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"configuration\": \"Release\",@@@",
562       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"cpu_or_gpu\": \"GPU\",@@@",
563       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"cpu_or_gpu_value\": \"IntelIris640\",@@@",
564       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"extra_config\": \"SkottieTracing\",@@@",
565       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"model\": \"NUC7i5BNK\",@@@",
566       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"os\": \"Debian10\",@@@",
567       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"source_type\": \"skottie\"@@@",
568       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@    },@@@",
569       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@    \"renderer\": \"skottie\",@@@",
570       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@    \"results\": {@@@",
571       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"lottie 3!.json\": {@@@",
572       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@            \"gles\": {@@@",
573       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@                \"frame_avg_us\": 179.71,@@@",
574       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@                \"frame_max_us\": 218.25,@@@",
575       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@                \"frame_min_us\": 141.17@@@",
576       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@            }@@@",
577       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        },@@@",
578       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"lottie(test)'!2.json\": {@@@",
579       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@            \"gles\": {@@@",
580       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@                \"frame_avg_us\": 179.71,@@@",
581       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@                \"frame_max_us\": 218.25,@@@",
582       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@                \"frame_min_us\": 141.17@@@",
583       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@            }@@@",
584       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        },@@@",
585       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        \"lottie1.json\": {@@@",
586       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@            \"gles\": {@@@",
587       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@                \"frame_avg_us\": 179.71,@@@",
588       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@                \"frame_max_us\": 218.25,@@@",
589       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@                \"frame_min_us\": 141.17@@@",
590       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@            }@@@",
591       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@        }@@@",
592       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@    },@@@",
593       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@    \"swarming_bot_id\": \"\",@@@",
594       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@    \"swarming_task_id\": \"\"@@@",
595       "@@@STEP_LOG_LINE@perf_abc123_1337000001.json@}@@@",
596       "@@@STEP_LOG_END@perf_abc123_1337000001.json@@@"
597     ]
598   },
599   {
600     "name": "$result"
601   }
602 ]