Module: Mesa Branch: main Commit: 57c8164389b4cb7d364b1b62d3df5c769b690534 URL: http://cgit.freedesktop.org/mesa/mesa/commit/?id=57c8164389b4cb7d364b1b62d3df5c769b690534
Author: Rob Clark <robdcl...@chromium.org> Date: Tue May 11 08:44:42 2021 -0700 gallium/u_threaded: Add call logging Signed-off-by: Rob Clark <robdcl...@chromium.org> Reviewed-by: Marek Olšák <marek.ol...@amd.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/10753> --- src/gallium/auxiliary/util/u_threaded_context.c | 16 ++++++++++++++++ src/gallium/auxiliary/util/u_threaded_context.h | 2 +- 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/src/gallium/auxiliary/util/u_threaded_context.c b/src/gallium/auxiliary/util/u_threaded_context.c index 3c91d41e50c..f6a084d6574 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.c +++ b/src/gallium/auxiliary/util/u_threaded_context.c @@ -59,6 +59,14 @@ enum tc_call_id { TC_NUM_CALLS, }; +#if TC_DEBUG >= 3 +static const char *tc_call_names[] = { +#define CALL(name) #name, +#include "u_threaded_context_calls.h" +#undef CALL +}; +#endif + struct tc_draw_single { struct tc_call_base base; unsigned index_bias; @@ -280,6 +288,10 @@ tc_batch_execute(void *job, UNUSED int thread_index) } } +#if TC_DEBUG >= 3 + tc_printf("CALL: %s", tc_call_names[call->call_id]); +#endif + execute_func[call->call_id](pipe, call); iter += call->num_slots; } @@ -340,6 +352,10 @@ tc_add_sized_call(struct threaded_context *tc, enum tc_call_id id, call->call_id = id; call->num_slots = num_slots; +#if TC_DEBUG >= 3 + tc_printf("ENQUEUE: %s", tc_call_names[id]); +#endif + tc_debug_check(tc); return call; } diff --git a/src/gallium/auxiliary/util/u_threaded_context.h b/src/gallium/auxiliary/util/u_threaded_context.h index 74d7d36da39..d08e00ad936 100644 --- a/src/gallium/auxiliary/util/u_threaded_context.h +++ b/src/gallium/auxiliary/util/u_threaded_context.h @@ -182,7 +182,7 @@ struct threaded_context; struct tc_unflushed_batch_token; -/* 0 = disabled, 1 = assertions, 2 = printfs */ +/* 0 = disabled, 1 = assertions, 2 = printfs, 3 = logging */ #define TC_DEBUG 0 /* These are map flags sent to drivers. */ _______________________________________________ mesa-commit mailing list mesa-commit@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-commit