From: Rob Clark Date: Wed, 1 Apr 2020 17:40:35 +0000 (-0700) Subject: freedreno/a6xx: add some compute logging X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=f8fc690d1c2720d36893daf9beb95ec60e64a34a;p=mesa.git freedreno/a6xx: add some compute logging Signed-off-by: Rob Clark Part-of: --- 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 = []