radv: dump the list of enabled options when a hang occured

Useful to know which debug/perftest options were enabled when
a hang report is generated.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
This commit is contained in:
Samuel Pitoiset
2017-09-11 22:28:42 +02:00
parent 302e34d24b
commit 49c72d84c2
3 changed files with 46 additions and 0 deletions

View File

@@ -581,6 +581,30 @@ radv_dump_dmesg(FILE *f)
pclose(p); pclose(p);
} }
static void
radv_dump_enabled_options(struct radv_device *device, FILE *f)
{
uint64_t mask;
fprintf(f, "Enabled debug options: ");
mask = device->debug_flags;
while (mask) {
int i = u_bit_scan64(&mask);
fprintf(f, "%s, ", radv_get_debug_option_name(i));
}
fprintf(f, "\n");
fprintf(f, "Enabled perftest options: ");
mask = device->instance->perftest_flags;
while (mask) {
int i = u_bit_scan64(&mask);
fprintf(f, "%s, ", radv_get_perftest_option_name(i));
}
fprintf(f, "\n");
}
static bool static bool
radv_gpu_hang_occured(struct radv_queue *queue, enum ring_type ring) radv_gpu_hang_occured(struct radv_queue *queue, enum ring_type ring)
{ {
@@ -613,6 +637,7 @@ radv_check_gpu_hangs(struct radv_queue *queue, struct radeon_winsys_cs *cs)
graphics_pipeline = radv_get_saved_graphics_pipeline(device); graphics_pipeline = radv_get_saved_graphics_pipeline(device);
compute_pipeline = radv_get_saved_compute_pipeline(device); compute_pipeline = radv_get_saved_compute_pipeline(device);
radv_dump_enabled_options(device, stderr);
radv_dump_dmesg(stderr); radv_dump_dmesg(stderr);
if (vm_fault_occurred) { if (vm_fault_occurred) {

View File

@@ -417,12 +417,26 @@ static const struct debug_control radv_debug_options[] = {
{NULL, 0} {NULL, 0}
}; };
const char *
radv_get_debug_option_name(int id)
{
assert(id < ARRAY_SIZE(radv_debug_options) - 1);
return radv_debug_options[id].string;
}
static const struct debug_control radv_perftest_options[] = { static const struct debug_control radv_perftest_options[] = {
{"nobatchchain", RADV_PERFTEST_NO_BATCHCHAIN}, {"nobatchchain", RADV_PERFTEST_NO_BATCHCHAIN},
{"sisched", RADV_PERFTEST_SISCHED}, {"sisched", RADV_PERFTEST_SISCHED},
{NULL, 0} {NULL, 0}
}; };
const char *
radv_get_perftest_option_name(int id)
{
assert(id < ARRAY_SIZE(radv_debug_options) - 1);
return radv_perftest_options[id].string;
}
VkResult radv_CreateInstance( VkResult radv_CreateInstance(
const VkInstanceCreateInfo* pCreateInfo, const VkInstanceCreateInfo* pCreateInfo,
const VkAllocationCallbacks* pAllocator, const VkAllocationCallbacks* pAllocator,

View File

@@ -744,6 +744,13 @@ extern const struct radv_dynamic_state default_dynamic_state;
void radv_dynamic_state_copy(struct radv_dynamic_state *dest, void radv_dynamic_state_copy(struct radv_dynamic_state *dest,
const struct radv_dynamic_state *src, const struct radv_dynamic_state *src,
uint32_t copy_mask); uint32_t copy_mask);
const char *
radv_get_debug_option_name(int id);
const char *
radv_get_perftest_option_name(int id);
/** /**
* Attachment state when recording a renderpass instance. * Attachment state when recording a renderpass instance.
* *