mirror of
https://gitlab.freedesktop.org/wayland/weston.git
synced 2026-05-19 21:28:11 +02:00
trace: Only add to annotation array if we're tracing
Saves some effort when we're not tracing - but if we start tracing in the middle of creating an annotation it could be missing a couple of fields. Signed-off-by: Derek Foreman <derek.foreman@collabora.com>
This commit is contained in:
parent
b4df8bd9e5
commit
d8e6906563
1 changed files with 10 additions and 8 deletions
|
|
@ -81,14 +81,16 @@
|
|||
.count = 0, \
|
||||
}
|
||||
|
||||
#define _WESTON_TRACE_ANNOTATE_ADD_GENERIC(k, v) \
|
||||
_Generic((v), \
|
||||
int: perfetto_annotate_int, \
|
||||
unsigned int: perfetto_annotate_int, \
|
||||
float: perfetto_annotate_float, \
|
||||
char *: perfetto_annotate_string, \
|
||||
const char *: perfetto_annotate_string \
|
||||
) (&__pd_annots, k, v);
|
||||
#define _WESTON_TRACE_ANNOTATE_ADD_GENERIC(k, v) \
|
||||
if (unlikely(util_perfetto_is_tracing_enabled())) { \
|
||||
_Generic((v), \
|
||||
int: perfetto_annotate_int, \
|
||||
unsigned int: perfetto_annotate_int, \
|
||||
float: perfetto_annotate_float, \
|
||||
char *: perfetto_annotate_string, \
|
||||
const char *: perfetto_annotate_string \
|
||||
) (&__pd_annots, k, v); \
|
||||
}
|
||||
|
||||
#define _WESTON_TRACE_ANNOTATE_ADD(k, v) \
|
||||
do { \
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue