[PATCH 4/6] drm/msm/adreno: Convert the show/crash file format

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Convert the format of the 'show' and 'crash' debugfs files to
mostly standard YAML. This should be easier to parse and be
more flexible for future changes and expansions.

Signed-off-by: Jordan Crouse <jcrouse@xxxxxxxxxxxxxx>
---
 drivers/gpu/drm/msm/adreno/adreno_gpu.c | 23 ++++++++++++++---------
 drivers/gpu/drm/msm/msm_debugfs.c       |  8 +++++---
 2 files changed, 19 insertions(+), 12 deletions(-)

diff --git a/drivers/gpu/drm/msm/adreno/adreno_gpu.c b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
index 963fce3..9e83c70 100644
--- a/drivers/gpu/drm/msm/adreno/adreno_gpu.c
+++ b/drivers/gpu/drm/msm/adreno/adreno_gpu.c
@@ -438,23 +438,28 @@ void adreno_show(struct msm_gpu *gpu, struct msm_gpu_state *state,
 	if (IS_ERR_OR_NULL(state))
 		return;
 
-	seq_printf(m, "status:   %08x\n", state->rbbm_status);
 	seq_printf(m, "revision: %d (%d.%d.%d.%d)\n",
 			adreno_gpu->info->revn, adreno_gpu->rev.core,
 			adreno_gpu->rev.major, adreno_gpu->rev.minor,
 			adreno_gpu->rev.patchid);
 
-	for (i = 0; i < gpu->nr_rings; i++) {
-		seq_printf(m, "rb %d: fence:    %d/%d\n", i,
-			state->ring[i].fence, state->ring[i].seqno);
+	seq_printf(m, "rbbm-status: 0x%08x\n", state->rbbm_status);
+
+	seq_printf(m, "ringbuffer:\n");
 
-		seq_printf(m, "      rptr:     %d\n", state->ring[i].rptr);
-		seq_printf(m, "rb wptr:  %d\n", state->ring[i].wptr);
+	for (i = 0; i < gpu->nr_rings; i++) {
+		seq_printf(m, "  - id: %d\n", i);
+		seq_printf(m, "    last-fence: %d\n", state->ring[i].seqno);
+		seq_printf(m, "    retired-fence: %d\n", state->ring[i].fence);
+		seq_printf(m, "    rptr: %d\n", state->ring[i].rptr);
+		seq_printf(m, "    wptr: %d\n", state->ring[i].wptr);
 	}
 
-	seq_printf(m, "IO:region %s 00000000 00020000\n", gpu->name);
-	for (i = 0; i < state->nr_registers; i++) {
-		seq_printf(m, "IO:R %08x %08x\n",
+	seq_printf(m, "registers:\n");
+	seq_printf(m, "  - [offset, value]\n");
+
+	for(i = 0; i < state->nr_registers; i++) {
+		seq_printf(m, "  - [0x%04x, 0x%08x]\n",
 			state->registers[i * 2] << 2,
 			state->registers[(i * 2) + 1]);
 	}
diff --git a/drivers/gpu/drm/msm/msm_debugfs.c b/drivers/gpu/drm/msm/msm_debugfs.c
index 50e049c..e6d41d9 100644
--- a/drivers/gpu/drm/msm/msm_debugfs.c
+++ b/drivers/gpu/drm/msm/msm_debugfs.c
@@ -33,9 +33,11 @@ static int msm_gpu_crash_show(struct seq_file *m, void *data)
 	if (!state)
 		return 0;
 
-	seq_printf(m, "%s Crash Status:\n", gpu->name);
-	seq_puts(m, "Kernel: " UTS_RELEASE "\n");
-	seq_printf(m, "Time: %ld s %ld us\n",
+	/* FIXME: add tags? */
+	seq_puts(m, "---\n");
+	seq_puts(m, "kernel: " UTS_RELEASE "\n");
+	seq_printf(m, "module: " KBUILD_MODNAME "\n");
+	seq_printf(m, "time: %ld.%ld\n",
 		state->time.tv_sec, state->time.tv_usec);
 	if (state->comm)
 		seq_printf(m, "comm: %s\n", state->comm);
-- 
1.9.1

_______________________________________________
dri-devel mailing list
dri-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/dri-devel




[Index of Archives]     [Linux DRI Users]     [Linux Intel Graphics]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [XFree86]
  Powered by Linux