X-Git-Url: http://git.lttng.org./?a=blobdiff_plain;f=src%2Fcommon%2Fkernel-ctl%2Fkernel-ctl.c;h=82d766e1c1e70b53f0b0e3ec354bd7ab93da621b;hb=394ff38e77d4510a4ff806eb187bf739e84561c6;hp=28ed06cbdaa50b5494c698b296e1bc576cdcfd6c;hpb=00a620843422e5c972aee0ada2181b811fc81b92;p=lttng-tools.git diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index 28ed06cbd..82d766e1c 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 @@ -112,6 +111,7 @@ int kernctl_create_channel(int fd, struct lttng_channel_attr *chops) { struct lttng_kernel_channel channel; + memset(&channel, 0, sizeof(channel)); if (lttng_kernel_use_old_abi) { struct lttng_kernel_old_channel old_channel; @@ -532,3 +532,9 @@ 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); +}