case LTTNG_KERNEL_WAIT_QUIESCENT:
synchronize_trace();
return 0;
+ case LTTNG_KERNEL_CALIBRATE:
+ {
+ struct lttng_kernel_calibrate __user *ucalibrate =
+ (struct lttng_kernel_calibrate __user *) arg;
+ struct lttng_kernel_calibrate calibrate;
+ int ret;
+
+ if (copy_from_user(&calibrate, ucalibrate, sizeof(calibrate)))
+ return -EFAULT;
+ ret = lttng_calibrate(&calibrate);
+ if (copy_to_user(ucalibrate, &calibrate, sizeof(calibrate)))
+ return -EFAULT;
+ return ret;
+ }
default:
return -ENOIOCTLCMD;
}
return -EFAULT;
event_param.name[LTTNG_SYM_NAME_LEN - 1] = '\0';
switch (event_param.instrumentation) {
+ case LTTNG_KERNEL_KRETPROBE:
+ event_param.u.kretprobe.symbol_name[LTTNG_SYM_NAME_LEN - 1] = '\0';
+ break;
case LTTNG_KERNEL_KPROBE:
event_param.u.kprobe.symbol_name[LTTNG_SYM_NAME_LEN - 1] = '\0';
break;
default:
break;
}
- event_fd = get_unused_fd();
- if (event_fd < 0) {
- ret = event_fd;
- goto fd_error;
- }
- event_file = anon_inode_getfile("[lttng_event]",
- <tng_event_fops,
- NULL, O_RDWR);
- if (IS_ERR(event_file)) {
- ret = PTR_ERR(event_file);
- goto file_error;
- }
- /*
- * We tolerate no failure path after event creation. It will stay
- * invariant for the rest of the session.
- */
- event = ltt_event_create(channel, &event_param, NULL);
- if (!event) {
- ret = -EINVAL;
- goto event_error;
+ switch (event_param.instrumentation) {
+ default:
+ event_fd = get_unused_fd();
+ if (event_fd < 0) {
+ ret = event_fd;
+ goto fd_error;
+ }
+ event_file = anon_inode_getfile("[lttng_event]",
+ <tng_event_fops,
+ NULL, O_RDWR);
+ if (IS_ERR(event_file)) {
+ ret = PTR_ERR(event_file);
+ goto file_error;
+ }
+ /*
+ * We tolerate no failure path after event creation. It
+ * will stay invariant for the rest of the session.
+ */
+ event = ltt_event_create(channel, &event_param, NULL);
+ if (!event) {
+ ret = -EINVAL;
+ goto event_error;
+ }
+ event_file->private_data = event;
+ fd_install(event_fd, event_file);
+ /* The event holds a reference on the channel */
+ atomic_long_inc(&channel_file->f_count);
+ break;
+ case LTTNG_KERNEL_SYSCALLS:
+ ret = lttng_syscalls_register(channel, NULL);
+ if (ret)
+ goto fd_error;
+ event_fd = 0;
+ break;
}
- event_file->private_data = event;
- fd_install(event_fd, event_file);
- /* The event holds a reference on the channel */
- atomic_long_inc(&channel_file->f_count);
return event_fd;
event_error: