Skip to contentSkip to conversation

drm/amdgpu: Print vmid, pasid and more task info in devcoredump

PATCH Applied Timur Kristóf 3 participants 5 messages Jul 11 – Jul 13

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/2 drm/amdgpu: Print vmid, pasid and more task info in devcoredump

These are in the dmesg logs but are missing from devcoredumps.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 7 ++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c +6 -1
index 4fd0df3aa70d..aaf091b7f9d0 100644
@@ -356,10 +356,14 @@ amdgpu_devcoredump_format(char *buffer, size_t count, struct amdgpu_coredump_inf
 	drm_printf(&p, "kernel: %s\n", init_utsname()->release);
 	drm_printf(&p, "module: " KBUILD_MODNAME "\n");
 	drm_printf(&p, "time: %ptSp\n", &coredump->reset_time);
+	drm_printf(&p, "pasid: %u\n", coredump->pasid);
+	drm_printf(&p, "vmid: %u\n", coredump->vmid);
 
 	if (coredump->reset_task_info.task.pid)
-		drm_printf(&p, "process_name: %s PID: %d\n",
+		drm_printf(&p, "process_name: %s TGID: %d thread: %s PID: %d\n",
 			   coredump->reset_task_info.process_name,
+			   coredump->reset_task_info.tgid,
+			   coredump->reset_task_info.task.comm,
 			   coredump->reset_task_info.task.pid);
 
 	/* SOC Information */
@@ -563,6 +567,7 @@ void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check,
 			amdgpu_vm_put_task_info(ti);
 		}
 		coredump->pasid = job->pasid;
+		coredump->vmid = job->vmid;
 		coredump->num_ibs = job->num_ibs;
 		for (i = 0; i < job->num_ibs; ++i) {
 			coredump->ibs[i].gpu_addr = job->ibs[i].gpu_addr;
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h +1 -0
index 2371e20fc68b..63f27337c09a 100644
@@ -63,6 +63,7 @@ struct amdgpu_coredump_info {
 	char				*formatted;
 
 	unsigned int			pasid;
+	unsigned int			vmid;
 	int				num_ibs;
 	struct amdgpu_coredump_ib_info	ibs[] __counted_by(num_ibs);
 };
Signature · 1 line
2.55.0
#1 lore raw

PATCH 2/2 drm/amdgpu: Reserve space for IB contents in devcoredumps

Currently the contents of IBs are abruptly cut off and don't show the full contents. This patch makes sure to reserve space for those contents too so they may be printed.

---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c +3 -0
index aaf091b7f9d0..39b2a4c0e011 100644
@@ -235,6 +235,9 @@ amdgpu_devcoredump_print_ibs(struct drm_printer *p,
 			drm_printf(p, "\nIB #%d 0x%llx %d dw\n", i,
 				   coredump->ibs[i].gpu_addr,
 				   coredump->ibs[i].ib_size_dw);
+
+			for (int j = 0; j < coredump->ibs[i].ib_size_dw; j++)
+				drm_printf(p, "0xffffffff\n");
 		}
 		return;
 	}
Signature · 1 line
2.55.0
maintainer Acked-by on v1 2/2
#2 lore raw

Re: [PATCH 2/2] drm/amdgpu: Reserve space for IB contents in devcoredumps

Quoted 5 lines · Timur Kristóf

Currently the contents of IBs are abruptly cut off and don't show the full contents. This patch makes sure to reserve space for those contents too so they may be printed.

Quoted 18 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 3 +++
 1 file changed, 3 insertions(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c +3 -0
index aaf091b7f9d0..39b2a4c0e011 100644
@@ -235,6 +235,9 @@ amdgpu_devcoredump_print_ibs(struct drm_printer *p,
 			drm_printf(p, "\nIB #%d 0x%llx %d dw\n", i,
 				   coredump->ibs[i].gpu_addr,
 				   coredump->ibs[i].ib_size_dw);
+
+			for (int j = 0; j < coredump->ibs[i].ib_size_dw; j++)
+				drm_printf(p, "0xffffffff\n");
 		}
 		return;
 	}
maintainer Reviewed-by on v1 1/2
#3 lore raw
In reply to Timur Kristóf
Quoted 3 lines · Timur Kristóf

These are in the dmesg logs but are missing from devcoredumps.

Quoted 45 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 7 ++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c +6 -1
index 4fd0df3aa70d..aaf091b7f9d0 100644
@@ -356,10 +356,14 @@ amdgpu_devcoredump_format(char *buffer, size_t count, struct amdgpu_coredump_inf
 	drm_printf(&p, "kernel: %s\n", init_utsname()->release);
 	drm_printf(&p, "module: " KBUILD_MODNAME "\n");
 	drm_printf(&p, "time: %ptSp\n", &coredump->reset_time);
+	drm_printf(&p, "pasid: %u\n", coredump->pasid);
+	drm_printf(&p, "vmid: %u\n", coredump->vmid);
 
 	if (coredump->reset_task_info.task.pid)
-		drm_printf(&p, "process_name: %s PID: %d\n",
+		drm_printf(&p, "process_name: %s TGID: %d thread: %s PID: %d\n",
 			   coredump->reset_task_info.process_name,
+			   coredump->reset_task_info.tgid,
+			   coredump->reset_task_info.task.comm,
 			   coredump->reset_task_info.task.pid);
 
 	/* SOC Information */
@@ -563,6 +567,7 @@ void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check,
 			amdgpu_vm_put_task_info(ti);
 		}
 		coredump->pasid = job->pasid;
+		coredump->vmid = job->vmid;
 		coredump->num_ibs = job->num_ibs;
 		for (i = 0; i < job->num_ibs; ++i) {
 			coredump->ibs[i].gpu_addr = job->ibs[i].gpu_addr;
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h +1 -0
index 2371e20fc68b..63f27337c09a 100644
@@ -63,6 +63,7 @@ struct amdgpu_coredump_info {
 	char				*formatted;
 
 	unsigned int			pasid;
+	unsigned int			vmid;
 	int				num_ibs;
 	struct amdgpu_coredump_ib_info	ibs[] __counted_by(num_ibs);
 };
Applied
#4 lore raw

Applied the series. Thanks!

Quoted 54 lines · Christian König
Quoted 3 lines · Timur Kristóf

These are in the dmesg logs but are missing from devcoredumps.

Quoted 45 lines
---
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c | 7 ++++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h | 1 +
 2 files changed, 7 insertions(+), 1 deletion(-)
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.c +6 -1
index 4fd0df3aa70d..aaf091b7f9d0 100644
@@ -356,10 +356,14 @@ amdgpu_devcoredump_format(char *buffer, size_t count, struct amdgpu_coredump_inf
      drm_printf(&p, "kernel: %s\n", init_utsname()->release);
      drm_printf(&p, "module: " KBUILD_MODNAME "\n");
      drm_printf(&p, "time: %ptSp\n", &coredump->reset_time);
+     drm_printf(&p, "pasid: %u\n", coredump->pasid);
+     drm_printf(&p, "vmid: %u\n", coredump->vmid);
 
      if (coredump->reset_task_info.task.pid)
-             drm_printf(&p, "process_name: %s PID: %d\n",
+             drm_printf(&p, "process_name: %s TGID: %d thread: %s PID: %d\n",
                         coredump->reset_task_info.process_name,
+                        coredump->reset_task_info.tgid,
+                        coredump->reset_task_info.task.comm,
                         coredump->reset_task_info.task.pid);
 
      /* SOC Information */
@@ -563,6 +567,7 @@ void amdgpu_coredump(struct amdgpu_device *adev, bool skip_vram_check,
                      amdgpu_vm_put_task_info(ti);
              }
              coredump->pasid = job->pasid;
+             coredump->vmid = job->vmid;
              coredump->num_ibs = job->num_ibs;
              for (i = 0; i < job->num_ibs; ++i) {
                      coredump->ibs[i].gpu_addr = job->ibs[i].gpu_addr;
drivers/gpu/drm/amd/amdgpu/amdgpu_dev_coredump.h +1 -0
index 2371e20fc68b..63f27337c09a 100644
@@ -63,6 +63,7 @@ struct amdgpu_coredump_info {
      char                            *formatted;
 
      unsigned int                    pasid;
+     unsigned int                    vmid;
      int                             num_ibs;
      struct amdgpu_coredump_ib_info  ibs[] __counted_by(num_ibs);
 };