X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=include%2Flttng%2Fust-tracepoint-event.h;h=22c97438ba589c3c66694abbe69b5be98f511fb8;hb=2792781482a58865c7504100d8c1ba6db41193d1;hp=9066e495850a7a93a7bedc5b77fa379b1c111e10;hpb=7433d32d5a8f0e8833461b586a8c8b2274da0141;p=lttng-ust.git diff --git a/include/lttng/ust-tracepoint-event.h b/include/lttng/ust-tracepoint-event.h index 9066e495..22c97438 100644 --- a/include/lttng/ust-tracepoint-event.h +++ b/include/lttng/ust-tracepoint-event.h @@ -704,7 +704,10 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \ #define _ctf_array_encoded(_type, _item, _src, _byte_order, _length, \ _encoding, _nowrite, _elem_type_base) \ lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ - __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); + if (lttng_ust_string_encoding_##_encoding == lttng_ust_string_encoding_none) \ + __chan->ops->event_write(&__ctx, _src, sizeof(_type) * (_length)); \ + else \ + __chan->ops->event_strcpy_pad(&__ctx, (const char *) (_src), _length); \ #undef _ctf_sequence_encoded #define _ctf_sequence_encoded(_type, _item, _src, _byte_order, _length_type, \ @@ -715,8 +718,11 @@ size_t __event_get_align__##_provider##___##_name(_TP_ARGS_PROTO(_args)) \ __chan->ops->event_write(&__ctx, &__tmpl, sizeof(_length_type));\ } \ lib_ring_buffer_align_ctx(&__ctx, lttng_alignof(_type)); \ - __chan->ops->event_write(&__ctx, _src, \ - sizeof(_type) * __get_dynamic_len(dest)); + if (lttng_ust_string_encoding_##_encoding == lttng_ust_string_encoding_none) \ + __chan->ops->event_write(&__ctx, _src, \ + sizeof(_type) * __get_dynamic_len(dest)); \ + else \ + __chan->ops->event_strcpy_pad(&__ctx, (const char *) (_src), __get_dynamic_len(dest)); \ #undef _ctf_string #define _ctf_string(_item, _src, _nowrite) \