From: Jonathan Rajotte Date: Tue, 12 Feb 2019 15:57:18 +0000 (-0500) Subject: kernel-ctl: Expose kernel clear buffer operation X-Git-Tag: v2.12.0-rc1~155 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=99930a9d179c900b48dd2bd033abee425775c22a;p=lttng-tools.git kernel-ctl: Expose kernel clear buffer operation Signed-off-by: Jonathan Rajotte Change-Id: I582b922f577635ca66e78680fdfedb523e6dcf67 Signed-off-by: Jérémie Galarneau --- diff --git a/src/common/kernel-ctl/kernel-ctl.c b/src/common/kernel-ctl/kernel-ctl.c index 14d96b577..5f25adf02 100644 --- a/src/common/kernel-ctl/kernel-ctl.c +++ b/src/common/kernel-ctl/kernel-ctl.c @@ -453,6 +453,11 @@ int kernctl_buffer_flush_empty(int fd) return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_FLUSH_EMPTY); } +int kernctl_buffer_clear(int fd) +{ + return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_CLEAR); +} + /* returns the version of the metadata. */ int kernctl_get_metadata_version(int fd, uint64_t *version) { diff --git a/src/common/kernel-ctl/kernel-ctl.h b/src/common/kernel-ctl/kernel-ctl.h index 053e7df63..fcaca84fe 100644 --- a/src/common/kernel-ctl/kernel-ctl.h +++ b/src/common/kernel-ctl/kernel-ctl.h @@ -97,6 +97,7 @@ int kernctl_put_subbuf(int fd); int kernctl_buffer_flush(int fd); int kernctl_buffer_flush_empty(int fd); +int kernctl_buffer_clear(int fd); int kernctl_get_metadata_version(int fd, uint64_t *version); int kernctl_metadata_cache_dump(int fd); diff --git a/src/common/kernel-ctl/kernel-ioctl.h b/src/common/kernel-ctl/kernel-ioctl.h index 8d39abbe3..f38f5dd67 100644 --- a/src/common/kernel-ctl/kernel-ioctl.h +++ b/src/common/kernel-ctl/kernel-ioctl.h @@ -64,6 +64,8 @@ * so it can be read again. */ #define RING_BUFFER_METADATA_CACHE_DUMP _IO(0xF6, 0x10) +/* Clear ring buffer content */ +#define RING_BUFFER_CLEAR _IO(0xF6, 0x11) /* returns the timestamp begin of the current sub-buffer */ #define LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN _IOR(0xF6, 0x20, uint64_t)