]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
drm/amdgpu: Create version number for coredumps
authorAndré Almeida <andrealmeid@igalia.com>
Fri, 15 Sep 2023 16:44:53 +0000 (18:44 +0200)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 20 Oct 2023 19:11:29 +0000 (15:11 -0400)
Even if there's nothing currently parsing amdgpu's coredump files, if
we eventually have such tools they will be glad to find a version field
to properly read the file.

Create a version number to be displayed on top of coredump file, to be
incremented when the file format or content get changed.

Signed-off-by: André Almeida <andrealmeid@igalia.com>
Reviewed-by: Shashank Sharma <shashank.sharma@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.c
drivers/gpu/drm/amd/amdgpu/amdgpu_reset.h

index f53ddca35be60aea7ed09663afeed9b8f40f9937..4baa300121d8ffbf78f5e0d45b25fdd1ab43afd6 100644 (file)
@@ -185,6 +185,7 @@ amdgpu_devcoredump_read(char *buffer, loff_t offset, size_t count,
        p = drm_coredump_printer(&iter);
 
        drm_printf(&p, "**** AMDGPU Device Coredump ****\n");
+       drm_printf(&p, "version: " AMDGPU_COREDUMP_VERSION "\n");
        drm_printf(&p, "kernel: " UTS_RELEASE "\n");
        drm_printf(&p, "module: " KBUILD_MODNAME "\n");
        drm_printf(&p, "time: %lld.%09ld\n", coredump->reset_time.tv_sec,
index f4cfa2c7c9d6aab31be958bf1c0d1b670aab40e6..b0335a1c5e90cb8f000fe1989bfb20dfbbd53c58 100644 (file)
@@ -90,6 +90,9 @@ struct amdgpu_reset_domain {
 };
 
 #ifdef CONFIG_DEV_COREDUMP
+
+#define AMDGPU_COREDUMP_VERSION "1"
+
 struct amdgpu_coredump_info {
        struct amdgpu_device            *adev;
        struct amdgpu_task_info         reset_task_info;