From c4a4f3db5a4c8676798855e131c360cdf0e4a6bc Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Wed, 14 Aug 2019 09:19:54 -0700 Subject: [PATCH] pan/midgard: Prefix blobber-db output for grepping Signed-off-by: Alyssa Rosenzweig --- src/panfrost/midgard/disassemble.c | 6 +++--- src/panfrost/midgard/disassemble.h | 2 +- src/panfrost/midgard/midgard_compile.c | 2 +- src/panfrost/pandecode/decode.c | 10 +++++++++- 4 files changed, 14 insertions(+), 6 deletions(-) diff --git a/src/panfrost/midgard/disassemble.c b/src/panfrost/midgard/disassemble.c index 382b4af7cbf..1092fcf7374 100644 --- a/src/panfrost/midgard/disassemble.c +++ b/src/panfrost/midgard/disassemble.c @@ -1308,7 +1308,7 @@ print_texture_word(uint32_t *word, unsigned tabs) } void -disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned nr_registers) +disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned nr_registers, const char *prefix) { uint32_t *words = (uint32_t *) code; unsigned num_words = size / 4; @@ -1400,10 +1400,10 @@ disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned nr_register (nr_registers <= 8) ? 2 : 1; - printf("%s shader: " + printf("%s" "%u inst, %u bundles, %u quadwords, " "%u registers, %u threads, 0 loops\n", - "FRAGMENT", /* TODO */ + prefix, nr_ins, nr_bundles, nr_quadwords, nr_registers, nr_threads); diff --git a/src/panfrost/midgard/disassemble.h b/src/panfrost/midgard/disassemble.h index 7ccee2649c6..ca578b7d3aa 100644 --- a/src/panfrost/midgard/disassemble.h +++ b/src/panfrost/midgard/disassemble.h @@ -1,2 +1,2 @@ #include -void disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned regs); +void disassemble_midgard(uint8_t *code, size_t size, bool stats, unsigned regs, const char *prefix); diff --git a/src/panfrost/midgard/midgard_compile.c b/src/panfrost/midgard/midgard_compile.c index e348ac05234..91e257db187 100644 --- a/src/panfrost/midgard/midgard_compile.c +++ b/src/panfrost/midgard/midgard_compile.c @@ -2741,7 +2741,7 @@ midgard_compile_shader_nir(struct midgard_screen *screen, nir_shader *nir, midga program->tls_size = ctx->tls_size; if (midgard_debug & MIDGARD_DBG_SHADERS) - disassemble_midgard(program->compiled.data, program->compiled.size, false, 0); + disassemble_midgard(program->compiled.data, program->compiled.size, false, 0, ""); if (midgard_debug & MIDGARD_DBG_SHADERDB) { unsigned nr_bundles = 0, nr_ins = 0, nr_quadwords = 0; diff --git a/src/panfrost/pandecode/decode.c b/src/panfrost/pandecode/decode.c index b49044cec2b..771383ce866 100644 --- a/src/panfrost/pandecode/decode.c +++ b/src/panfrost/pandecode/decode.c @@ -1428,6 +1428,8 @@ pandecode_scratchpad(uintptr_t pscratchpad, int job_no, char *suffix) pandecode_log("};\n"); } +static unsigned shader_id = 0; + static void pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type, bool is_bifrost, unsigned nr_regs) @@ -1443,10 +1445,16 @@ pandecode_shader_disassemble(mali_ptr shader_ptr, int shader_no, int type, printf("\n\n"); + char prefix[512]; + + snprintf(prefix, sizeof(prefix) - 1, "shader%d - %s shader: ", + shader_id++, + (type == JOB_TYPE_TILER) ? "FRAGMENT" : "VERTEX"); + if (is_bifrost) { disassemble_bifrost(code, sz, false); } else { - disassemble_midgard(code, sz, true, nr_regs); + disassemble_midgard(code, sz, true, nr_regs, prefix); } printf("\n\n"); -- 2.30.2