kerner-ctl: add RING_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK
authorJérémie Galarneau <jeremie.galarneau@efficios.com>
Wed, 29 Apr 2020 01:40:12 +0000 (21:40 -0400)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Tue, 26 May 2020 20:25:31 +0000 (16:25 -0400)
Add a wrapper for RING_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK
which gets the next metadata subbuffer and returns a boolean flag
indicating whether the metadata is guaranteed to be in a consistent
state at the end of this sub-buffer (can be parsed).

Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: I13fbdfe51c3c4ef04581409e0fbc9837ed6d555d

src/common/kernel-ctl/kernel-ctl.c
src/common/kernel-ctl/kernel-ctl.h
src/common/kernel-ctl/kernel-ioctl.h

index caae421fc357e3718dfecaab90fda19dee87c4a0..10e281d69315a638a24b96102b601415eeb18801 100644 (file)
@@ -510,6 +510,13 @@ int kernctl_buffer_clear(int fd)
        return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_CLEAR);
 }
 
+int kernctl_get_next_subbuf_metadata_check(int fd, bool *consistent)
+{
+       return LTTNG_IOCTL_NO_CHECK(fd,
+                       RING_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK,
+                       consistent);
+}
+
 /* returns the version of the metadata. */
 int kernctl_get_metadata_version(int fd, uint64_t *version)
 {
index 60fcabd6ef038ca6c0b91de0cdeda5de3b5abff6..49925ea6c3affe8264b1f4b0a7cd00571c90dd39 100644 (file)
@@ -9,6 +9,8 @@
 #ifndef _LTTNG_KERNEL_CTL_H
 #define _LTTNG_KERNEL_CTL_H
 
+#include <stdbool.h>
+
 #include <lttng/lttng.h>
 #include <common/lttng-kernel.h>
 #include <common/lttng-kernel-old.h>
@@ -94,6 +96,7 @@ 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);
+int kernctl_get_next_subbuf_metadata_check(int fd, bool *consistent);
 
 /* index */
 int kernctl_get_timestamp_begin(int fd, uint64_t *timestamp_begin);
index 59d71191f30142a8c207469764344afc526e72d5..ed6555e10e47d87e59f3b4514a42dcee1b4db55a 100644 (file)
  * Reset the position of what has been consumed from the metadata cache to 0
  * so it can be read again.
  */
-#define RING_BUFFER_METADATA_CACHE_DUMP        _IO(0xF6, 0x10)
+#define RING_BUFFER_METADATA_CACHE_DUMP                _IO(0xF6, 0x10)
 /* Clear ring buffer content */
-#define RING_BUFFER_CLEAR                       _IO(0xF6, 0x11)
+#define RING_BUFFER_CLEAR                               _IO(0xF6, 0x11)
+#define RING_RING_BUFFER_GET_NEXT_SUBBUF_METADATA_CHECK _IOR(0xF6, 0x12, uint32_t)
 
 /* returns the timestamp begin of the current sub-buffer */
 #define LTTNG_RING_BUFFER_GET_TIMESTAMP_BEGIN     _IOR(0xF6, 0x20, uint64_t)
This page took 0.035774 seconds and 4 git commands to generate.