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);
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);
};
/*
* RING_BUFFER_WAKEUP_NONE does not perform any wakeup whatsoever. The client
* has the responsibility to perform wakeups.
*/
-#define LTTNG_UST_RING_BUFFER_CONFIG_PADDING 32
+#define LTTNG_UST_RING_BUFFER_CONFIG_PADDING 20
enum lttng_ust_lib_ring_buffer_alloc_types {
RING_BUFFER_ALLOC_PER_CPU,
};
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 {
* callbacks and update the cb pointers.
*/
int client_type;
+ int _unused1;
+ const struct lttng_ust_lib_ring_buffer_client_cb *cb_ptr;
char padding[LTTNG_UST_RING_BUFFER_CONFIG_PADDING];
};
* UST. Fields need to be only added at the end, never reordered, never
* removed.
*/
-#define LTTNG_UST_RING_BUFFER_CTX_PADDING 24
+#define LTTNG_UST_RING_BUFFER_CTX_PADDING \
+ (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 */
*/
uint64_t tsc; /* time-stamp counter value */
unsigned int rflags; /* reservation flags */
- char padding[LTTNG_UST_RING_BUFFER_CTX_PADDING];
+ /*
+ * 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;
};
/**
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;
ctx->cpu = cpu;
ctx->rflags = 0;
ctx->handle = handle;
- memset(ctx->padding, 0, LTTNG_UST_RING_BUFFER_CTX_PADDING);
+ 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);
}
/*