const void *src, size_t len);
void (*event_strcpy)(struct lttng_ust_lib_ring_buffer_ctx *ctx,
const char *src, size_t len);
+ void (*event_strcpy_pad)(struct lttng_ust_lib_ring_buffer_ctx *ctx,
+ const char *src, size_t len);
/* End of base ABI. Fields below should be used after checking struct_size. */
};
#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, \
__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) \
lib_ring_buffer_strcpy(&client_config, ctx, src, len, '#');
}
+static
+void lttng_event_strcpy_pad(struct lttng_ust_lib_ring_buffer_ctx *ctx,
+ const char *src, size_t len)
+{
+ lib_ring_buffer_strcpy(&client_config, ctx, src, len, '\0');
+}
+
#if 0
static
wait_queue_head_t *lttng_get_reader_wait_queue(struct lttng_ust_lib_ring_buffer_channel *chan)
.event_commit = lttng_event_commit,
.event_write = lttng_event_write,
.event_strcpy = lttng_event_strcpy,
+ .event_strcpy_pad = lttng_event_strcpy_pad,
},
.client_config = &client_config,
};