summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_debug.c
diff options
context:
space:
mode:
authorSamuel Pitoiset <[email protected]>2017-09-11 22:02:54 +0200
committerSamuel Pitoiset <[email protected]>2017-09-14 10:37:57 +0200
commit302e34d24bdac1abf5b14aadf7a3857f033e01b2 (patch)
treec21b52c74f92b706bafe3cd7490525931158bd76 /src/amd/vulkan/radv_debug.c
parent26bc664ca0031fb6ed6d6afcb76d8f0c967e50fb (diff)
radv: dump last 60 lines of dmesg when a hang occured
Copied from dd_dump_dmesg(). Signed-off-by: Samuel Pitoiset <[email protected]> Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_debug.c')
-rw-r--r--src/amd/vulkan/radv_debug.c20
1 files changed, 20 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c
index c93ebf1c77a..ec43366de7d 100644
--- a/src/amd/vulkan/radv_debug.c
+++ b/src/amd/vulkan/radv_debug.c
@@ -563,6 +563,24 @@ radv_get_saved_compute_pipeline(struct radv_device *device)
return (struct radv_pipeline *)ptr[2];
}
+static void
+radv_dump_dmesg(FILE *f)
+{
+ char line[2000];
+ FILE *p;
+
+ p = popen("dmesg | tail -n60", "r");
+ if (!p)
+ return;
+
+ fprintf(f, "\nLast 60 lines of dmesg:\n\n");
+ while (fgets(line, sizeof(line), p))
+ fputs(line, f);
+ fprintf(f, "\n");
+
+ pclose(p);
+}
+
static bool
radv_gpu_hang_occured(struct radv_queue *queue, enum ring_type ring)
{
@@ -595,6 +613,8 @@ 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);
+ radv_dump_dmesg(stderr);
+
if (vm_fault_occurred) {
fprintf(stderr, "VM fault report.\n\n");
fprintf(stderr, "Failing VM page: 0x%08"PRIx64"\n\n", addr);