trace: Have a single macro for a flowed func with annotations

Make a WESTON_TRACE_ANNOTATE_FUNC_FLOW that does the preamble, adds the
annotations, and flushes it out in a single "statement".

Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
Derek Foreman 2026-05-06 08:36:57 -05:00
parent a92dd64159
commit c662f9239a
2 changed files with 6 additions and 5 deletions

View file

@ -204,10 +204,9 @@ weston_surface_attach(struct weston_surface *surface,
struct weston_buffer *old_buffer = surface->buffer_ref.buffer;
enum weston_paint_node_status pnode_changes = WESTON_PAINT_NODE_CLEAN;
WESTON_TRACE_BEGIN_ANNOTATION();
WESTON_TRACE_ANNOTATE(("surface", surface->internal_name),
("new buffer", buffer));
WESTON_TRACE_ANNOTATE_FUNC_FLOW(&surface->flow_id);
WESTON_TRACE_ANNOTATE_FUNC_FLOW(&surface->flow_id,
("surface", surface->internal_name),
("new buffer", buffer));
if (!buffer) {
if (weston_surface_is_mapped(surface)) {

View file

@ -265,7 +265,9 @@ _weston_trace_scope_end(int *scope)
#define WESTON_TRACE_ANNOTATE_FUNC() \
_WESTON_TRACE_ANNOTATE_FUNC(__func__)
#define WESTON_TRACE_ANNOTATE_FUNC_FLOW(id) \
#define WESTON_TRACE_ANNOTATE_FUNC_FLOW(id, ...) \
_WESTON_TRACE_BEGIN_ANNOTATION(); \
WESTON_TRACE_ANNOTATE(__VA_ARGS__) \
_WESTON_TRACE_ANNOTATE_FUNC_FLOW(id, __func__)
#define FORCE_RECURSE ()