From 525921ed51176255474c73adacfc6801a7bf2783 Mon Sep 17 00:00:00 2001 From: Marek Olšák Date: Sat, 4 Jul 2015 14:10:21 +0200 Subject: gallium/ddebug: new pipe for hang detection and driver state dumping (v2) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit v2: lots of improvements This is like identity or trace, but simpler. It doesn't wrap most states. Run with: GALLIUM_DDEBUG=1000 [executable] where "executable" is the app and "1000" is in miliseconds, meaning that the context will be considered hung if a fence fails to signal in 1000 ms. If that happens, all shaders, context states, bound resources, draw parameters, and driver debug information (if any) will be dumped into: /home/$username/dd_dumps/$processname_$pid_$index. Note that the context is flushed after every draw/clear/copy/blit operation and then waited for to find the exact call that hangs. You can also do: GALLIUM_DDEBUG=always to do the dumping after every draw/clear/copy/blit operation without flushing and waiting. Examples of driver states that can be dumped are: - Hardware status registers saying which hw block is busy (hung). - Disassembled shaders in a human-readable form. - The last submitted command buffer in a human-readable form. v2: drop pipe-loader changes, drop SConscript rename dd.h -> dd_pipe.h Acked-by: Christian König Acked-by: Alex Deucher --- src/gallium/auxiliary/target-helpers/inline_debug_helper.h | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src/gallium/auxiliary/target-helpers') diff --git a/src/gallium/auxiliary/target-helpers/inline_debug_helper.h b/src/gallium/auxiliary/target-helpers/inline_debug_helper.h index d353ab81e34..2443bf21468 100644 --- a/src/gallium/auxiliary/target-helpers/inline_debug_helper.h +++ b/src/gallium/auxiliary/target-helpers/inline_debug_helper.h @@ -11,6 +11,10 @@ * one or more debug driver: rbug, trace. */ +#ifdef GALLIUM_DDEBUG +#include "ddebug/dd_public.h" +#endif + #ifdef GALLIUM_TRACE #include "trace/tr_public.h" #endif @@ -30,6 +34,10 @@ static inline struct pipe_screen * debug_screen_wrap(struct pipe_screen *screen) { +#if defined(GALLIUM_DDEBUG) + screen = ddebug_screen_create(screen); +#endif + #if defined(GALLIUM_RBUG) screen = rbug_screen_create(screen); #endif -- cgit v1.2.3