util/trace: add context helpers

These allow gpuvis to link two events and compute the duration.
This commit is contained in:
Simon Ser 2022-09-24 10:00:21 +02:00
parent 79b5dcb17d
commit 6531bff140
2 changed files with 36 additions and 0 deletions

View file

@ -1,9 +1,17 @@
#ifndef UTIL_TRACE_H
#define UTIL_TRACE_H
#include <stdint.h>
#include <wlr/util/log.h>
void wlr_trace(const char *format, ...) _WLR_ATTRIB_PRINTF(1, 2);
void wlr_vtrace(const char *format, va_list args) _WLR_ATTRIB_PRINTF(1, 0);
struct wlr_trace_ctx {
uint32_t seq;
};
void wlr_trace_begin_ctx(struct wlr_trace_ctx *ctx, const char *format, ...) _WLR_ATTRIB_PRINTF(2, 3);
void wlr_trace_end_ctx(struct wlr_trace_ctx *ctx, const char *format, ...) _WLR_ATTRIB_PRINTF(2, 3);
#endif