Mesa (master): freedreno/a6xx: add some compute logging

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Sat Apr 4 00:24:57 UTC 2020


Module: Mesa
Branch: master
Commit: f8fc690d1c2720d36893daf9beb95ec60e64a34a
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=f8fc690d1c2720d36893daf9beb95ec60e64a34a

Author: Rob Clark <robdclark at chromium.org>
Date:   Wed Apr  1 10:40:35 2020 -0700

freedreno/a6xx: add some compute logging

Signed-off-by: Rob Clark <robdclark at chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423>

---

 src/gallium/drivers/freedreno/a6xx/fd6_compute.c |  8 ++++++++
 src/gallium/drivers/freedreno/log-parser.py      | 15 +++++++++++++--
 2 files changed, 21 insertions(+), 2 deletions(-)

diff --git a/src/gallium/drivers/freedreno/a6xx/fd6_compute.c b/src/gallium/drivers/freedreno/a6xx/fd6_compute.c
index 9987d9eb099..e6d5b325648 100644
--- a/src/gallium/drivers/freedreno/a6xx/fd6_compute.c
+++ b/src/gallium/drivers/freedreno/a6xx/fd6_compute.c
@@ -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
diff --git a/src/gallium/drivers/freedreno/log-parser.py b/src/gallium/drivers/freedreno/log-parser.py
index 87bcc439870..8d409e15742 100755
--- a/src/gallium/drivers/freedreno/log-parser.py
+++ b/src/gallium/drivers/freedreno/log-parser.py
@@ -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 = []



More information about the mesa-commit mailing list