X-Git-Url: http://git.lttng.org/?a=blobdiff_plain;f=lttng-abi.c;h=d47280f502f61c3c4a5792752443030caeb58c2b;hb=9616f0bf9524fc6b8ad184e87f4935c97f78a8bc;hp=8f63ad94c8fb053d9178aa91aa71d14d317f4e1b;hpb=92d9f5e6df0f72842b28ccd303569c88e183325a;p=lttng-modules.git diff --git a/lttng-abi.c b/lttng-abi.c index 8f63ad94..d47280f5 100644 --- a/lttng-abi.c +++ b/lttng-abi.c @@ -69,6 +69,8 @@ static const struct file_operations lttng_metadata_fops; static const struct file_operations lttng_event_fops; static struct file_operations lttng_stream_ring_buffer_file_operations; +static int put_u64(uint64_t val, unsigned long arg); + /* * Teardown management: opened file descriptors keep a refcount on the module, * so it can only exit when all file descriptors are closed. @@ -130,10 +132,6 @@ int lttng_abi_tracepoint_list(void) if (ret < 0) goto open_error; fd_install(file_fd, tracepoint_list_file); - if (file_fd < 0) { - ret = file_fd; - goto fd_error; - } return file_fd; open_error: @@ -174,10 +172,6 @@ int lttng_abi_syscall_list(void) 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: @@ -559,6 +553,8 @@ long lttng_session_ioctl(struct file *file, unsigned int cmd, unsigned long arg) return lttng_session_untrack_pid(session, (int) arg); case LTTNG_KERNEL_SESSION_LIST_TRACKER_PIDS: return lttng_session_list_tracker_pids(session); + case LTTNG_KERNEL_SESSION_METADATA_REGEN: + return lttng_session_metadata_regenerate(session); default: return -ENOIOCTLCMD; } @@ -686,6 +682,12 @@ long lttng_metadata_ring_buffer_ioctl(struct file *filp, goto err; break; } + case RING_BUFFER_GET_METADATA_VERSION: + { + struct lttng_metadata_stream *stream = filp->private_data; + + return put_u64(stream->version, arg); + } default: break; } @@ -758,6 +760,12 @@ long lttng_metadata_ring_buffer_compat_ioctl(struct file *filp, cmd, arg); break; } + case RING_BUFFER_GET_METADATA_VERSION: + { + struct lttng_metadata_stream *stream = filp->private_data; + + return put_u64(stream->version, arg); + } default: break; } @@ -1286,8 +1294,8 @@ int lttng_metadata_channel_release(struct inode *inode, struct file *file) struct lttng_channel *channel = file->private_data; if (channel) { - lttng_metadata_channel_destroy(channel); fput(channel->session->file); + lttng_metadata_channel_destroy(channel); } return 0; @@ -1508,6 +1516,24 @@ static long lttng_stream_ring_buffer_ioctl(struct file *filp, goto error; return put_u64(ts, arg); } + case LTTNG_RING_BUFFER_GET_SEQ_NUM: + { + uint64_t seq; + + ret = ops->sequence_number(config, buf, &seq); + if (ret < 0) + goto error; + return put_u64(seq, arg); + } + case LTTNG_RING_BUFFER_INSTANCE_ID: + { + uint64_t id; + + ret = ops->instance_id(config, buf, &id); + if (ret < 0) + goto error; + return put_u64(id, arg); + } default: return lib_ring_buffer_file_operations.unlocked_ioctl(filp, cmd, arg); @@ -1594,6 +1620,24 @@ static long lttng_stream_ring_buffer_compat_ioctl(struct file *filp, goto error; return put_u64(ts, arg); } + case LTTNG_RING_BUFFER_COMPAT_GET_SEQ_NUM: + { + uint64_t seq; + + ret = ops->sequence_number(config, buf, &seq); + if (ret < 0) + goto error; + return put_u64(seq, arg); + } + case LTTNG_RING_BUFFER_COMPAT_INSTANCE_ID: + { + uint64_t id; + + ret = ops->instance_id(config, buf, &id); + if (ret < 0) + goto error; + return put_u64(id, arg); + } default: return lib_ring_buffer_file_operations.compat_ioctl(filp, cmd, arg);