u_trace: extend tracepoint end_of_pipe bit into flags
We ran into an issue with Intel drivers where it became tricky to tell whether a timestamp must be recorded with a special end-of-pipe compute instruction or something else. We initially tried to deal with that internally by checking some state in the command buffers but turns out it doesn't work. This change adds a flag field to the tracepoint to have that information there and the flags are passed to the record_ts vfunc. Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com> Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/29438>
This commit is contained in:
committed by
Marge Bot
parent
265b2b1255
commit
3984875792
@@ -853,8 +853,7 @@ u_trace_appendv(struct u_trace *ut,
|
||||
}
|
||||
|
||||
/* record a timestamp for the trace: */
|
||||
ut->utctx->record_timestamp(ut, cs, chunk->timestamps, tp_idx,
|
||||
tp->end_of_pipe);
|
||||
ut->utctx->record_timestamp(ut, cs, chunk->timestamps, tp_idx, tp->flags);
|
||||
|
||||
chunk->traces[tp_idx] = (struct u_trace_event) {
|
||||
.tp = tp,
|
||||
|
||||
@@ -105,7 +105,7 @@ typedef void (*u_trace_record_ts)(struct u_trace *ut,
|
||||
void *cs,
|
||||
void *timestamps,
|
||||
unsigned idx,
|
||||
bool end_of_pipe);
|
||||
uint32_t flags);
|
||||
|
||||
/**
|
||||
* Driver provided callback to read back a previously recorded timestamp.
|
||||
|
||||
@@ -34,7 +34,7 @@ class Tracepoint(object):
|
||||
"""
|
||||
def __init__(self, name, args=[], toggle_name=None,
|
||||
tp_struct=None, tp_print=None, tp_perfetto=None,
|
||||
tp_markers=None, end_of_pipe=False, need_cs_param=True):
|
||||
tp_markers=None, tp_flags=[], need_cs_param=True):
|
||||
"""Parameters:
|
||||
|
||||
- name: the tracepoint name, a tracepoint function with the given
|
||||
@@ -72,7 +72,7 @@ class Tracepoint(object):
|
||||
self.tp_print = tp_print
|
||||
self.tp_perfetto = tp_perfetto
|
||||
self.tp_markers = tp_markers
|
||||
self.end_of_pipe = end_of_pipe
|
||||
self.tp_flags = tp_flags
|
||||
self.toggle_name = toggle_name
|
||||
self.need_cs_param = need_cs_param
|
||||
|
||||
@@ -449,7 +449,7 @@ static void __emit_label_${trace_name}(struct u_trace_context *utctx, void *cs,
|
||||
static const struct u_tracepoint __tp_${trace_name} = {
|
||||
ALIGN_POT(sizeof(struct trace_${trace_name}), 8), /* keep size 64b aligned */
|
||||
"${trace_name}",
|
||||
${"true" if trace.end_of_pipe else "false"},
|
||||
${0 if len(trace.tp_flags) == 0 else " | ".join(trace.tp_flags)},
|
||||
${index},
|
||||
__print_${trace_name},
|
||||
__print_json_${trace_name},
|
||||
|
||||
@@ -46,11 +46,9 @@ struct u_tracepoint {
|
||||
unsigned payload_sz;
|
||||
const char *name;
|
||||
/**
|
||||
* Whether this tracepoint's timestamp must be recorded with as an
|
||||
* end-of-pipe timestamp (for some GPUs the recording timestamp instruction
|
||||
* might be different for top/end of pipe).
|
||||
* A bitfield of driver agnostic flags
|
||||
*/
|
||||
bool end_of_pipe:1;
|
||||
uint16_t flags;
|
||||
/**
|
||||
* Index of this tracepoint in <basename>_tracepoint_names in the generated
|
||||
* u_trace perfetto header. By associating these names with iids in setup,
|
||||
|
||||
Reference in New Issue
Block a user