pan/midgard: Prefix blobber-db output for grepping
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 14 Aug 2019 16:19:54 +0000 (09:19 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Wed, 14 Aug 2019 17:31:09 +0000 (10:31 -0700)
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/midgard/disassemble.c
src/panfrost/midgard/disassemble.h
src/panfrost/midgard/midgard_compile.c
src/panfrost/pandecode/decode.c

index 382b4af7cbf2b3ebc2ab68a867ed90b831d2a8a6..1092fcf73747e610775749e4aea98622fc0c11e4 100644 (file)
@@ -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);
 
index 7ccee2649c6c25fc7b175ad5fe31fc1cb2a3ab47..ca578b7d3aa27070ef52725958cb1b8549587d1f 100644 (file)
@@ -1,2 +1,2 @@
 #include <stddef.h>
-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);
index e348ac052347d50050d248c00fabf4158bcef5af..91e257db1877a55977ea5f9606e5738ced5119c7 100644 (file)
@@ -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;
index b49044cec2b6af86b4fa035ff706a92721f532ce..771383ce86689a355d45b9ed0d9e6bde43c177fb 100644 (file)
@@ -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");