trace: update annotations even when not tracing

This hopefully isn't ridiculously heavy. The heavy part is committing the
flow array later, which is already gated by perfetto internally, so we
don't have to protect anything here ourselves.

This makes it easier to put flows in annotation arrays, because flows need
to be kept up to date even when not tracing.

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2026-05-20 15:35:27 -05:00
parent d35259e3b2
commit dc9ce8dd20

View file

@ -86,7 +86,6 @@
}
#define _WESTON_TRACE_ANNOTATE_ADD_GENERIC(k, v) \
if (unlikely(util_perfetto_is_tracing_enabled())) { \
static_assert(sizeof(k) < WESTON_TRACE_MAX_KEY_LENGTH); \
_Generic((v), \
int: perfetto_annotate_int, \
@ -98,8 +97,7 @@
const char *: perfetto_annotate_string, \
struct weston_buffer *: perfetto_annotate_buffer, \
const struct weston_buffer *: perfetto_annotate_buffer \
) (&__pd_annots, k, sizeof(k), v); \
}
) (&__pd_annots, k, sizeof(k), v);
#define _WESTON_TRACE_ANNOTATE_ADD(k, v) \
do { \