diff options
author | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-10-22 17:39:05 +0200 |
---|---|---|
committer | Nicolai Hähnle <nicolai.haehnle@amd.com> | 2017-11-06 11:09:50 +0100 |
commit | c9d0d5425f9045d1bb5e2918e936bcf63c1d3074 (patch) | |
tree | 4c954c74eb718d5711c0f1652fe99f6a9f67c856 | |
parent | 3638eff0dbf360b266f830aa896a4b7a1b37e05e (diff) |
radeonsi: record and dump time of flush
Reviewed-by: Marek Olšák <marek.olsak@amd.com>
-rw-r--r-- | src/gallium/drivers/radeonsi/si_debug.c | 5 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_hw_context.c | 3 | ||||
-rw-r--r-- | src/gallium/drivers/radeonsi/si_pipe.h | 1 |
3 files changed, 8 insertions, 1 deletions
diff --git a/src/gallium/drivers/radeonsi/si_debug.c b/src/gallium/drivers/radeonsi/si_debug.c index 88fa11acda..447b4ef8e9 100644 --- a/src/gallium/drivers/radeonsi/si_debug.c +++ b/src/gallium/drivers/radeonsi/si_debug.c @@ -27,6 +27,7 @@ #include "gfx9d.h" #include "sid_tables.h" #include "ddebug/dd_util.h" +#include "util/u_dump.h" #include "util/u_log.h" #include "util/u_memory.h" #include "ac_debug.h" @@ -373,7 +374,9 @@ static void si_log_chunk_type_cs_print(void *data, FILE *f) } if (chunk->dump_bo_list) { - fprintf(f, "Flushing.\n\n"); + fprintf(f, "Flushing. Time: "); + util_dump_ns(f, scs->time_flush); + fprintf(f, "\n\n"); si_dump_bo_list(ctx, &scs->gfx, f); } } diff --git a/src/gallium/drivers/radeonsi/si_hw_context.c b/src/gallium/drivers/radeonsi/si_hw_context.c index 0d54b12df9..15234d7272 100644 --- a/src/gallium/drivers/radeonsi/si_hw_context.c +++ b/src/gallium/drivers/radeonsi/si_hw_context.c @@ -24,6 +24,8 @@ #include "si_pipe.h" #include "radeon/r600_cs.h" +#include "util/os_time.h" + void si_destroy_saved_cs(struct si_saved_cs *scs) { si_clear_saved_cs(&scs->gfx); @@ -120,6 +122,7 @@ void si_context_gfx_flush(void *context, unsigned flags, /* Save the IB for debug contexts. */ si_save_cs(ws, cs, &ctx->current_saved_cs->gfx, true); ctx->current_saved_cs->flushed = true; + ctx->current_saved_cs->time_flush = os_time_get_nano(); } /* Flush the CS. */ diff --git a/src/gallium/drivers/radeonsi/si_pipe.h b/src/gallium/drivers/radeonsi/si_pipe.h index fc6197ab88..21f7e33ae0 100644 --- a/src/gallium/drivers/radeonsi/si_pipe.h +++ b/src/gallium/drivers/radeonsi/si_pipe.h @@ -344,6 +344,7 @@ struct si_saved_cs { unsigned gfx_last_dw; bool flushed; + int64_t time_flush; }; struct si_context { |