summaryrefslogtreecommitdiff
path: root/tools/intel_error_decode.c
diff options
context:
space:
mode:
authorChris Wilson <chris@chris-wilson.co.uk>2011-01-09 13:26:50 +0000
committerChris Wilson <chris@chris-wilson.co.uk>2011-01-09 13:27:22 +0000
commit98eb5a5e240fbdf8067c2bee48afe749feeca12f (patch)
tree876e13cabe06052007b9b56183318566e7593e19 /tools/intel_error_decode.c
parentd9ec63b1a0c41c96af676cd9d642bf622be1788f (diff)
error: Parse ring name before gtt_offset
Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
Diffstat (limited to 'tools/intel_error_decode.c')
-rw-r--r--tools/intel_error_decode.c50
1 files changed, 29 insertions, 21 deletions
diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c
index d6e8ba68..a11c918c 100644
--- a/tools/intel_error_decode.c
+++ b/tools/intel_error_decode.c
@@ -223,30 +223,38 @@ read_data_file (FILE *file)
int is_batch = 1;
while (getline (&line, &line_size, file) > 0) {
+ char *dashes;
line_number++;
- matched = sscanf (line, "--- gtt_offset = 0x%08x\n", &new_gtt_offset);
- if (matched == 1) {
- if (count) {
- printf("%s at 0x%08x:\n", buffer_type[is_batch], gtt_offset);
- intel_decode (data, count, gtt_offset, devid, 0);
- count = 0;
- }
- gtt_offset = new_gtt_offset;
- is_batch = 1;
- continue;
- }
+ dashes = strstr(line, "---");
+ if (dashes) {
+ matched = sscanf (dashes, "--- gtt_offset = 0x%08x\n",
+ &new_gtt_offset);
+ if (matched == 1) {
+ if (count) {
+ printf("%s at 0x%08x:\n",
+ buffer_type[is_batch], gtt_offset);
+ intel_decode (data, count, gtt_offset, devid, 0);
+ count = 0;
+ }
+ gtt_offset = new_gtt_offset;
+ is_batch = 1;
+ continue;
+ }
- matched = sscanf (line, "--- ringbuffer = 0x%08x\n", &new_gtt_offset);
- if (matched == 1) {
- if (count) {
- printf("%s at 0x%08x:\n", buffer_type[is_batch], gtt_offset);
- intel_decode (data, count, gtt_offset, devid, 0);
- count = 0;
- }
- gtt_offset = new_gtt_offset;
- is_batch = 0;
- continue;
+ matched = sscanf (dashes, "--- ringbuffer = 0x%08x\n",
+ &new_gtt_offset);
+ if (matched == 1) {
+ if (count) {
+ printf("%s at 0x%08x:\n",
+ buffer_type[is_batch], gtt_offset);
+ intel_decode (data, count, gtt_offset, devid, 0);
+ count = 0;
+ }
+ gtt_offset = new_gtt_offset;
+ is_batch = 0;
+ continue;
+ }
}
matched = sscanf (line, "%08x : %08x", &offset, &value);