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:
{
case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
case LTTNG_KERNEL_ABI_UPROBE:
{
- struct lttng_event *event;
+ struct lttng_kernel_event_recorder *event;
/*
* We tolerate no failure path after event creation. It
* will stay invariant for the rest of the session.
*/
- event = lttng_event_create(channel, event_param,
- NULL, NULL,
- event_param->instrumentation);
+ event = lttng_kernel_event_recorder_create(channel, event_param,
+ NULL, event_param->instrumentation);
WARN_ON_ONCE(!event);
if (IS_ERR(event)) {
ret = PTR_ERR(event);
static
long lttng_event_notifier_event_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
- struct lttng_event_notifier *event_notifier = file->private_data;
+ struct lttng_kernel_event_notifier *event_notifier = file->private_data;
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;
static
int lttng_event_notifier_event_release(struct inode *inode, struct file *file)
{
- struct lttng_event_notifier *event_notifier = file->private_data;
+ struct lttng_kernel_event_notifier *event_notifier = file->private_data;
if (event_notifier)
- fput(event_notifier->group->file);
+ fput(event_notifier->priv->group->file);
return 0;
}
case LTTNG_KERNEL_ABI_KRETPROBE: /* Fall-through */
case LTTNG_KERNEL_ABI_UPROBE:
{
- struct lttng_event_notifier *event_notifier;
+ struct lttng_kernel_event_notifier *event_notifier;
/*
* We tolerate no failure path after event notifier creation.
event_notifier_param->event.token,
event_notifier_param->error_counter_index,
event_notifier_group,
- event_notifier_param, NULL,
+ event_notifier_param,
event_notifier_param->event.instrumentation);
WARN_ON_ONCE(!event_notifier);
if (IS_ERR(event_notifier)) {
static
long lttng_event_recorder_event_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
{
- struct lttng_event *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;
static
int lttng_event_recorder_event_release(struct inode *inode, struct file *file)
{
- struct lttng_event *event = file->private_data;
+ struct lttng_kernel_event_recorder *event = file->private_data;
if (event)
fput(event->chan->file);