ddebug: write out final driver log messages with GALLIUM_DDEBUG=always
authorNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 6 Sep 2017 08:11:40 +0000 (10:11 +0200)
committerNicolai Hähnle <nicolai.haehnle@amd.com>
Wed, 13 Sep 2017 16:24:18 +0000 (18:24 +0200)
If the last operation happens to be a non-draw, such as a
transfer_map that triggers a decompress blit, there may be
interesting messages left in the driver log.

Reviewed-by: Marek Olšák <marek.olsak@amd.com>
src/gallium/drivers/ddebug/dd_context.c
src/gallium/drivers/ddebug/dd_draw.c
src/gallium/drivers/ddebug/dd_pipe.h

index fc44a4bd1b930bca32f64f82a7a26a78271a9439..2abbff933f62352e74d13d5ed3e7ef296bdbd817 100644 (file)
@@ -584,8 +584,19 @@ dd_context_destroy(struct pipe_context *_pipe)
       pipe_resource_reference(&dctx->fence, NULL);
    }
 
-   if (pipe->set_log_context)
+   if (pipe->set_log_context) {
       pipe->set_log_context(pipe, NULL);
+
+      if (dd_screen(dctx->base.screen)->mode == DD_DUMP_ALL_CALLS) {
+         FILE *f = dd_get_file_stream(dd_screen(dctx->base.screen), 0);
+         if (f) {
+            fprintf(f, "Remainder of driver log:\n\n");
+         }
+
+         u_log_new_page_print(&dctx->log, f);
+         fclose(f);
+      }
+   }
    u_log_context_destroy(&dctx->log);
 
    pipe->destroy(pipe);
index 4bf13bd7e460570f53ae1fc96df288d1718e4c1c..aec9332d903c1badbc50782dd7128276b491a3ac 100644 (file)
@@ -39,7 +39,7 @@
 #include <inttypes.h>
 
 
-static FILE *
+FILE *
 dd_get_file_stream(struct dd_screen *dscreen, unsigned apitrace_call_number)
 {
    struct pipe_screen *screen = dscreen->screen;
index 70b9ae8ae82c9a00241a62215ccfe6113c5fcf19..252dbffac862a4f0aa03207114bbc44d92ed153a 100644 (file)
@@ -274,6 +274,8 @@ dd_init_draw_functions(struct dd_context *dctx);
 int
 dd_thread_pipelined_hang_detect(void *input);
 
+FILE *
+dd_get_file_stream(struct dd_screen *dscreen, unsigned apitrace_call_number);
 
 static inline struct dd_context *
 dd_context(struct pipe_context *pipe)