X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Flttng-abi.c;h=6829c239cc991c4a9d85016843b37b7d588dc8a9;hb=17f90b04459c851547b2dc6e90e3bded1b1206d5;hp=e06a98b478075e8790236d0cb6ec63b11f221ce1;hpb=a67ba386d82d85c6b6ca56c249a13ab5a1f34b08;p=lttng-modules.git diff --git a/src/lttng-abi.c b/src/lttng-abi.c index e06a98b4..6829c239 100644 --- a/src/lttng-abi.c +++ b/src/lttng-abi.c @@ -793,6 +793,37 @@ long lttng_session_ioctl(struct file *file, unsigned int cmd, unsigned long arg) 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: { @@ -1904,15 +1935,15 @@ long lttng_event_notifier_event_ioctl(struct file *file, unsigned int cmd, unsig 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; @@ -2582,7 +2613,7 @@ static const struct file_operations lttng_metadata_fops = { 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: @@ -2597,14 +2628,14 @@ long lttng_event_recorder_event_ioctl(struct file *file, unsigned int cmd, unsig } 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;