- offset += ctx_get_size(offset, lttng_chan->ctx);
- offset += ctx_get_size(offset, event->ctx);
+ offset += ctx_get_aligned_size(offset, lttng_chan->ctx,
+ client_ctx->packet_context_len);
+ offset += ctx_get_aligned_size(offset, event->ctx,
+ client_ctx->event_context_len);