Mesa (master): radv: print some information when RADV_TRACE_FILE is set

Samuel Pitoiset hakzsam at kemper.freedesktop.org
Thu Mar 15 16:22:37 UTC 2018


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

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Wed Mar 14 12:02:13 2018 +0100

radv: print some information when RADV_TRACE_FILE is set

Just to be sure all options are enabled when trying to generate
a hang report.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

---

 src/amd/vulkan/radv_debug.c  | 2 +-
 src/amd/vulkan/radv_debug.h  | 3 +++
 src/amd/vulkan/radv_device.c | 5 +++++
 3 files changed, 9 insertions(+), 1 deletion(-)

diff --git a/src/amd/vulkan/radv_debug.c b/src/amd/vulkan/radv_debug.c
index f3b79004f6..ce582312c5 100644
--- a/src/amd/vulkan/radv_debug.c
+++ b/src/amd/vulkan/radv_debug.c
@@ -593,7 +593,7 @@ radv_dump_dmesg(FILE *f)
 	pclose(p);
 }
 
-static void
+void
 radv_dump_enabled_options(struct radv_device *device, FILE *f)
 {
 	uint64_t mask;
diff --git a/src/amd/vulkan/radv_debug.h b/src/amd/vulkan/radv_debug.h
index 804f620690..08877676b5 100644
--- a/src/amd/vulkan/radv_debug.h
+++ b/src/amd/vulkan/radv_debug.h
@@ -61,4 +61,7 @@ radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_winsys_cs *cs);
 void
 radv_print_spirv(uint32_t *data, uint32_t size, FILE *fp);
 
+void
+radv_dump_enabled_options(struct radv_device *device, FILE *f);
+
 #endif
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 13b2da584e..36ba0c3833 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -1322,10 +1322,15 @@ VkResult radv_CreateDevice(
 		device->physical_device->rad_info.max_se >= 2;
 
 	if (getenv("RADV_TRACE_FILE")) {
+		const char *filename = getenv("RADV_TRACE_FILE");
+
 		keep_shader_info = true;
 
 		if (!radv_init_trace(device))
 			goto fail;
+
+		fprintf(stderr, "Trace file will be dumped to %s\n", filename);
+		radv_dump_enabled_options(device, stderr);
 	}
 
 	device->keep_shader_info = keep_shader_info;




More information about the mesa-commit mailing list