[lttng-dev] [LTTNG-TOOLS PATCH 8/9] kernctl commands to extract the stream instance id
Julien Desfossez
jdesfossez at efficios.com
Mon Jul 13 11:28:08 EDT 2015
Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
---
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 b3be8be..2f0050c 100644
--- a/src/common/kernel-ctl/kernel-ctl.c
+++ b/src/common/kernel-ctl/kernel-ctl.c
@@ -539,3 +539,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 ab8154c..9294888 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 d988a83..b37605b 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 */
--
1.9.1
More information about the lttng-dev
mailing list