X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=src%2Flttng-ring-buffer-client.h;h=e2ef7d7664cd6e577448e79a491834c2146ddebf;hb=959132c967690a1ab263766279e779c4d36fa3b9;hp=2eee81a1fad57f37d1f1e305af1a4d282cedacc0;hpb=a2a1b5ab74c22450126b5f80fb30db596945f875;p=lttng-modules.git diff --git a/src/lttng-ring-buffer-client.h b/src/lttng-ring-buffer-client.h index 2eee81a1..e2ef7d76 100644 --- a/src/lttng-ring-buffer-client.h +++ b/src/lttng-ring-buffer-client.h @@ -657,15 +657,17 @@ void lttng_event_commit(struct lttng_kernel_ring_buffer_ctx *ctx) static void lttng_event_write(struct lttng_kernel_ring_buffer_ctx *ctx, const void *src, - size_t len) + size_t len, size_t alignment) { + lib_ring_buffer_align_ctx(ctx, alignment); lib_ring_buffer_write(&client_config, ctx, src, len); } static void lttng_event_write_from_user(struct lttng_kernel_ring_buffer_ctx *ctx, - const void __user *src, size_t len) + const void __user *src, size_t len, size_t alignment) { + lib_ring_buffer_align_ctx(ctx, alignment); lib_ring_buffer_copy_from_user_inatomic(&client_config, ctx, src, len); } @@ -691,6 +693,20 @@ void lttng_event_strcpy_from_user(struct lttng_kernel_ring_buffer_ctx *ctx, len, '#'); } +static +void lttng_event_pstrcpy_pad(struct lttng_kernel_ring_buffer_ctx *ctx, const char *src, + size_t len) +{ + lib_ring_buffer_pstrcpy(&client_config, ctx, src, len, '\0'); +} + +static +void lttng_event_pstrcpy_pad_from_user(struct lttng_kernel_ring_buffer_ctx *ctx, const char __user *src, + size_t len) +{ + lib_ring_buffer_pstrcpy_from_user_inatomic(&client_config, ctx, src, len, '\0'); +} + static void lttng_channel_buffer_lost_event_too_big(struct lttng_kernel_channel_buffer *lttng_chan) { @@ -757,6 +773,8 @@ static struct lttng_transport lttng_relay_transport = { .event_memset = lttng_event_memset, .event_strcpy = lttng_event_strcpy, .event_strcpy_from_user = lttng_event_strcpy_from_user, + .event_pstrcpy_pad = lttng_event_pstrcpy_pad, + .event_pstrcpy_pad_from_user = lttng_event_pstrcpy_pad_from_user, .lost_event_too_big = lttng_channel_buffer_lost_event_too_big, }, };