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:
@@ -493,7 +493,10 @@ tu_cs_emit_debug_msg(struct tu_cs *cs, const char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
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_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
@@ -502,7 +505,7 @@ tu_cs_trace_start(void *cs, const char *fmt, ...)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
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_list args;
|
||||||
va_start(args, fmt);
|
va_start(args, fmt);
|
||||||
|
@@ -403,11 +403,14 @@ tu_cs_emit_debug_msg(struct tu_cs *cs, const char *fmt, ...);
|
|||||||
|
|
||||||
typedef struct tu_cs *tu_debug_scope;
|
typedef struct tu_cs *tu_debug_scope;
|
||||||
|
|
||||||
__attribute__((format(printf, 2, 3))) void
|
__attribute__((format(printf, 3, 4))) void
|
||||||
tu_cs_trace_start(void *cs, const char *fmt, ...);
|
tu_cs_trace_start(struct u_trace_context *utctx,
|
||||||
|
void *cs,
|
||||||
|
const char *fmt,
|
||||||
|
...);
|
||||||
|
|
||||||
__attribute__((format(printf, 2, 3))) void
|
__attribute__((format(printf, 3, 4))) void
|
||||||
tu_cs_trace_end(void *cs, const char *fmt, ...);
|
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
|
/* Helpers for bracketing a large sequence of commands of unknown size inside
|
||||||
* a CP_COND_REG_EXEC packet.
|
* a CP_COND_REG_EXEC packet.
|
||||||
|
@@ -420,10 +420,10 @@ static void __print_json_${trace_name}(FILE *out, const void *arg) {
|
|||||||
% endif
|
% endif
|
||||||
% if trace.tp_markers is not None:
|
% 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) {
|
static void __emit_label_${trace_name}(struct u_trace_context *utctx, void *cs, struct trace_${trace_name} *entry) {
|
||||||
${trace.tp_markers}(cs, "${trace_name}("
|
${trace.tp_markers}(utctx, cs, "${trace_name}("
|
||||||
% for idx,arg in enumerate(trace.tp_struct):
|
% for idx,arg in enumerate(trace.tp_struct):
|
||||||
"${"," if idx != 0 else ""}${arg.name}=${arg.c_format}"
|
"${"," if idx != 0 else ""}${arg.name}=${arg.c_format}"
|
||||||
% endfor
|
% endfor
|
||||||
@@ -486,7 +486,7 @@ void __trace_${trace_name}(
|
|||||||
% endfor
|
% endfor
|
||||||
% if trace.tp_markers is not None:
|
% if trace.tp_markers is not None:
|
||||||
if (enabled_traces & U_TRACE_TYPE_MARKERS)
|
if (enabled_traces & U_TRACE_TYPE_MARKERS)
|
||||||
__emit_label_${trace_name}(cs, __entry);
|
__emit_label_${trace_name}(ut->utctx, cs, __entry);
|
||||||
% endif
|
% endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user