diff --git a/libweston/perfetto/annotations.c b/libweston/perfetto/annotations.c index 7cee650a3..f383a699f 100644 --- a/libweston/perfetto/annotations.c +++ b/libweston/perfetto/annotations.c @@ -23,9 +23,11 @@ * SOFTWARE. */ +#include "config.h" #include #include "perfetto/annotations.h" +#include "shared/weston-assert.h" #include "weston-trace.h" WL_EXPORT int @@ -34,6 +36,8 @@ perfetto_annotate_int(struct weston_debug_annotation *annots, const char *key, int value) { + weston_assert_u32_gt(NULL, WESTON_MAX_DEBUG_ANNOTS, count); + annots[count].type = WESTON_DEBUG_ANNOTATION_INT_VAL; annots[count].ivalue = value; annots[count].key = key; @@ -47,6 +51,8 @@ perfetto_annotate_float(struct weston_debug_annotation *annots, const char *key, float value) { + weston_assert_u32_gt(NULL, WESTON_MAX_DEBUG_ANNOTS, count); + annots[count].type = WESTON_DEBUG_ANNOTATION_FLOAT_VAL; annots[count].fvalue = value; annots[count].key = key; @@ -60,6 +66,8 @@ perfetto_annotate_string(struct weston_debug_annotation *annots, const char *key, const char *value) { + weston_assert_u32_gt(NULL, WESTON_MAX_DEBUG_ANNOTS, count); + annots[count].type = WESTON_DEBUG_ANNOTATION_STR_VAL; annots[count].svalue = value; annots[count].key = key; diff --git a/libweston/weston-trace.h b/libweston/weston-trace.h index b8b4f582a..f19eae457 100644 --- a/libweston/weston-trace.h +++ b/libweston/weston-trace.h @@ -79,7 +79,6 @@ unsigned int __pd_i = 0 #define _WESTON_TRACE_DO_ANNOTATE_ADD(k, v) \ - weston_assert_u32_gt(NULL, WESTON_MAX_DEBUG_ANNOTS, __pd_i); \ __pd_i += _Generic((v), \ int: perfetto_annotate_int, \ unsigned int: perfetto_annotate_int, \