summaryrefslogtreecommitdiffstats
path: root/src/intel/tools
diff options
context:
space:
mode:
authorKenneth Graunke <[email protected]>2017-11-11 20:57:42 -0800
committerKenneth Graunke <[email protected]>2017-11-13 17:10:38 -0800
commit53586f88d7a3386d3122584b0af9fddc8abc6657 (patch)
tree30f817f854699ae1d44d37f338db7d4576b5407e /src/intel/tools
parent8f9d9ddcae2f6f996a394d193a98358fee538fe3 (diff)
intel/tools/error: Do ascii85 decode first.
The dashes "---" may occur within an ascii85 block, but only an ascii85 block starts with ':' or '~'. Ported from Chris Wilson's intel-gpu-tools commit: bceec7e1d8a160226b783c6344eae8cbf4ece144 Reviewed-by: Chris Wilson <[email protected]>
Diffstat (limited to 'src/intel/tools')
-rw-r--r--src/intel/tools/aubinator_error_decode.c60
1 files changed, 29 insertions, 31 deletions
diff --git a/src/intel/tools/aubinator_error_decode.c b/src/intel/tools/aubinator_error_decode.c
index 2322bac8391..72919c1c9e4 100644
--- a/src/intel/tools/aubinator_error_decode.c
+++ b/src/intel/tools/aubinator_error_decode.c
@@ -507,6 +507,35 @@ read_data_file(FILE *file)
ring_name = new_ring_name;
}
+ if (line[0] == ':' || line[0] == '~') {
+ count = ascii85_decode(line+1, &data, line[0] == ':');
+ if (count == 0) {
+ fprintf(stderr, "ASCII85 decode failed.\n");
+ exit(EXIT_FAILURE);
+ }
+
+ if (strcmp(buffer_name, "user") == 0) {
+ 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) {
+ 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,
+ stdout);
+ }
+ }
+ } else {
+ decode(spec, buffer_name, ring_name, gtt_offset, data, &count);
+ }
+ continue;
+ }
+
dashes = strstr(line, "---");
if (dashes) {
uint32_t lo, hi;
@@ -590,37 +619,6 @@ read_data_file(FILE *file)
}
}
- if (line[0] == ':' || line[0] == '~') {
- count = ascii85_decode(line+1, &data, line[0] == ':');
- if (count == 0) {
- fprintf(stderr, "ASCII85 decode failed.\n");
- exit(EXIT_FAILURE);
- }
-
- if (strcmp(buffer_name, "user") == 0) {
- 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) {
- 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,
- stdout);
- }
- }
- } else {
- decode(spec,
- buffer_name, ring_name,
- gtt_offset, data, &count);
- }
- continue;
- }
-
matched = sscanf(line, "%08x : %08x", &offset, &value);
if (matched != 2) {
uint32_t reg, reg2;