stream_fds, nr_stream_fds, blocking_timeout);
if (!handle)
goto error;
- lttng_chan_buf->handle = handle;
lttng_chan_buf->chan = shmp(handle, handle->chan);
return lttng_chan_buf;
static
void lttng_channel_destroy(struct lttng_ust_channel_buffer *lttng_chan_buf)
{
- channel_destroy(lttng_chan_buf->chan, lttng_chan_buf->handle, 1);
+ channel_destroy(lttng_chan_buf->chan, lttng_chan_buf->chan->handle, 1);
lttng_ust_free_channel_common(lttng_chan_buf->parent);
}
struct lttng_ust_stack_ctx *lttng_ctx = ctx->priv;
struct lttng_ust_event_recorder *event_recorder = lttng_ctx->event_recorder;
struct lttng_client_ctx client_ctx;
- int ret, cpu;
+ int ret;
client_ctx.chan_ctx = lttng_ust_rcu_dereference(lttng_chan->priv->ctx);
client_ctx.event_ctx = lttng_ust_rcu_dereference(event_recorder->priv->ctx);
ctx_get_struct_size(client_ctx.event_ctx, &client_ctx.event_context_len,
APP_CTX_ENABLED);
- cpu = lib_ring_buffer_get_cpu(&client_config);
- if (cpu < 0)
+ if (lib_ring_buffer_nesting_inc(&client_config) < 0)
return -EPERM;
- ctx->cpu = cpu;
switch (lttng_chan->priv->header_type) {
case 1: /* compact */
lttng_write_event_header(&client_config, ctx, &client_ctx, event_id);
return 0;
put:
- lib_ring_buffer_put_cpu(&client_config);
+ lib_ring_buffer_nesting_dec(&client_config);
return ret;
}
void lttng_event_commit(struct lttng_ust_lib_ring_buffer_ctx *ctx)
{
lib_ring_buffer_commit(&client_config, ctx);
- lib_ring_buffer_put_cpu(&client_config);
+ lib_ring_buffer_nesting_dec(&client_config);
}
static
}
static
-void lttng_event_strcpy_pad(struct lttng_ust_lib_ring_buffer_ctx *ctx,
+void lttng_event_pstrcpy_pad(struct lttng_ust_lib_ring_buffer_ctx *ctx,
const char *src, size_t len)
{
- lib_ring_buffer_strcpy(&client_config, ctx, src, len, '\0');
+ lib_ring_buffer_pstrcpy(&client_config, ctx, src, len, '\0');
}
#if 0
.event_commit = lttng_event_commit,
.event_write = lttng_event_write,
.event_strcpy = lttng_event_strcpy,
- .event_strcpy_pad = lttng_event_strcpy_pad,
+ .event_pstrcpy_pad = lttng_event_pstrcpy_pad,
},
.client_config = &client_config,
};