X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=include%2Flttng%2Fringbuffer-config.h;h=5ae0d8a6a4985500e168ab0e529b8642f0cba554;hb=152ba2822ce0dc11947169d2fffe6e0a26a02573;hp=9de9a73807ca634e4795bf70e39e44e5e0f9bf11;hpb=82b9bde830eff824adf7762afb7cb05c39bc83e3;p=lttng-ust.git diff --git a/include/lttng/ringbuffer-config.h b/include/lttng/ringbuffer-config.h index 9de9a738..5ae0d8a6 100644 --- a/include/lttng/ringbuffer-config.h +++ b/include/lttng/ringbuffer-config.h @@ -92,6 +92,13 @@ struct lttng_ust_lib_ring_buffer_client_cb { size_t offset, size_t *header_len, size_t *payload_len, uint64_t *timestamp, struct lttng_ust_shm_handle *handle); + /* + * Offset and size of content size field in client. + */ + void (*content_size_field) (const struct lttng_ust_lib_ring_buffer_config *config, + size_t *offset, size_t *length); + void (*packet_size_field) (const struct lttng_ust_lib_ring_buffer_config *config, + size_t *offset, size_t *length); }; /* @@ -146,8 +153,8 @@ enum lttng_ust_lib_ring_buffer_sync_types { }; enum lttng_ust_lib_ring_buffer_mode_types { - RING_BUFFER_OVERWRITE, /* Overwrite when buffer full */ - RING_BUFFER_DISCARD, /* Discard when buffer full */ + RING_BUFFER_OVERWRITE = 0, /* Overwrite when buffer full */ + RING_BUFFER_DISCARD = 1, /* Discard when buffer full */ }; enum lttng_ust_lib_ring_buffer_output_types { @@ -221,7 +228,7 @@ struct lttng_ust_lib_ring_buffer_config { * removed. */ #define LTTNG_UST_RING_BUFFER_CTX_PADDING \ - (24 - sizeof(int) - sizeof(void *)) + (24 - sizeof(int) - sizeof(void *) - sizeof(void *)) struct lttng_ust_lib_ring_buffer_ctx { /* input received by lib_ring_buffer_reserve(), saved here. */ struct channel *chan; /* channel */ @@ -251,6 +258,7 @@ struct lttng_ust_lib_ring_buffer_ctx { unsigned int rflags; /* reservation flags */ unsigned int padding1; /* padding to realign on pointer */ void *ip; /* caller ip address */ + void *priv2; /* 2nd priv data */ char padding2[LTTNG_UST_RING_BUFFER_CTX_PADDING]; }; @@ -267,12 +275,14 @@ static inline lttng_ust_notrace void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, struct channel *chan, void *priv, size_t data_size, int largest_align, - int cpu, struct lttng_ust_shm_handle *handle); + int cpu, struct lttng_ust_shm_handle *handle, + void *priv2); static inline void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, struct channel *chan, void *priv, size_t data_size, int largest_align, - int cpu, struct lttng_ust_shm_handle *handle) + int cpu, struct lttng_ust_shm_handle *handle, + void *priv2) { ctx->chan = chan; ctx->priv = priv; @@ -283,6 +293,7 @@ void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx, ctx->handle = handle; ctx->padding1 = 0; ctx->ip = 0; + ctx->priv2 = priv2; memset(ctx->padding2, 0, LTTNG_UST_RING_BUFFER_CTX_PADDING); }