From 145b0711fcb494eacdb8917b02d0b9e884621852 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Sun, 28 Nov 2021 08:58:45 -0800 Subject: [PATCH] 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 Part-of: --- 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:")) {