Mesa (main): freedreno/crashdec: Basing GMU log decoding

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Wed Dec 1 18:20:52 UTC 2021


Module: Mesa
Branch: main
Commit: 145b0711fcb494eacdb8917b02d0b9e884621852
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=145b0711fcb494eacdb8917b02d0b9e884621852

Author: Rob Clark <robdclark at chromium.org>
Date:   Sun Nov 28 08:58:45 2021 -0800

freedreno/crashdec: Basing GMU log decoding

Looks like each entry is four dwords, with the second dword being a
timestamp.

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

---

 src/freedreno/decode/crashdec.c | 31 +++++++++++++++++++++++++++++++
 1 file changed, 31 insertions(+)

diff --git a/src/freedreno/decode/crashdec.c b/src/freedreno/decode/crashdec.c
index 1ebf74de987..1da27c63be3 100644
--- a/src/freedreno/decode/crashdec.c
+++ b/src/freedreno/decode/crashdec.c
@@ -248,6 +248,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:")) {



More information about the mesa-commit mailing list