From 000fa86f1276f62aa32cdb18f6556db1bdeee09b Mon Sep 17 00:00:00 2001 From: Julien Desfossez Date: Mon, 6 Jul 2015 13:22:32 -0400 Subject: [PATCH] kernctl commands to extract the stream instance id MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Julien Desfossez Acked-by: Mathieu Desnoyers Signed-off-by: Jérémie Galarneau --- src/common/kernel-ctl/kernel-ctl.c | 6 ++++++ src/common/kernel-ctl/kernel-ctl.h | 1 + src/common/kernel-ctl/kernel-ioctl.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index 82d766e1c..dd228773b 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -538,3 +538,9 @@ int kernctl_get_sequence_number(int fd, uint64_t *seq) { return ioctl(fd, LTTNG_RING_BUFFER_GET_SEQ_NUM, seq); } + +/* Returns the stream instance id. */ +int kernctl_get_instance_id(int fd, uint64_t *id) +{ + return ioctl(fd, LTTNG_RING_BUFFER_INSTANCE_ID, id); +} diff --git a/src/common/kernel-ctl/kernel-ctl.h b/src/common/kernel-ctl/kernel-ctl.h index ab8154ca6..929488841 100644 --- a/src/common/kernel-ctl/kernel-ctl.h +++ b/src/common/kernel-ctl/kernel-ctl.h @@ -100,5 +100,6 @@ int kernctl_get_packet_size(int fd, uint64_t *packet_size); int kernctl_get_stream_id(int fd, uint64_t *stream_id); int kernctl_get_current_timestamp(int fd, uint64_t *ts); int kernctl_get_sequence_number(int fd, uint64_t *seq); +int kernctl_get_instance_id(int fd, uint64_t *seq); #endif /* _LTTNG_KERNEL_CTL_H */ diff --git a/src/common/kernel-ctl/kernel-ioctl.h b/src/common/kernel-ctl/kernel-ioctl.h index d988a83ea..b37605bb1 100644 --- a/src/common/kernel-ctl/kernel-ioctl.h +++ b/src/common/kernel-ctl/kernel-ioctl.h @@ -66,6 +66,8 @@ #define LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP _IOR(0xF6, 0x26, uint64_t) /* returns the packet sequence number */ #define LTTNG_RING_BUFFER_GET_SEQ_NUM _IOR(0xF6, 0x27, uint64_t) +/* returns the stream instance id */ +#define LTTNG_RING_BUFFER_INSTANCE_ID _IOR(0xF6, 0x28, uint64_t) /* Old ABI (without support for 32/64 bits compat) */ /* LTTng file descriptor ioctl */ -- 2.34.1