X-Git-Url: https://git.lttng.org/?p=lttng-tools.git;a=blobdiff_plain;f=src%2Fcommon%2Fkernel-ctl%2Fkernel-ctl.c;h=dd228773bc655eb985e88a6b2fe20e8c87221115;hp=18cd95529cfef620d1e6305de0d88e2572fe147f;hb=000fa86f1276f62aa32cdb18f6556db1bdeee09b;hpb=c74101efbbb06ea591b5c989afa3714689e843bb diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index 18cd95529..dd228773b 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -16,7 +16,6 @@ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. */ -#define _GNU_SOURCE #define _LGPL_SOURCE #define __USE_LINUX_IOCTL_DEFS #include @@ -533,3 +532,15 @@ int kernctl_get_current_timestamp(int fd, uint64_t *ts) { return ioctl(fd, LTTNG_RING_BUFFER_GET_CURRENT_TIMESTAMP, ts); } + +/* Returns the packet sequence number of the current sub-buffer. */ +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); +}