summaryrefslogtreecommitdiffstats
path: root/src/gallium/auxiliary
diff options
context:
space:
mode:
authorNicolai Hähnle <[email protected]>2019-02-26 16:34:34 +0100
committerNicolai Hähnle <[email protected]>2019-04-25 12:35:21 +0200
commitac0b60fa475278db78d937947b75e82a15a6d4bb (patch)
tree1162baa2f768a5f062dd4fc0ed3cabcb28a9317e /src/gallium/auxiliary
parentb7fab7b02db07105a66a45fe7649ab52c1b7cd6e (diff)
ddebug: dump driver state into a separate file
Due to asynchronous execution, it's not clear which of the draws the state may refer to. This also works around an issue encountered with radeonsi where dumping the driver state itself caused a hang. Reviewed-by: Marek Olšák <[email protected]>
Diffstat (limited to 'src/gallium/auxiliary')
-rw-r--r--src/gallium/auxiliary/driver_ddebug/dd_draw.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/src/gallium/auxiliary/driver_ddebug/dd_draw.c b/src/gallium/auxiliary/driver_ddebug/dd_draw.c
index bda1891c49b..98e7a6bb99f 100644
--- a/src/gallium/auxiliary/driver_ddebug/dd_draw.c
+++ b/src/gallium/auxiliary/driver_ddebug/dd_draw.c
@@ -988,11 +988,6 @@ dd_report_hang(struct dd_context *dctx)
dd_write_header(f, dscreen->screen, record->draw_state.base.apitrace_call_number);
dd_write_record(f, record);
- if (!encountered_hang) {
- dd_dump_driver_state(dctx, f, PIPE_DUMP_DEVICE_STATUS_REGISTERS);
- dd_dump_dmesg(f);
- }
-
fclose(f);
}
@@ -1004,6 +999,18 @@ dd_report_hang(struct dd_context *dctx)
if (num_later)
fprintf(stderr, "... and %u additional draws.\n", num_later);
+ char name[512];
+ dd_get_debug_filename_and_mkdir(name, sizeof(name), false);
+ FILE *f = fopen(name, "w");
+ if (!f) {
+ fprintf(stderr, "fopen failed\n");
+ } else {
+ dd_write_header(f, dscreen->screen, 0);
+ dd_dump_driver_state(dctx, f, PIPE_DUMP_DEVICE_STATUS_REGISTERS);
+ dd_dump_dmesg(f);
+ fclose(f);
+ }
+
fprintf(stderr, "\nDone.\n");
dd_kill_process();
}