The ring buffer handle is available in the struct lttng_ust_lib_ring_buffer_channel,
therefore passing it through the ring buffer context is redundant.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I7baca38b86743ba88a55b9d336135df2256756d1
/* input received by lib_ring_buffer_reserve(), saved here. */
struct lttng_ust_lib_ring_buffer_channel *chan; /* channel */
void *priv; /* client private data */
- struct lttng_ust_shm_handle *handle; /* shared-memory handle */
size_t data_size; /* size of payload */
int largest_align; /*
* alignment of the largest element
static inline lttng_ust_notrace
void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_ust_lib_ring_buffer_channel *chan,
- void *priv, size_t data_size, int largest_align,
- struct lttng_ust_shm_handle *handle);
+ void *priv, size_t data_size, int largest_align);
static inline
void lib_ring_buffer_ctx_init(struct lttng_ust_lib_ring_buffer_ctx *ctx,
struct lttng_ust_lib_ring_buffer_channel *chan,
- void *priv, size_t data_size, int largest_align,
- struct lttng_ust_shm_handle *handle)
+ void *priv, size_t data_size, int largest_align)
{
ctx->struct_size = sizeof(struct lttng_ust_lib_ring_buffer_ctx);
ctx->chan = chan;
ctx->reserve_cpu = -1;
ctx->largest_align = largest_align;
ctx->rflags = 0;
- ctx->handle = handle;
ctx->ip = 0;
}
__lttng_ctx.struct_size = sizeof(struct lttng_ust_stack_ctx); \
__lttng_ctx.event_recorder = __event_recorder; \
lib_ring_buffer_ctx_init(&__ctx, __chan->chan, &__lttng_ctx, __event_len, \
- __event_align, __chan->handle); \
+ __event_align); \
__ctx.ip = _TP_IP_PARAM(TP_IP_PARAM); \
__ret = __chan->ops->event_reserve(&__ctx, __event_recorder->id); \
if (__ret < 0) \
reserve_len = min_t(size_t,
lttng_chan_buf->ops->priv->packet_avail_size(lttng_chan_buf->chan, lttng_chan_buf->handle),
len - pos);
- lib_ring_buffer_ctx_init(&ctx, lttng_chan_buf->chan, NULL, reserve_len,
- sizeof(char), lttng_chan_buf->handle);
+ lib_ring_buffer_ctx_init(&ctx, lttng_chan_buf->chan, NULL, reserve_len, sizeof(char));
/*
* We don't care about metadata buffer's records lost
* count, because we always retry here. Report error if
reserve_len = min_t(ssize_t,
lttng_chan_buf->ops->priv->packet_avail_size(lttng_chan_buf->chan, lttng_chan_buf->handle),
len);
- lib_ring_buffer_ctx_init(&ctx, lttng_chan_buf->chan, NULL, reserve_len,
- sizeof(char), lttng_chan_buf->handle);
+ lib_ring_buffer_ctx_init(&ctx, lttng_chan_buf->chan, NULL, reserve_len, sizeof(char));
ret = lttng_chan_buf->ops->event_reserve(&ctx, 0);
if (ret != 0) {
DBG("LTTng: event reservation failed");
const void *src, size_t len)
{
struct channel_backend *chanb = &ctx->chan->backend;
- struct lttng_ust_shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->chan->handle;
size_t offset = ctx->buf_offset;
struct lttng_ust_lib_ring_buffer_backend_pages *backend_pages;
void *p;
const char *src, size_t len, char pad)
{
struct channel_backend *chanb = &ctx->chan->backend;
- struct lttng_ust_shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->chan->handle;
size_t count;
size_t offset = ctx->buf_offset;
struct lttng_ust_lib_ring_buffer_backend_pages *backend_pages;
const char *src, size_t len, char pad)
{
struct channel_backend *chanb = &ctx->chan->backend;
- struct lttng_ust_shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->chan->handle;
size_t count;
size_t offset = ctx->buf_offset;
struct lttng_ust_lib_ring_buffer_backend_pages *backend_pages;
{
struct lttng_ust_lib_ring_buffer_backend *bufb = &ctx->buf->backend;
struct channel_backend *chanb = &ctx->chan->backend;
- struct lttng_ust_shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->chan->handle;
size_t sbidx;
size_t offset = ctx->buf_offset;
struct lttng_ust_lib_ring_buffer_backend_subbuffer *wsb;
void *client_ctx)
{
struct lttng_ust_lib_ring_buffer_channel *chan = ctx->chan;
- struct lttng_ust_shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->chan->handle;
struct lttng_ust_lib_ring_buffer *buf;
unsigned long o_begin, o_end, o_old;
size_t before_hdr_pad = 0;
const struct lttng_ust_lib_ring_buffer_ctx *ctx)
{
struct lttng_ust_lib_ring_buffer_channel *chan = ctx->chan;
- struct lttng_ust_shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->chan->handle;
struct lttng_ust_lib_ring_buffer *buf = ctx->buf;
unsigned long offset_end = ctx->buf_offset;
unsigned long endidx = subbuf_index(offset_end - 1, chan);
void *client_ctx)
{
const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config;
- struct lttng_ust_shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->chan->handle;
unsigned long reserve_commit_diff, offset_cmp;
int timeout_left_ms = lttng_ust_ringbuffer_get_timeout(chan);
void *client_ctx)
{
struct lttng_ust_lib_ring_buffer_channel *chan = ctx->chan;
- struct lttng_ust_shm_handle *handle = ctx->handle;
+ struct lttng_ust_shm_handle *handle = ctx->chan->handle;
const struct lttng_ust_lib_ring_buffer_config *config = &chan->backend.config;
struct lttng_ust_lib_ring_buffer *buf;
struct switch_offsets offsets;