struct lib_ring_buffer *buf = filp->private_data;
struct channel *chan = buf->backend.chan;
const struct lib_ring_buffer_config *config = &chan->backend.config;
- struct lttng_channel *lttng_chan = channel_get_private(chan);
+ const struct lttng_channel_ops *ops = chan->backend.priv_ops;
int ret;
if (atomic_read(&chan->record_disabled))
{
uint64_t ts;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->timestamp_begin(config, buf, &ts);
+ ret = ops->timestamp_begin(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
{
uint64_t ts;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->timestamp_end(config, buf, &ts);
+ ret = ops->timestamp_end(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
{
uint64_t ed;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->events_discarded(config, buf, &ed);
+ ret = ops->events_discarded(config, buf, &ed);
if (ret < 0)
goto error;
return put_u64(ed, arg);
{
uint64_t cs;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->content_size(config, buf, &cs);
+ ret = ops->content_size(config, buf, &cs);
if (ret < 0)
goto error;
return put_u64(cs, arg);
{
uint64_t ps;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->packet_size(config, buf, &ps);
+ ret = ops->packet_size(config, buf, &ps);
if (ret < 0)
goto error;
return put_u64(ps, arg);
{
uint64_t si;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->stream_id(config, buf, &si);
+ ret = ops->stream_id(config, buf, &si);
if (ret < 0)
goto error;
return put_u64(si, arg);
{
uint64_t ts;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->current_timestamp(config, buf, &ts);
+ ret = ops->current_timestamp(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
struct lib_ring_buffer *buf = filp->private_data;
struct channel *chan = buf->backend.chan;
const struct lib_ring_buffer_config *config = &chan->backend.config;
- struct lttng_channel *lttng_chan = channel_get_private(chan);
+ const struct lttng_channel_ops *ops = chan->backend.priv_ops;
int ret;
if (atomic_read(&chan->record_disabled))
{
uint64_t ts;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->timestamp_begin(config, buf, &ts);
+ ret = ops->timestamp_begin(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
{
uint64_t ts;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->timestamp_end(config, buf, &ts);
+ ret = ops->timestamp_end(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
{
uint64_t ed;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->events_discarded(config, buf, &ed);
+ ret = ops->events_discarded(config, buf, &ed);
if (ret < 0)
goto error;
return put_u64(ed, arg);
{
uint64_t cs;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->content_size(config, buf, &cs);
+ ret = ops->content_size(config, buf, &cs);
if (ret < 0)
goto error;
return put_u64(cs, arg);
{
uint64_t ps;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->packet_size(config, buf, &ps);
+ ret = ops->packet_size(config, buf, &ps);
if (ret < 0)
goto error;
return put_u64(ps, arg);
{
uint64_t si;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->stream_id(config, buf, &si);
+ ret = ops->stream_id(config, buf, &si);
if (ret < 0)
goto error;
return put_u64(si, arg);
{
uint64_t ts;
- if (!lttng_chan->ops)
- goto error;
- ret = lttng_chan->ops->current_timestamp(config, buf, &ts);
+ ret = ops->current_timestamp(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
return ret;
}
-void __exit lttng_abi_exit(void)
+/* No __exit annotation because used by init error path too. */
+void lttng_abi_exit(void)
{
if (lttng_proc_dentry)
remove_proc_entry("lttng", NULL);