freedreno/a6xx: add some compute logging
authorRob Clark <robdclark@chromium.org>
Wed, 1 Apr 2020 17:40:35 +0000 (10:40 -0700)
committerMarge Bot <eric+marge@anholt.net>
Sat, 4 Apr 2020 00:07:10 +0000 (00:07 +0000)
Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423>

src/gallium/drivers/freedreno/a6xx/fd6_compute.c
src/gallium/drivers/freedreno/log-parser.py

index 9987d9eb09959661e71faf4d55cd0b8950441647..e6d5b32564893e9a0f300b9936d477952f59493a 100644 (file)
@@ -25,7 +25,9 @@
  */
 
 #include "pipe/p_state.h"
+#include "util/u_dump.h"
 
+#include "freedreno_log.h"
 #include "freedreno_resource.h"
 
 #include "fd6_compute.h"
@@ -181,6 +183,9 @@ fd6_launch_grid(struct fd_context *ctx, const struct pipe_grid_info *info)
        OUT_RING(ring, 1);            /* HLSQ_CS_KERNEL_GROUP_Y */
        OUT_RING(ring, 1);            /* HLSQ_CS_KERNEL_GROUP_Z */
 
+       fd_log(ctx->batch, "COMPUTE: START");
+       fd_log_stream(ctx->batch, stream, util_dump_grid_info(stream, info));
+
        if (info->indirect) {
                struct fd_resource *rsc = fd_resource(info->indirect);
 
@@ -198,9 +203,12 @@ fd6_launch_grid(struct fd_context *ctx, const struct pipe_grid_info *info)
                OUT_RING(ring, CP_EXEC_CS_3_NGROUPS_Z(info->grid[2]));
        }
 
+       fd_log(ctx->batch, "COMPUTE: END");
        OUT_WFI5(ring);
+       fd_log(ctx->batch, "..");
 
        fd6_cache_flush(ctx->batch, ring);
+       fd_log(ctx->batch, "..");
 }
 
 void
index 87bcc439870d53485230063b8418408ee354d1fe..8d409e157420f5e6aa31767d45091f63b25a4a0d 100755 (executable)
@@ -7,6 +7,7 @@ def main():
     file = open(sys.argv[1], "r")
     lines = file.read().split('\n')
 
+    compute_match = re.compile(r"COMPUTE: START")
     gmem_match = re.compile(r": rendering (\S+)x(\S+) tiles")
     sysmem_match = re.compile(r": rendering sysmem (\S+)x(\S+)")
     blit_match = re.compile(r": END BLIT")
@@ -17,9 +18,18 @@ def main():
     times_blit = []
     times_sysmem = []
     times_gmem = []
+    times_compute = []
     times = None
 
     for line in lines:
+        match = re.search(compute_match, line)
+        if match is not None:
+            #printf("GRID/COMPUTE")
+            if times  is not None:
+                print("expected times to not be set yet")
+            times = times_compute
+            continue
+
         match = re.search(gmem_match, line)
         if match is not None:
             #print("GMEM")
@@ -47,11 +57,12 @@ def main():
         match = re.search(eof_match, line)
         if match is not None:
             frame_nr = int(match.group(1))
-            print("FRAME[{}]: {} blits ({:,} ns), {} SYSMEM ({:,} ns), {} GMEM ({:,} ns)".format(
+            print("FRAME[{}]: {} blits ({:,} ns), {} SYSMEM ({:,} ns), {} GMEM ({:,} ns), {} COMPUTE ({:,} ns)".format(
                     frame_nr,
                     len(times_blit), sum(times_blit),
                     len(times_sysmem), sum(times_sysmem),
-                    len(times_gmem), sum(times_gmem)
+                    len(times_gmem), sum(times_gmem),
+                    len(times_compute), sum(times_compute)
                 ))
             times_blit = []
             times_sysmem = []