#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_pstrcpy_pad(&__ctx, (const char *) (_src), _length); \
#undef _ctf_sequence_encoded
#define _ctf_sequence_encoded(_type, _item, _src, _byte_order, _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, \
- 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_pstrcpy_pad(&__ctx, (const char *) (_src), __get_dynamic_len(dest)); \
#undef _ctf_string
#define _ctf_string(_item, _src, _nowrite) \
__lttng_ctx.struct_size = sizeof(struct lttng_ust_stack_ctx); \
__lttng_ctx.event_recorder = __event_recorder; \
lib_ring_buffer_ctx_init(&__ctx, __chan->chan, &__lttng_ctx, __event_len, \
- __event_align, -1, __chan->handle); \
+ __event_align); \
__ctx.ip = _TP_IP_PARAM(TP_IP_PARAM); \
__ret = __chan->ops->event_reserve(&__ctx, __event_recorder->id); \
if (__ret < 0) \