gitlab-ci: get the last frame from a gfxr trace using gfxrecon-info

Signed-off-by: Andres Gomez <agomez@igalia.com>
Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5890>
This commit is contained in:
Andres Gomez 2020-07-14 01:11:26 +03:00 committed by Marge Bot
parent d15e1226cc
commit f1e67aa08a
1 changed files with 6 additions and 10 deletions

View File

@ -58,17 +58,13 @@ def get_last_apitrace_frame_call(cmd_wrapper, trace_path):
return -1
def get_last_gfxreconstruct_frame_call(trace_path):
# FIXME: It would be great to have another way to get the amount of
# traces which wouldn't imply replaying the whole trace:
# https://github.com/LunarG/gfxreconstruct/issues/329
cmd = ["gfxrecon-replay", str(trace_path)]
cmd = ["gfxrecon-info", str(trace_path)]
ret = subprocess.run(cmd, stdout=subprocess.PIPE)
for l in reversed(ret.stdout.decode(errors='replace').splitlines()):
s = l.split(", ", 2)
if len(s) >= 3:
c = s[2].split(None, 1)
if len(c) >= 1 and c[0].isnumeric():
return int(c[0])
lines = ret.stdout.decode(errors='replace').splitlines()
if len(lines) >= 1:
c = lines[0].split(": ", 1)
if len(c) >= 2 and c[1].isnumeric():
return int(c[1])
return -1
def dump_with_apitrace(retrace_cmd, trace_path, calls, device_name):