return ret;
}
+static
+int lttng_abi_session_set_name(struct lttng_session *session,
+ struct lttng_kernel_session_name *name)
+{
+ size_t len;
+
+ len = strnlen(name->name, LTTNG_KERNEL_SESSION_NAME_LEN);
+
+ if (len == LTTNG_KERNEL_SESSION_NAME_LEN) {
+ /* Name is too long/malformed */
+ return -EINVAL;
+ }
+
+ strcpy(session->name, name->name);
+ return 0;
+}
+
/**
* lttng_session_ioctl - lttng session fd ioctl
*
return lttng_session_metadata_regenerate(session);
case LTTNG_KERNEL_SESSION_STATEDUMP:
return lttng_session_statedump(session);
+ case LTTNG_KERNEL_SESSION_SET_NAME:
+ {
+ struct lttng_kernel_session_name name;
+
+ if (copy_from_user(&name,
+ (struct lttng_kernel_session_name __user *) arg,
+ sizeof(struct lttng_kernel_session_name)))
+ return -EFAULT;
+ return lttng_abi_session_set_name(session, &name);
+ }
default:
return -ENOIOCTLCMD;
}
* should be increased when an incompatible ABI change is done.
*/
#define LTTNG_MODULES_ABI_MAJOR_VERSION 2
-#define LTTNG_MODULES_ABI_MINOR_VERSION 3
+#define LTTNG_MODULES_ABI_MINOR_VERSION 4
#define LTTNG_KERNEL_SYM_NAME_LEN 256
+#define LTTNG_KERNEL_SESSION_NAME_LEN 256
enum lttng_kernel_instrumentation {
LTTNG_KERNEL_TRACEPOINT = 0,
uint32_t minor;
} __attribute__((packed));
+struct lttng_kernel_session_name {
+ char name[LTTNG_KERNEL_SESSION_NAME_LEN];
+} __attribute__((packed));
+
enum lttng_kernel_calibrate_type {
LTTNG_KERNEL_CALIBRATE_KRETPROBE,
};
*/
#define LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS _IO(0xF6, 0x58)
#define LTTNG_KERNEL_SESSION_METADATA_REGEN _IO(0xF6, 0x59)
+
/* 0x5A and 0x5B are reserved for a future ABI-breaking cleanup. */
#define LTTNG_KERNEL_SESSION_STATEDUMP _IO(0xF6, 0x5C)
+#define LTTNG_KERNEL_SESSION_SET_NAME \
+ _IOR(0xF6, 0x5D, struct lttng_kernel_session_name)
/* Channel FD ioctl */
#define LTTNG_KERNEL_STREAM _IO(0xF6, 0x62)
struct list_head enablers_head;
/* Hash table of events */
struct lttng_event_ht events_ht;
+ char name[LTTNG_KERNEL_SESSION_NAME_LEN];
};
struct lttng_metadata_cache {