tracepoint: validate provider/event name length with static assert
[lttng-ust.git] / include / lttng / ust-tracepoint-event.h
index 7b99ecb649f991b93ab71fefbeb555fb0ad4217e..c50047d0baf4c6fc5a262b70b9f2ed72328e1e23 100644 (file)
@@ -10,7 +10,7 @@
 #include <urcu/compiler.h>
 #include <urcu/rculist.h>
 #include <lttng/ust-events.h>
-#include <lttng/ringbuffer-context.h>
+#include <lttng/ust-ringbuffer-context.h>
 #include <lttng/ust-arch.h>
 #include <lttng/ust-compiler.h>
 #include <lttng/tracepoint.h>
@@ -109,10 +109,7 @@ void _TP_COMBINE_TOKENS(__tracepoint_provider_check_, TRACEPOINT_PROVIDER)(void)
 
 #undef _TRACEPOINT_EVENT_INSTANCE
 #define _TRACEPOINT_EVENT_INSTANCE(_provider, _template, _name, _args) \
-static const char                                                      \
-       __tp_name_len_check##_provider##___##_name[LTTNG_UST_ABI_SYM_NAME_LEN] \
-       __attribute__((unused)) =                                       \
-               #_provider ":" #_name;
+       lttng_ust_tracepoint_validate_name_len(_provider, _name);
 
 #include TRACEPOINT_INCLUDE
 
@@ -413,14 +410,14 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
 #define _ctf_integer_ext(_type, _item, _src, _byte_order, _base, _nowrite)       \
        if (0)                                                                   \
                (void) (_src);  /* Unused */                                     \
-       __event_len += lttng_ust_lib_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_type)); \
+       __event_len += lttng_ust_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_type)); \
        __event_len += sizeof(_type);
 
 #undef _ctf_float
 #define _ctf_float(_type, _item, _src, _nowrite)                                \
        if (0)                                                                   \
                (void) (_src);  /* Unused */                                     \
-       __event_len += lttng_ust_lib_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_type)); \
+       __event_len += lttng_ust_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_type)); \
        __event_len += sizeof(_type);
 
 #undef _ctf_array_encoded
@@ -428,7 +425,7 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
                        _nowrite, _elem_type_base)                               \
        if (0)                                                                   \
                (void) (_src);  /* Unused */                                     \
-       __event_len += lttng_ust_lib_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_type)); \
+       __event_len += lttng_ust_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_type)); \
        __event_len += sizeof(_type) * (_length);
 
 #undef _ctf_sequence_encoded
@@ -436,9 +433,9 @@ static void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args));
                        _src_length, _encoding, _nowrite, _elem_type_base)       \
        if (0)                                                                   \
                (void) (_src);  /* Unused */                                     \
-       __event_len += lttng_ust_lib_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_length_type));   \
+       __event_len += lttng_ust_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_length_type));   \
        __event_len += sizeof(_length_type);                                   \
-       __event_len += lttng_ust_lib_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_type)); \
+       __event_len += lttng_ust_ring_buffer_align(__event_len, lttng_ust_rb_alignof(_type)); \
        __dynamic_len[__dynamic_len_idx] = (_src_length);                      \
        __event_len += sizeof(_type) * __dynamic_len[__dynamic_len_idx];       \
        __dynamic_len_idx++;
@@ -889,12 +886,12 @@ void __event_probe__##_provider##___##_name(_TP_ARGS_DATA_PROTO(_args))         \
                size_t __event_len, __event_align;                            \
                struct lttng_ust_event_recorder *__event_recorder = (struct lttng_ust_event_recorder *) __event->child; \
                struct lttng_ust_channel_buffer *__chan = __event_recorder->chan; \
-               struct lttng_ust_lib_ring_buffer_ctx __ctx;                   \
+               struct lttng_ust_ring_buffer_ctx __ctx;               \
                                                                              \
                __event_len = __event_get_size__##_provider##___##_name(__stackvar.__dynamic_len, \
                         _TP_ARGS_DATA_VAR(_args));                           \
                __event_align = __event_get_align__##_provider##___##_name(_TP_ARGS_VAR(_args)); \
-               lttng_ust_lib_ring_buffer_ctx_init(&__ctx, __event_recorder, __event_len, __event_align, \
+               lttng_ust_ring_buffer_ctx_init(&__ctx, __event_recorder, __event_len, __event_align, \
                                _TP_IP_PARAM(TP_IP_PARAM));                   \
                __ret = __chan->ops->event_reserve(&__ctx);                   \
                if (__ret < 0)                                                \
This page took 0.024357 seconds and 4 git commands to generate.