util/u_trace: pass utrace context to marker functions.

This is needed later by freedreno in order to get
more device information in trace functions.

Signed-off-by: amber@igalia.com
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/20727>
This commit is contained in:
Amber
2023-01-16 13:29:05 +01:00
committed by Marge Bot
parent c7fc30421c
commit ab9dd18b68
3 changed files with 16 additions and 10 deletions

View File

@@ -493,7 +493,10 @@ tu_cs_emit_debug_msg(struct tu_cs *cs, const char *fmt, ...)
}
void
tu_cs_trace_start(void *cs, const char *fmt, ...)
tu_cs_trace_start(struct u_trace_context *utctx,
void *cs,
const char *fmt,
...)
{
va_list args;
va_start(args, fmt);
@@ -502,7 +505,7 @@ tu_cs_trace_start(void *cs, const char *fmt, ...)
}
void
tu_cs_trace_end(void *cs, const char *fmt, ...)
tu_cs_trace_end(struct u_trace_context *utctx, void *cs, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);

View File

@@ -403,11 +403,14 @@ tu_cs_emit_debug_msg(struct tu_cs *cs, const char *fmt, ...);
typedef struct tu_cs *tu_debug_scope;
__attribute__((format(printf, 2, 3))) void
tu_cs_trace_start(void *cs, const char *fmt, ...);
__attribute__((format(printf, 3, 4))) void
tu_cs_trace_start(struct u_trace_context *utctx,
void *cs,
const char *fmt,
...);
__attribute__((format(printf, 2, 3))) void
tu_cs_trace_end(void *cs, const char *fmt, ...);
__attribute__((format(printf, 3, 4))) void
tu_cs_trace_end(struct u_trace_context *utctx, void *cs, const char *fmt, ...);
/* Helpers for bracketing a large sequence of commands of unknown size inside
* a CP_COND_REG_EXEC packet.

View File

@@ -420,10 +420,10 @@ static void __print_json_${trace_name}(FILE *out, const void *arg) {
% endif
% if trace.tp_markers is not None:
__attribute__((format(printf, 2, 3))) void ${trace.tp_markers}(void *, const char *, ...);
__attribute__((format(printf, 3, 4))) void ${trace.tp_markers}(struct u_trace_context *utctx, void *, const char *, ...);
static void __emit_label_${trace_name}(void *cs, struct trace_${trace_name} *entry) {
${trace.tp_markers}(cs, "${trace_name}("
static void __emit_label_${trace_name}(struct u_trace_context *utctx, void *cs, struct trace_${trace_name} *entry) {
${trace.tp_markers}(utctx, cs, "${trace_name}("
% for idx,arg in enumerate(trace.tp_struct):
"${"," if idx != 0 else ""}${arg.name}=${arg.c_format}"
% endfor
@@ -486,7 +486,7 @@ void __trace_${trace_name}(
% endfor
% if trace.tp_markers is not None:
if (enabled_traces & U_TRACE_TYPE_MARKERS)
__emit_label_${trace_name}(cs, __entry);
__emit_label_${trace_name}(ut->utctx, cs, __entry);
% endif
}