#define LTTNG_KERNEL_ABI_SESSION_START _IO(0xF6, 0x56)
#define LTTNG_KERNEL_ABI_SESSION_STOP _IO(0xF6, 0x57)
#define LTTNG_KERNEL_ABI_SESSION_TRACK_PID \
- _IOR(0xF6, 0x58, int32_t)
+ _IOW(0xF6, 0x58, int32_t)
#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_PID \
- _IOR(0xF6, 0x59, int32_t)
+ _IOW(0xF6, 0x59, int32_t)
/*
* ioctl 0x58 and 0x59 are duplicated here. It works, since _IOR vs _IO
/* lttng/abi-old.h reserve 0x5A and 0x5B. */
#define LTTNG_KERNEL_ABI_SESSION_STATEDUMP _IO(0xF6, 0x5C)
#define LTTNG_KERNEL_ABI_SESSION_SET_NAME \
- _IOR(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
+ _IOW(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
#define LTTNG_KERNEL_ABI_SESSION_SET_CREATION_TIME \
- _IOR(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
+ _IOW(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
/* Channel FD ioctl */
/* lttng/abi-old.h reserve 0x60 and 0x61. */
/* Session FD ioctl (continued) */
#define LTTNG_KERNEL_ABI_SESSION_LIST_TRACKER_IDS \
- _IOR(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
+ _IOW(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
#define LTTNG_KERNEL_ABI_SESSION_TRACK_ID \
- _IOR(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
+ _IOW(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
#define LTTNG_KERNEL_ABI_SESSION_UNTRACK_ID \
- _IOR(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
+ _IOW(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
/* Event notifier group file descriptor ioctl */
#define LTTNG_KERNEL_ABI_EVENT_NOTIFIER_CREATE \
/* returns the stream instance id (invariant for the stream) */
#define LTTNG_KERNEL_ABI_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t)
+/*
+ * Those ioctl numbers use the wrong direction, but are kept for ABI backward
+ * compatibility.
+ */
+#define LTTNG_KERNEL_ABI_OLD_SESSION_SET_NAME \
+ _IOR(0xF6, 0x5D, struct lttng_kernel_abi_session_name)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_SET_CREATION_TIME \
+ _IOR(0xF6, 0x5E, struct lttng_kernel_abi_session_creation_time)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_PID \
+ _IOR(0xF6, 0x58, int32_t)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_PID \
+ _IOR(0xF6, 0x59, int32_t)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_LIST_TRACKER_IDS \
+ _IOR(0xF6, 0xA0, struct lttng_kernel_abi_tracker_args)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_TRACK_ID \
+ _IOR(0xF6, 0xA1, struct lttng_kernel_abi_tracker_args)
+#define LTTNG_KERNEL_ABI_OLD_SESSION_UNTRACK_ID \
+ _IOR(0xF6, 0xA2, struct lttng_kernel_abi_tracker_args)
+
#ifdef CONFIG_COMPAT
/* returns the timestamp begin of the current sub-buffer */
#define LTTNG_KERNEL_ABI_RING_BUFFER_COMPAT_GET_TIMESTAMP_BEGIN \
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:
{