diff options
-rw-r--r-- | tools/intel_error_decode.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c index 8cbbe846..004b6c81 100644 --- a/tools/intel_error_decode.c +++ b/tools/intel_error_decode.c @@ -554,7 +554,7 @@ read_data_file(FILE *file) int head_idx = 0; int num_rings = 0; long long unsigned fence; - int data_size = 0, count = 0, line_number = 0, matched; + int data_size = 0, count = 0, matched; char *line = NULL; size_t line_size; uint32_t offset, value, ring_length = 0; @@ -565,7 +565,19 @@ read_data_file(FILE *file) while (getline(&line, &line_size, file) > 0) { char *dashes; - line_number++; + + if (line[0] == ':' || line[0] == '~') { + count = ascii85_decode(line+1, &data, line[0] == ':'); + if (count == 0) { + fprintf(stderr, "ASCII85 decode failed.\n"); + exit(1); + } + decode(decode_ctx, + buffer_name, ring_name, + gtt_offset, head_offset, + data, &count); + continue; + } dashes = strstr(line, "---"); if (dashes) { @@ -641,19 +653,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(1); - } - decode(decode_ctx, - buffer_name, ring_name, - gtt_offset, head_offset, - data, &count); - continue; - } - matched = sscanf(line, "%08x : %08x", &offset, &value); if (matched != 2) { unsigned int reg, reg2; |