util/u_trace: refcount payloads
authorLionel Landwerlin <lionel.g.landwerlin@intel.com>
Sat, 20 Nov 2021 23:06:09 +0000 (01:06 +0200)
committerMarge Bot <emma+marge@anholt.net>
Wed, 24 Nov 2021 17:53:08 +0000 (17:53 +0000)
commit14e45cb21eaf253b571aa410de422cdc6f9bb647
tree6cab421f611ebdc25dd6fd30bb25705a4c26cd7f
parent87888c0b3fe61abc9674187074d96864b094c067
util/u_trace: refcount payloads

When cloning a chunk of tracepoints, we cannot just copy the elements
of the traces[] array. We also need the payloads associated with
those.

This change introduces a new u_trace_payloaf_buf object that is
refcounted so that we can easily import traces[] elements and their
payloads from one utrace to another.

v2: use u_vector (Danylo)

v3: Delete outdate comment (Danylo)
    Fix assert (Danylo)

Signed-off-by: Lionel Landwerlin <lionel.g.landwerlin@intel.com>
Fixes: 0565c993f9eff9 ("u_trace: helpers for tracing tiling GPUs and re-usable VK cmdbuffers")
Reviewed-by: Danylo Piliaiev <dpiliaiev@igalia.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13899>
src/util/perf/u_trace.c
src/util/perf/u_trace.h