X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=include%2Fust%2Flttng-tracepoint-event.h;h=46d8b93374304e451f893a8c76a318cf55713bbe;hb=d4419b81b243bc3a6bdd4a09b3ca2216d044a1c7;hp=a83cc545e2d8522db2a3213a1062dc6753ff4d71;hpb=5dba59370c99b0d253f1bda39b12a0a076ef09c6;p=lttng-ust.git diff --git a/include/ust/lttng-tracepoint-event.h b/include/ust/lttng-tracepoint-event.h index a83cc545..46d8b933 100644 --- a/include/ust/lttng-tracepoint-event.h +++ b/include/ust/lttng-tracepoint-event.h @@ -43,6 +43,8 @@ #define ctf_integer_network_hex(_type, _item, _src) \ ctf_integer_ext(_type, _item, _src, BIG_ENDIAN, 16) +/* ctf_float is redefined at each step */ + #undef ctf_array #define ctf_array(_type, _item, _src, _length) \ ctf_array_encoded(_type, _item, _src, _length, none) @@ -316,19 +318,6 @@ static inline size_t __event_get_size__##_name(size_t *__dynamic_len, _proto) \ return __event_len; \ } -#undef TRACEPOINT_EVENT_CLASS_NOARGS -#define TRACEPOINT_EVENT_CLASS_NOARGS(_name, _fields) \ -static inline size_t __event_get_size__##_name(size_t *__dynamic_len) \ -{ \ - size_t __event_len = 0; \ - unsigned int __dynamic_len_idx = 0; \ - \ - if (0) \ - (void) __dynamic_len_idx; /* don't warn if unused */ \ - _fields \ - return __event_len; \ -} - #include TRACEPOINT_INCLUDE(TRACEPOINT_INCLUDE_FILE) /* @@ -378,15 +367,6 @@ static inline size_t __event_get_align__##_name(_proto) \ return __event_align; \ } -#undef TRACEPOINT_EVENT_CLASS_NOARGS -#define TRACEPOINT_EVENT_CLASS_NOARGS(_name, _fields) \ -static inline size_t __event_get_align__##_name(void) \ -{ \ - size_t __event_align = 1; \ - _fields \ - return __event_align; \ -} - #include TRACEPOINT_INCLUDE(TRACEPOINT_INCLUDE_FILE) @@ -408,39 +388,39 @@ static inline size_t __event_get_align__##_name(void) \ #define ctf_integer_ext(_type, _item, _src, _byte_order, _base) \ { \ _type __tmp = (_src); \ - lib_ring_buffer_align_ctx(&ctx, lttng_alignof(__tmp)); \ - __chan->ops->event_write(&ctx, &__tmp, sizeof(__tmp)); \ + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\ + __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp));\ } #undef ctf_float #define ctf_float(_type, _item, _src) \ { \ _type __tmp = (_src); \ - lib_ring_buffer_align_ctx(&ctx, lttng_alignof(__tmp)); \ - __chan->ops->event_write(&ctx, &__tmp, sizeof(__tmp)); \ + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(__tmp));\ + __chan->ops->event_write(&__ctx, &__tmp, sizeof(__tmp));\ } #undef ctf_array_encoded #define ctf_array_encoded(_type, _item, _src, _length, _encoding) \ - lib_ring_buffer_align_ctx(&ctx, lttng_alignof(_type)); \ - __chan->ops->event_write(&ctx, _src, _length); + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ + __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); #undef ctf_sequence_encoded #define ctf_sequence_encoded(_type, _item, _src, _length_type, \ _src_length, _encoding) \ { \ _length_type __tmpl = __dynamic_len[__dynamic_len_idx]; \ - lib_ring_buffer_align_ctx(&ctx, lttng_alignof(_length_type)); \ - __chan->ops->event_write(&ctx, &__tmpl, sizeof(_length_type)); \ + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_length_type));\ + __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\ } \ - lib_ring_buffer_align_ctx(&ctx, lttng_alignof(_type)); \ - __chan->ops->event_write(&ctx, _src, \ + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ + __chan->ops->event_write(&__ctx, _src, \ sizeof(_type) * __get_dynamic_len(dest)); #undef ctf_string #define ctf_string(_item, _src) \ - lib_ring_buffer_align_ctx(&ctx, lttng_alignof(*(_src))); \ - __chan->ops->event_write(&ctx, _src, __get_dynamic_len(dest)); + lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(*(_src))); \ + __chan->ops->event_write(&__ctx, _src, __get_dynamic_len(dest)); /* Beware: this get len actually consumes the len value */ #undef __get_dynamic_len @@ -461,7 +441,7 @@ static void __event_probe__##_name(void *__data, _proto) \ { \ struct ltt_event *__event = __data; \ struct ltt_channel *__chan = __event->chan; \ - struct lib_ring_buffer_ctx ctx; \ + struct lttng_ust_lib_ring_buffer_ctx __ctx; \ size_t __event_len, __event_align; \ size_t __dynamic_len_idx = 0; \ size_t __dynamic_len[_TP_ARRAY_SIZE(__event_fields___##_name)]; \ @@ -469,21 +449,21 @@ static void __event_probe__##_name(void *__data, _proto) \ \ if (0) \ (void) __dynamic_len_idx; /* don't warn if unused */ \ - if (unlikely(!CMM_ACCESS_ONCE(__chan->session->active))) \ + if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->session->active))) \ return; \ - if (unlikely(!CMM_ACCESS_ONCE(__chan->enabled))) \ + if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->enabled))) \ return; \ - if (unlikely(!CMM_ACCESS_ONCE(__event->enabled))) \ + if (caa_unlikely(!CMM_ACCESS_ONCE(__event->enabled))) \ return; \ __event_len = __event_get_size__##_name(__dynamic_len, _args); \ __event_align = __event_get_align__##_name(_args); \ - lib_ring_buffer_ctx_init(&ctx, __chan->chan, __event, __event_len, \ - __event_align, -1); \ - __ret = __chan->ops->event_reserve(&ctx, __event->id); \ + lib_ring_buffer_ctx_init(&__ctx, __chan->chan, __event, __event_len, \ + __event_align, -1, __chan->handle); \ + __ret = __chan->ops->event_reserve(&__ctx, __event->id); \ if (__ret < 0) \ return; \ _fields \ - __chan->ops->event_commit(&ctx); \ + __chan->ops->event_commit(&__ctx); \ } #undef TRACEPOINT_EVENT_CLASS_NOARGS @@ -492,29 +472,25 @@ static void __event_probe__##_name(void *__data) \ { \ struct ltt_event *__event = __data; \ struct ltt_channel *__chan = __event->chan; \ - struct lib_ring_buffer_ctx ctx; \ + struct lttng_ust_lib_ring_buffer_ctx __ctx; \ size_t __event_len, __event_align; \ - size_t __dynamic_len_idx = 0; \ - size_t __dynamic_len[_TP_ARRAY_SIZE(__event_fields___##_name)]; \ int __ret; \ \ - if (0) \ - (void) __dynamic_len_idx; /* don't warn if unused */ \ - if (unlikely(!CMM_ACCESS_ONCE(__chan->session->active))) \ + if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->session->active))) \ return; \ - if (unlikely(!CMM_ACCESS_ONCE(__chan->enabled))) \ + if (caa_unlikely(!CMM_ACCESS_ONCE(__chan->enabled))) \ return; \ - if (unlikely(!CMM_ACCESS_ONCE(__event->enabled))) \ + if (caa_unlikely(!CMM_ACCESS_ONCE(__event->enabled))) \ return; \ - __event_len = __event_get_size__##_name(__dynamic_len); \ - __event_align = __event_get_align__##_name(); \ - lib_ring_buffer_ctx_init(&ctx, __chan->chan, __event, __event_len, \ - __event_align, -1); \ - __ret = __chan->ops->event_reserve(&ctx, __event->id); \ + __event_len = 0; \ + __event_align = 1; \ + lib_ring_buffer_ctx_init(&__ctx, __chan->chan, __event, __event_len, \ + __event_align, -1, __chan->handle); \ + __ret = __chan->ops->event_reserve(&__ctx, __event->id); \ if (__ret < 0) \ return; \ _fields \ - __chan->ops->event_commit(&ctx); \ + __chan->ops->event_commit(&__ctx); \ } #include TRACEPOINT_INCLUDE(TRACEPOINT_INCLUDE_FILE)