freedreno/crashdec: Basing GMU log decoding
authorRob Clark <robdclark@chromium.org>
Sun, 28 Nov 2021 16:58:45 +0000 (08:58 -0800)
committerMarge Bot <emma+marge@anholt.net>
Wed, 1 Dec 2021 17:53:21 +0000 (17:53 +0000)
Looks like each entry is four dwords, with the second dword being a
timestamp.

Signed-off-by: Rob Clark <robdclark@chromium.org>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13937>

src/freedreno/decode/crashdec.c

index 1ebf74d..1da27c6 100644 (file)
@@ -249,6 +249,35 @@ decode_ringbuffer(void)
 }
 
 /*
+ * Decode GMU log
+ */
+
+static void
+decode_gmu_log(void)
+{
+   uint64_t iova;
+   uint32_t size;
+
+   foreach_line_in_section (line) {
+      if (startswith(line, "    iova:")) {
+         parseline(line, "    iova: %" PRIx64, &iova);
+      } else if (startswith(line, "    size:")) {
+         parseline(line, "    size: %u", &size);
+      } else if (startswith(line, "    data: !!ascii85 |")) {
+         void *buf = popline_ascii85(size / 4);
+
+         dump_hex_ascii(buf, size, 1);
+
+         free(buf);
+
+         continue;
+      }
+
+      printf("%s", line);
+   }
+}
+
+/*
  * Decode HFI queues
  */
 
@@ -746,6 +775,8 @@ decode(void)
          decode_bos();
       } else if (startswith(line, "ringbuffer:")) {
          decode_ringbuffer();
+      } else if (startswith(line, "gmu-log:")) {
+         decode_gmu_log();
       } else if (startswith(line, "gmu-hfi:")) {
          decode_gmu_hfi();
       } else if (startswith(line, "registers:")) {