X-Git-Url: https://git.liburcu.org/?a=blobdiff_plain;f=src%2Fcommon%2Fkernel-ctl%2Fkernel-ctl.c;h=1396cd9bbe846559ee345f6488fdd3808ac84ae1;hb=00e2e675d54dc726a7c8f8887c889cc8ef022003;hp=f17bf3bc7bf6fb96052e912c474a0118b52754c3;hpb=d14d33bf091e72b23b1f90ea18a0a01bed098b76;p=lttng-tools.git diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index f17bf3bc7..1396cd9bb 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -16,6 +16,7 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ +#define __USE_LINUX_IOCTL_DEFS #include #include "kernel-ctl.h" @@ -186,3 +187,16 @@ int kernctl_put_subbuf(int fd) { return ioctl(fd, RING_BUFFER_PUT_SUBBUF); } + +/* Set the stream_id */ +int kernctl_set_stream_id(int fd, unsigned long *stream_id) +{ + return ioctl(fd, RING_BUFFER_SET_STREAM_ID, stream_id); +} + +/* Get the offset of the stream_id in the packet header */ +int kernctl_get_net_stream_id_offset(int fd, unsigned long *offset) +{ + return ioctl(fd, LTTNG_KERNEL_STREAM_ID_OFFSET, offset); + +}