Support to dump the kernel metadata cache from the beginning
authorJulien Desfossez <jdesfossez@efficios.com>
Mon, 11 Dec 2017 21:58:51 +0000 (16:58 -0500)
committerJérémie Galarneau <jeremie.galarneau@efficios.com>
Fri, 9 Mar 2018 19:00:18 +0000 (14:00 -0500)
On demand, the consumer can ask for the kernel tracer to dump the
content of the metadata cache (depends on lttng-modules 2.11). This
allows to extract the exact same metadata (compared to regenerating it
which could change the epoch offset).

Signed-off-by: Julien Desfossez <jdesfossez@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
src/common/kernel-ctl/kernel-ctl.c
src/common/kernel-ctl/kernel-ctl.h
src/common/kernel-ctl/kernel-ioctl.h

index 6a256fefd00fa06b107c61aff78ea09151e63627..a495ca9b705bee48c94d7d32c9b602cbc9a48a7f 100644 (file)
@@ -419,6 +419,10 @@ int kernctl_get_metadata_version(int fd, uint64_t *version)
        return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_GET_METADATA_VERSION, version);
 }
 
+int kernctl_metadata_cache_dump(int fd)
+{
+       return LTTNG_IOCTL_CHECK(fd, RING_BUFFER_METADATA_CACHE_DUMP);
+}
 
 /* Buffer operations */
 
index d88f5e7659f336dcf8794b5684f624ad1dfb9212..fbb273190cf56aaf8477c75fb8161128de977efb 100644 (file)
@@ -95,6 +95,7 @@ int kernctl_put_subbuf(int fd);
 int kernctl_buffer_flush(int fd);
 int kernctl_buffer_flush_empty(int fd);
 int kernctl_get_metadata_version(int fd, uint64_t *version);
+int kernctl_metadata_cache_dump(int fd);
 
 /* index */
 int kernctl_get_timestamp_begin(int fd, uint64_t *timestamp_begin);
index 3c4f4129e63c8c0129521ca9ad617599927a3ce3..4ab0eabbc140f757e9af4aedb15ef43b25458536 100644 (file)
 #define RING_BUFFER_SNAPSHOT_SAMPLE_POSITIONS  _IO(0xF6, 0x0E)
 /* Flush the current sub-buffer, even if empty. */
 #define RING_BUFFER_FLUSH_EMPTY                        _IO(0xF6, 0x0F)
+/*
+ * 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)
 
 /* 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.026274 seconds and 4 git commands to generate.