Module: Mesa
Branch: master
Commit: a0495d4bb3a3f9e61652c7cab339547edbbef8ba
URL:    
http://cgit.freedesktop.org/mesa/mesa/commit/?id=a0495d4bb3a3f9e61652c7cab339547edbbef8ba

Author: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Date:   Thu Sep 14 11:25:24 2017 +0200

radv: dump the device name into the hang report

Similar to RadeonSI renderer string.

Signed-off-by: Samuel Pitoiset <samuel.pitoi...@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <b...@basnieuwenhuizen.nl>

---

 src/amd/vulkan/radv_debug.c | 30 ++++++++++++++++++++++++++++++
 1 file changed, 30 insertions(+)

diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c
index 662e29694f..f6f4dad65c 100644
--- a/src/amd/vulkan/radv_debug.c
+++ b/src/amd/vulkan/radv_debug.c
@@ -27,6 +27,7 @@
 
 #include <stdlib.h>
 #include <stdio.h>
+#include <sys/utsname.h>
 
 #include "sid.h"
 #include "gfx9d.h"
@@ -605,6 +606,32 @@ radv_dump_enabled_options(struct radv_device *device, FILE 
*f)
        fprintf(f, "\n");
 }
 
+static void
+radv_dump_device_name(struct radv_device *device, FILE *f)
+{
+       struct radeon_info *info = &device->physical_device->rad_info;
+       char llvm_string[32] = {}, kernel_version[128] = {};
+       struct utsname uname_data;
+       const char *chip_name;
+
+       chip_name = device->ws->get_chip_name(device->ws);
+
+       if (uname(&uname_data) == 0)
+               snprintf(kernel_version, sizeof(kernel_version),
+                        " / %s", uname_data.release);
+
+       if (HAVE_LLVM > 0) {
+               snprintf(llvm_string, sizeof(llvm_string),
+                        ", LLVM %i.%i.%i", (HAVE_LLVM >> 8) & 0xff,
+                        HAVE_LLVM & 0xff, MESA_LLVM_VERSION_PATCH);
+       }
+
+       fprintf(f, "Device name: %s (%s DRM %i.%i.%i%s%s)\n\n",
+               chip_name, device->physical_device->name,
+               info->drm_major, info->drm_minor, info->drm_patchlevel,
+               kernel_version, llvm_string);
+}
+
 static bool
 radv_gpu_hang_occured(struct radv_queue *queue, enum ring_type ring)
 {
@@ -637,6 +664,9 @@ radv_check_gpu_hangs(struct radv_queue *queue, struct 
radeon_winsys_cs *cs)
        graphics_pipeline = radv_get_saved_graphics_pipeline(device);
        compute_pipeline = radv_get_saved_compute_pipeline(device);
 
+       fprintf(stderr, "GPU hang report:\n\n");
+       radv_dump_device_name(device, stderr);
+
        radv_dump_enabled_options(device, stderr);
        radv_dump_dmesg(stderr);
 

_______________________________________________
mesa-commit mailing list
mesa-commit@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/mesa-commit

Reply via email to