struct lttng_kernel_abi_channel chan_param;
struct lttng_kernel_abi_old_channel old_chan_param;
+ /*
+ * Handle backward compatibility. OLD commands have wrong
+ * directions, replace them by the correct direction.
+ */
+ switch (cmd) {
+ case LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_PID:
+ cmd = LTTNG_KERNEL_ABI_SESSION_TRACK_PID;
+ break;
+ case LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_PID:
+ cmd = LTTNG_KERNEL_ABI_SESSION_UNTRACK_PID;
+ break;
+ case LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_ID:
+ cmd = LTTNG_KERNEL_ABI_SESSION_TRACK_ID;
+ break;
+ case LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_ID:
+ cmd = LTTNG_KERNEL_ABI_SESSION_UNTRACK_ID;
+ break;
+ case LTTNG_KERNEL_ABI_OLD_SESSION_LIST_TRACKER_IDS:
+ cmd = LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_IDS;
+ break;
+ case LTTNG_KERNEL_ABI_OLD_SESSION_SET_NAME:
+ cmd = LTTNG_KERNEL_ABI_SESSION_SET_NAME;
+ break;
+ case LTTNG_KERNEL_ABI_OLD_SESSION_SET_CREATION_TIME:
+ cmd = LTTNG_KERNEL_ABI_SESSION_SET_CREATION_TIME;
+ break;
+ default:
+ /* Nothing to do. */
+ break;
+ }
+
switch (cmd) {
case LTTNG_KERNEL_ABI_OLD_CHANNEL:
{
int ret;
void *stream_priv;
- buf = channel->ops->buffer_read_open(channel->chan);
+ buf = channel->ops->priv->buffer_read_open(channel->chan);
if (!buf)
return -ENOENT;
return ret;
fd_error:
- channel->ops->buffer_read_close(buf);
+ channel->ops->priv->buffer_read_close(buf);
return ret;
}
struct lttng_metadata_stream *metadata_stream;
void *stream_priv;
- buf = channel->ops->buffer_read_open(channel->chan);
+ buf = channel->ops->priv->buffer_read_open(channel->chan);
if (!buf)
return -ENOENT;
notransport:
kfree(metadata_stream);
nomem:
- channel->ops->buffer_read_close(buf);
+ channel->ops->priv->buffer_read_close(buf);
return ret;
}
int ret;
void *stream_priv;
- buf = event_notifier_group->ops->buffer_read_open(chan);
+ buf = event_notifier_group->ops->priv->buffer_read_open(chan);
if (!buf)
return -ENOENT;
fd_error:
atomic_long_dec(¬if_file->f_count);
refcount_error:
- event_notifier_group->ops->buffer_read_close(buf);
+ event_notifier_group->ops->priv->buffer_read_close(buf);
return ret;
}
switch (cmd) {
case LTTNG_KERNEL_ABI_ENABLE:
- return lttng_event_notifier_enable(event_notifier);
+ return lttng_event_enable(&event_notifier->parent);
case LTTNG_KERNEL_ABI_DISABLE:
- return lttng_event_notifier_disable(event_notifier);
+ return lttng_event_disable(&event_notifier->parent);
case LTTNG_KERNEL_ABI_FILTER:
return -EINVAL;
case LTTNG_KERNEL_ABI_CAPTURE:
return -EINVAL;
case LTTNG_KERNEL_ABI_ADD_CALLSITE:
- return lttng_event_notifier_add_callsite(event_notifier,
+ return lttng_event_add_callsite(&event_notifier->parent,
(struct lttng_kernel_abi_event_callsite __user *) arg);
default:
return -ENOIOCTLCMD;
if (file->f_mode & FMODE_READ) {
poll_wait_set_exclusive(wait);
- poll_wait(file, channel->ops->get_hp_wait_queue(channel->chan),
+ poll_wait(file, channel->ops->priv->get_hp_wait_queue(channel->chan),
wait);
- if (channel->ops->is_disabled(channel->chan))
+ if (channel->ops->priv->is_disabled(channel->chan))
return POLLERR;
- if (channel->ops->is_finalized(channel->chan))
+ if (channel->ops->priv->is_finalized(channel->chan))
return POLLHUP;
- if (channel->ops->buffer_has_read_closed_stream(channel->chan))
+ if (channel->ops->priv->buffer_has_read_closed_stream(channel->chan))
return POLLIN | POLLRDNORM;
return 0;
}
static
long lttng_event_recorder_event_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
- struct lttng_kernel_event_recorder *event = file->private_data;
+ struct lttng_kernel_event_recorder *event_recorder = file->private_data;
switch (cmd) {
case LTTNG_KERNEL_ABI_OLD_CONTEXT:
}
case LTTNG_KERNEL_ABI_OLD_ENABLE:
case LTTNG_KERNEL_ABI_ENABLE:
- return lttng_event_enable(event);
+ return lttng_event_enable(&event_recorder->parent);
case LTTNG_KERNEL_ABI_OLD_DISABLE:
case LTTNG_KERNEL_ABI_DISABLE:
- return lttng_event_disable(event);
+ return lttng_event_disable(&event_recorder->parent);
case LTTNG_KERNEL_ABI_FILTER:
return -EINVAL;
case LTTNG_KERNEL_ABI_ADD_CALLSITE:
- return lttng_event_add_callsite(event,
+ return lttng_event_add_callsite(&event_recorder->parent,
(struct lttng_kernel_abi_event_callsite __user *) arg);
default:
return -ENOIOCTLCMD;
struct lib_ring_buffer *buf = filp->private_data;
struct channel *chan = buf->backend.chan;
const struct lib_ring_buffer_config *config = &chan->backend.config;
- const struct lttng_channel_ops *ops = chan->backend.priv_ops;
+ const struct lttng_kernel_channel_buffer_ops *ops = chan->backend.priv_ops;
int ret;
if (atomic_read(&chan->record_disabled))
{
uint64_t ts;
- ret = ops->timestamp_begin(config, buf, &ts);
+ ret = ops->priv->timestamp_begin(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
{
uint64_t ts;
- ret = ops->timestamp_end(config, buf, &ts);
+ ret = ops->priv->timestamp_end(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
{
uint64_t ed;
- ret = ops->events_discarded(config, buf, &ed);
+ ret = ops->priv->events_discarded(config, buf, &ed);
if (ret < 0)
goto error;
return put_u64(ed, arg);
{
uint64_t cs;
- ret = ops->content_size(config, buf, &cs);
+ ret = ops->priv->content_size(config, buf, &cs);
if (ret < 0)
goto error;
return put_u64(cs, arg);
{
uint64_t ps;
- ret = ops->packet_size(config, buf, &ps);
+ ret = ops->priv->packet_size(config, buf, &ps);
if (ret < 0)
goto error;
return put_u64(ps, arg);
{
uint64_t si;
- ret = ops->stream_id(config, buf, &si);
+ ret = ops->priv->stream_id(config, buf, &si);
if (ret < 0)
goto error;
return put_u64(si, arg);
{
uint64_t ts;
- ret = ops->current_timestamp(config, buf, &ts);
+ ret = ops->priv->current_timestamp(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
{
uint64_t seq;
- ret = ops->sequence_number(config, buf, &seq);
+ ret = ops->priv->sequence_number(config, buf, &seq);
if (ret < 0)
goto error;
return put_u64(seq, arg);
{
uint64_t id;
- ret = ops->instance_id(config, buf, &id);
+ ret = ops->priv->instance_id(config, buf, &id);
if (ret < 0)
goto error;
return put_u64(id, 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;
- const struct lttng_channel_ops *ops = chan->backend.priv_ops;
+ const struct lttng_kernel_channel_buffer_ops *ops = chan->backend.priv_ops;
int ret;
if (atomic_read(&chan->record_disabled))
{
uint64_t ts;
- ret = ops->timestamp_begin(config, buf, &ts);
+ ret = ops->priv->timestamp_begin(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
{
uint64_t ts;
- ret = ops->timestamp_end(config, buf, &ts);
+ ret = ops->priv->timestamp_end(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
{
uint64_t ed;
- ret = ops->events_discarded(config, buf, &ed);
+ ret = ops->priv->events_discarded(config, buf, &ed);
if (ret < 0)
goto error;
return put_u64(ed, arg);
{
uint64_t cs;
- ret = ops->content_size(config, buf, &cs);
+ ret = ops->priv->content_size(config, buf, &cs);
if (ret < 0)
goto error;
return put_u64(cs, arg);
{
uint64_t ps;
- ret = ops->packet_size(config, buf, &ps);
+ ret = ops->priv->packet_size(config, buf, &ps);
if (ret < 0)
goto error;
return put_u64(ps, arg);
{
uint64_t si;
- ret = ops->stream_id(config, buf, &si);
+ ret = ops->priv->stream_id(config, buf, &si);
if (ret < 0)
goto error;
return put_u64(si, arg);
{
uint64_t ts;
- ret = ops->current_timestamp(config, buf, &ts);
+ ret = ops->priv->current_timestamp(config, buf, &ts);
if (ret < 0)
goto error;
return put_u64(ts, arg);
{
uint64_t seq;
- ret = ops->sequence_number(config, buf, &seq);
+ ret = ops->priv->sequence_number(config, buf, &seq);
if (ret < 0)
goto error;
return put_u64(seq, arg);
{
uint64_t id;
- ret = ops->instance_id(config, buf, &id);
+ ret = ops->priv->instance_id(config, buf, &id);
if (ret < 0)
goto error;
return put_u64(id, arg);