X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=include%2Flttng%2Fringbuffer-config.h;h=8752e36993403ace30ba7c0efaaacd763dc32f68;hb=b72687b85f4f07a9b63be329ad1fe95b36d24900;hp=5ae0d8a6a4985500e168ab0e529b8642f0cba554;hpb=53569322d40ed45abe0368ddb08eb4a2738afc37;p=lttng-ust.git diff --git a/include/lttng/ringbuffer-config.h b/include/lttng/ringbuffer-config.h index 5ae0d8a6..8752e369 100644 --- a/include/lttng/ringbuffer-config.h +++ b/include/lttng/ringbuffer-config.h @@ -57,7 +57,8 @@ struct lttng_ust_lib_ring_buffer_client_cb { size_t (*record_header_size) (const struct lttng_ust_lib_ring_buffer_config *config, struct channel *chan, size_t offset, size_t *pre_header_padding, - struct lttng_ust_lib_ring_buffer_ctx *ctx); + struct lttng_ust_lib_ring_buffer_ctx *ctx, + void *client_ctx); /* Slow path only, at subbuffer switch */ size_t (*subbuffer_header_size) (void); @@ -256,10 +257,22 @@ struct lttng_ust_lib_ring_buffer_ctx { */ uint64_t tsc; /* time-stamp counter value */ unsigned int rflags; /* reservation flags */ - unsigned int padding1; /* padding to realign on pointer */ + /* + * The field ctx_len is the length of struct + * lttng_ust_lib_ring_buffer_ctx as known by the user of + * lib_ring_buffer_ctx_init. + */ + unsigned int ctx_len; void *ip; /* caller ip address */ void *priv2; /* 2nd priv data */ char padding2[LTTNG_UST_RING_BUFFER_CTX_PADDING]; + /* + * This is the end of the initial fields expected by the original ABI + * between probes and UST. Only the fields above can be used if + * ctx_len is 0. Use the value of ctx_len to find out which of the + * following fields may be used. + */ + struct lttng_ust_lib_ring_buffer_backend_pages *backend_pages; }; /** @@ -291,7 +304,7 @@ void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, ctx->cpu = cpu; ctx->rflags = 0; ctx->handle = handle; - ctx->padding1 = 0; + ctx->ctx_len = sizeof(struct lttng_ust_lib_ring_buffer_ctx); ctx->ip = 0; ctx->priv2 = priv2; memset(ctx->padding2, 0, LTTNG_UST_RING_BUFFER_CTX_PADDING); @@ -333,7 +346,7 @@ unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type); static inline unsigned int lib_ring_buffer_align(size_t align_drift, size_t size_of_type) { - return offset_align(align_drift, size_of_type); + return lttng_ust_offset_align(align_drift, size_of_type); } #else