gitlab-ci: get the last frame from a gfxr trace using gfxrecon-info
authorAndres Gomez <agomez@igalia.com>
Mon, 13 Jul 2020 22:11:26 +0000 (01:11 +0300)
committerMarge Bot <eric+marge@anholt.net>
Tue, 21 Jul 2020 16:41:22 +0000 (16:41 +0000)
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>

.gitlab-ci/tracie/dump_trace_images.py

index 74efb1f32c7618b2afb57f013a100ba4c3553381..e5cf6489a5c2c99af9cc0d7680d558e4dbcec193 100644 (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):