goto fd_error;
}
- tracepoint_list_file = anon_inode_getfile("[lttng_session]",
+ tracepoint_list_file = anon_inode_getfile("[lttng_tracepoint_list]",
<tng_tracepoint_list_fops,
NULL, O_RDWR);
if (IS_ERR(tracepoint_list_file)) {
return ret;
}
+static
+int lttng_abi_syscall_list(void)
+{
+ struct file *syscall_list_file;
+ int file_fd, ret;
+
+ file_fd = get_unused_fd();
+ if (file_fd < 0) {
+ ret = file_fd;
+ goto fd_error;
+ }
+
+ syscall_list_file = anon_inode_getfile("[lttng_syscall_list]",
+ <tng_syscall_list_fops,
+ NULL, O_RDWR);
+ if (IS_ERR(syscall_list_file)) {
+ ret = PTR_ERR(syscall_list_file);
+ goto file_error;
+ }
+ ret = lttng_syscall_list_fops.open(NULL, syscall_list_file);
+ if (ret < 0)
+ goto open_error;
+ fd_install(file_fd, syscall_list_file);
+ if (file_fd < 0) {
+ ret = file_fd;
+ goto fd_error;
+ }
+ return file_fd;
+
+open_error:
+ fput(syscall_list_file);
+file_error:
+ put_unused_fd(file_fd);
+fd_error:
+ return ret;
+}
+
static
void lttng_abi_tracer_version(struct lttng_kernel_tracer_version *v)
{
case LTTNG_KERNEL_OLD_TRACEPOINT_LIST:
case LTTNG_KERNEL_TRACEPOINT_LIST:
return lttng_abi_tracepoint_list();
+ case LTTNG_KERNEL_SYSCALL_LIST:
+ return lttng_abi_syscall_list();
case LTTNG_KERNEL_OLD_WAIT_QUIESCENT:
case LTTNG_KERNEL_WAIT_QUIESCENT:
synchronize_trace();
metadata_stream->priv = buf;
stream_priv = metadata_stream;
metadata_stream->transport = channel->transport;
+ mutex_init(&metadata_stream->lock);
/*
* Since life-time of metadata cache differs from that of
atomic_long_inc(&channel_file->f_count);
break;
case LTTNG_KERNEL_SYSCALL:
- /*
- * Only all-syscall tracing supported for now.
- */
- if (event_param->name[0] != '\0')
- return -EINVAL;
ret = lttng_syscalls_register(channel, NULL);
if (ret)
goto fd_error;
event_fd = 0;
+ if (event_param->u.syscall.enable) {
+ ret = lttng_syscall_filter_enable(channel,
+ event_param->name[0] == '\0' ?
+ NULL : event_param->name);
+ if (ret)
+ goto fd_error;
+
+ } else {
+ ret = lttng_syscall_filter_disable(channel,
+ event_param->name[0] == '\0' ?
+ NULL : event_param->name);
+ if (ret)
+ goto fd_error;
+ }
break;
}
return event_fd;
return ret;
}
-void __exit lttng_abi_exit(void)
+/* No __exit annotation because used by init error path too. */
+void lttng_abi_exit(void)
{
if (lttng_proc_dentry)
remove_proc_entry("lttng", NULL);