Fix: context alignment not properly handled
[lttng-ust.git] / liblttng-ust / lttng-ring-buffer-client.h
index e734632ff05368cb298e23faeeb9fa8bfad0965a..96aeb1e5d7d2b5c5116ae884e9481e8e6b7370cd 100644 (file)
@@ -76,6 +76,7 @@ size_t ctx_get_size(size_t offset, struct lttng_ctx *ctx)
 
        if (caa_likely(!ctx))
                return 0;
+       offset += lib_ring_buffer_align(offset, ctx->largest_align);
        for (i = 0; i < ctx->nr_fields; i++)
                offset += ctx->fields[i].get_size(offset);
        return offset - orig_offset;
@@ -90,6 +91,7 @@ void ctx_record(struct lttng_ust_lib_ring_buffer_ctx *bufctx,
 
        if (caa_likely(!ctx))
                return;
+       lib_ring_buffer_align_ctx(bufctx, ctx->largest_align);
        for (i = 0; i < ctx->nr_fields; i++)
                ctx->fields[i].record(&ctx->fields[i], bufctx, chan);
 }
This page took 0.024428 seconds and 4 git commands to generate.