[Mesa-dev] [PATCH 2/2] intel/tools: Fix program disassembly in aubinator_error_decode.

Kenneth Graunke kenneth at whitecape.org
Sat Nov 11 00:55:42 UTC 2017


This indexing is bogus.  idx_program is the offset of the next program.
At this point, we've walked through the entire batch, and accumulated
all the programs.  So adding it again simply skips over 100% of the
programs.
---
 src/intel/tools/aubinator_error_decode.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/intel/tools/aubinator_error_decode.c b/src/intel/tools/aubinator_error_decode.c
index 2322bac8391..00e1a872bd0 100644
--- a/src/intel/tools/aubinator_error_decode.c
+++ b/src/intel/tools/aubinator_error_decode.c
@@ -601,15 +601,14 @@ read_data_file(FILE *file)
             printf("Disassembly of programs in instruction buffer at "
                    "0x%08"PRIx64":\n", gtt_offset);
             for (int i = 0; i < num_programs; i++) {
-               int idx = (idx_program + i) % MAX_NUM_PROGRAMS;
-               if (programs[idx].instruction_base_address == gtt_offset) {
+               if (programs[i].instruction_base_address == gtt_offset) {
                     printf("\n%s (specified by %s at batch offset "
                            "0x%08"PRIx64") at offset 0x%08"PRIx64"\n",
-                           programs[idx].type,
-                           programs[idx].command,
-                           programs[idx].command_offset,
-                           programs[idx].ksp);
-                    gen_disasm_disassemble(disasm, data, programs[idx].ksp,
+                           programs[i].type,
+                           programs[i].command,
+                           programs[i].command_offset,
+                           programs[i].ksp);
+                    gen_disasm_disassemble(disasm, data, programs[i].ksp,
                                            stdout);
                }
             }
-- 
2.15.0



More information about the mesa-dev mailing list