error: Parse ring name before gtt_offset

Signed-off-by: Chris Wilson <chris@chris-wilson.co.uk>
This commit is contained in:
Chris Wilson 2011-01-09 13:26:50 +00:00
parent d9ec63b1a0
commit 98eb5a5e24

View File

@ -223,30 +223,38 @@ read_data_file (FILE *file)
int is_batch = 1; int is_batch = 1;
while (getline (&line, &line_size, file) > 0) { while (getline (&line, &line_size, file) > 0) {
char *dashes;
line_number++; line_number++;
matched = sscanf (line, "--- gtt_offset = 0x%08x\n", &new_gtt_offset); dashes = strstr(line, "---");
if (matched == 1) { if (dashes) {
if (count) { matched = sscanf (dashes, "--- gtt_offset = 0x%08x\n",
printf("%s at 0x%08x:\n", buffer_type[is_batch], gtt_offset); &new_gtt_offset);
intel_decode (data, count, gtt_offset, devid, 0); if (matched == 1) {
count = 0; if (count) {
} printf("%s at 0x%08x:\n",
gtt_offset = new_gtt_offset; buffer_type[is_batch], gtt_offset);
is_batch = 1; intel_decode (data, count, gtt_offset, devid, 0);
continue; count = 0;
} }
gtt_offset = new_gtt_offset;
is_batch = 1;
continue;
}
matched = sscanf (line, "--- ringbuffer = 0x%08x\n", &new_gtt_offset); matched = sscanf (dashes, "--- ringbuffer = 0x%08x\n",
if (matched == 1) { &new_gtt_offset);
if (count) { if (matched == 1) {
printf("%s at 0x%08x:\n", buffer_type[is_batch], gtt_offset); if (count) {
intel_decode (data, count, gtt_offset, devid, 0); printf("%s at 0x%08x:\n",
count = 0; buffer_type[is_batch], gtt_offset);
} intel_decode (data, count, gtt_offset, devid, 0);
gtt_offset = new_gtt_offset; count = 0;
is_batch = 0; }
continue; gtt_offset = new_gtt_offset;
is_batch = 0;
continue;
}
} }
matched = sscanf (line, "%08x : %08x", &offset, &value); matched = sscanf (line, "%08x : %08x", &offset, &value);