freedreno/a6xx: add some compute logging

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/4423>
This commit is contained in:
Rob Clark 2020-04-01 10:40:35 -07:00 committed by Marge Bot
parent 629c0cee0a
commit f8fc690d1c
2 changed files with 21 additions and 2 deletions

View 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

View File

@ -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 = []