[Mesa-dev] [PATCH 00/11] Make aubinator_error_decode support extra buffers

Chris Wilson chris at chris-wilson.co.uk
Sun Nov 12 09:03:33 UTC 2017


Quoting Kenneth Graunke (2017-11-12 08:35:01)
> The only downside - and it's a pretty major one - is that I eliminated
> support for error states generated on pre-4.10 kernels.  The code to
> handle that was already a giant mess, and I wasn't sure how to do this
> rework without making it even more of a disaster.  We really want 4.13+
> anyway, in order to capture shaders, and the separate statebuffer.

Exactly. Old kernel + user space is just an exercise in asking the user
to update before reporting a bug, because in all likelihood the bug was
fixed already.

Bonus patch you might like to squeeze in, if the idea of adding ascii
debug messages to the hanging batch sparks interest:

diff --git a/tools/intel_error_decode.c b/tools/intel_error_decode.c
index cdef3b1..26f0756 100644
--- a/tools/intel_error_decode.c
+++ b/tools/intel_error_decode.c
@@ -51,6 +51,7 @@
 #include <assert.h>
 #include <intel_bufmgr.h>
 #include <zlib.h>
+#include <ctype.h>
 
 #include "intel_chipset.h"
 #include "intel_io.h"
@@ -434,6 +435,16 @@ print_fault_data(unsigned devid, uint32_t data1, uint32_t data0)
 
 #define MAX_RINGS 10 /* I really hope this never... */
 
+static bool maybe_ascii(const void *data, int check)
+{
+       const char *c = data;
+       while (check--) {
+               if (!isprint(*c++))
+                       return false;
+       }
+       return true;
+}
+
 static void decode(struct drm_intel_decode *ctx,
                   const char *buffer_name,
                   const char *ring_name,
@@ -458,6 +469,26 @@ static void decode(struct drm_intel_decode *ctx,
                drm_intel_decode_set_batch_pointer(ctx, data, gtt_offset,
                                                   *count);
                drm_intel_decode(ctx);
+       } else if (maybe_ascii(data, 16)) {
+               for (int i = 0; i < *count; i++) {
+                       char *c = (char *)&data[i];
+                       if (!c[0])
+                               break;
+                       putchar(c[0]);
+
+                       if (!c[1])
+                               break;
+                       putchar(c[1]);
+
+                       if (!c[2])
+                               break;
+                       putchar(c[2]);
+
+                       if (!c[3])
+                               break;
+                       putchar(c[3]);
+               }
+               putchar('\n');
        } else {
                for (int i = 0; i + 4 <= *count; i += 4)
                        printf("[%04x] %08x %08x %08x %08x\n",

Not pretty! We'll probably want to start the user buffer with a magic
header to differentiate between debug messages, api capture, aub
capture, state buffer etc.
-Chris


More information about the mesa-dev mailing list