Skip to content

Commit bcf1d9f

Browse files
Jordan Crouserobclark
authored andcommitted
drm/msm/adreno: Convert the show/crash file format
Convert the format of the 'show' debugfs file and the crash dump to a format resembling YAML. This should be easier to parse and be more flexible for future changes and expansions. v2: Use a standard .rst for the msm crashdump documentation Signed-off-by: Jordan Crouse <jcrouse@codeaurora.org> Signed-off-by: Rob Clark <robdclark@gmail.com>
1 parent c0fec7f commit bcf1d9f

2 files changed

Lines changed: 84 additions & 8 deletions

File tree

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
=====================
2+
MSM Crash Dump Format
3+
=====================
4+
5+
Following a GPU hang the MSM driver outputs debugging information via
6+
/sys/kernel/dri/X/show or via devcoredump (/sys/class/devcoredump/dcdX/data).
7+
This document describes how the output is formatted.
8+
9+
Each entry is in the form key: value. Sections headers will not have a value
10+
and all the contents of a section will be indented two spaces from the header.
11+
Each section might have multiple array entries the start of which is designated
12+
by a (-).
13+
14+
Mappings
15+
--------
16+
17+
kernel
18+
The kernel version that generated the dump (UTS_RELEASE).
19+
20+
module
21+
The module that generated the crashdump.
22+
23+
time
24+
The kernel time at crash formated as seconds.microseconds.
25+
26+
comm
27+
Comm string for the binary that generated the fault.
28+
29+
cmdline
30+
Command line for the binary that generated the fault.
31+
32+
revision
33+
ID of the GPU that generated the crash formatted as
34+
core.major.minor.patchlevel separated by dots.
35+
36+
rbbm-status
37+
The current value of RBBM_STATUS which shows what top level GPU
38+
components are in use at the time of crash.
39+
40+
ringbuffer
41+
Section containing the contents of each ringbuffer. Each ringbuffer is
42+
identified with an id number.
43+
44+
id
45+
Ringbuffer ID (0 based index). Each ringbuffer in the section
46+
will have its own unique id.
47+
iova
48+
GPU address of the ringbuffer.
49+
50+
last-fence
51+
The last fence that was issued on the ringbuffer
52+
53+
retired-fence
54+
The last fence retired on the ringbuffer.
55+
56+
rptr
57+
The current read pointer (rptr) for the ringbuffer.
58+
59+
wptr
60+
The current write pointer (wptr) for the ringbuffer.
61+
62+
registers
63+
Set of registers values. Each entry is on its own line enclosed
64+
by brackets { }.
65+
66+
offset
67+
Byte offset of the register from the start of the
68+
GPU memory region.
69+
70+
value
71+
Hexadecimal value of the register.

‎drivers/gpu/drm/msm/adreno/adreno_gpu.c‎

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -445,23 +445,28 @@ void adreno_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
445445
if (IS_ERR_OR_NULL(state))
446446
return;
447447

448-
drm_printf(p, "status: %08x\n", state->rbbm_status);
449448
drm_printf(p, "revision: %d (%d.%d.%d.%d)\n",
450449
adreno_gpu->info->revn, adreno_gpu->rev.core,
451450
adreno_gpu->rev.major, adreno_gpu->rev.minor,
452451
adreno_gpu->rev.patchid);
453452

454-
for (i = 0; i < gpu->nr_rings; i++) {
455-
drm_printf(p, "rb %d: fence: %d/%d\n", i,
456-
state->ring[i].fence, state->ring[i].seqno);
453+
drm_printf(p, "rbbm-status: 0x%08x\n", state->rbbm_status);
454+
455+
drm_puts(p, "ringbuffer:\n");
457456

458-
drm_printf(p, " rptr: %d\n", state->ring[i].rptr);
459-
drm_printf(p, "rb wptr: %d\n", state->ring[i].wptr);
457+
for (i = 0; i < gpu->nr_rings; i++) {
458+
drm_printf(p, " - id: %d\n", i);
459+
drm_printf(p, " iova: 0x%016llx\n", state->ring[i].iova);
460+
drm_printf(p, " last-fence: %d\n", state->ring[i].seqno);
461+
drm_printf(p, " retired-fence: %d\n", state->ring[i].fence);
462+
drm_printf(p, " rptr: %d\n", state->ring[i].rptr);
463+
drm_printf(p, " wptr: %d\n", state->ring[i].wptr);
460464
}
461465

462-
drm_printf(p, "IO:region %s 00000000 00020000\n", gpu->name);
466+
drm_puts(p, "registers:\n");
467+
463468
for (i = 0; i < state->nr_registers; i++) {
464-
drm_printf(p, "IO:R %08x %08x\n",
469+
drm_printf(p, " - { offset: 0x%04x, value: 0x%08x }\n",
465470
state->registers[i * 2] << 2,
466471
state->registers[(i * 2) + 1]);
467472
}

0 commit comments

Comments
 (0)