From 57c8164389b4cb7d364b1b62d3df5c769b690534 Mon Sep 17 00:00:00 2001 From: Rob Clark Date: Tue, 11 May 2021 08:44:42 -0700 Subject: [PATCH] gallium/u_threaded: Add call logging MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Rob Clark Reviewed-by: Marek Olšák Part-of: --- 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 3c91d41..f6a084d 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 74d7d36..d08e00a 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. */ -- 2.7.4