Add mmap client mode
authorJulien Desfossez <julien.desfossez@polymtl.ca>
Wed, 29 Jun 2011 21:12:16 +0000 (17:12 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Wed, 29 Jun 2011 21:12:16 +0000 (17:12 -0400)
Three new modules to configure the ring buffer output for mmap support.
Add the RING_BUFFER_OUTPUT_TEMPLATE macro to configure the ring buffer
output instead of being splice by default.

Signed-off-by: Julien Desfossez <julien.desfossez@polymtl.ca>
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Makefile
ltt-ring-buffer-client-discard.c
ltt-ring-buffer-client-mmap-discard.c [new file with mode: 0644]
ltt-ring-buffer-client-mmap-overwrite.c [new file with mode: 0644]
ltt-ring-buffer-client-overwrite.c
ltt-ring-buffer-client.h
ltt-ring-buffer-metadata-client.c
ltt-ring-buffer-metadata-client.h
ltt-ring-buffer-metadata-mmap-client.c [new file with mode: 0644]

index 9a0effcfc483d605a19547f8b488f64296772f10..1384ce4866f815cf43612f4fcc07cbb640e47ca7 100644 (file)
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,9 @@ ifneq ($(CONFIG_TRACEPOINTS),)
 obj-m += ltt-ring-buffer-client-discard.o
 obj-m += ltt-ring-buffer-client-overwrite.o
 obj-m += ltt-ring-buffer-metadata-client.o
+obj-m += ltt-ring-buffer-client-mmap-discard.o
+obj-m += ltt-ring-buffer-client-mmap-overwrite.o
+obj-m += ltt-ring-buffer-metadata-mmap-client.o
 
 obj-m += ltt-relay.o
 ltt-relay-objs :=  ltt-events.o ltt-debugfs-abi.o \
index ca7dfa8efa62cebc1d856f2cad7a76164ea2beae..eafcf45ad0f623c0f95575b44df92892a2c8e95e 100644 (file)
@@ -13,6 +13,7 @@
 
 #define RING_BUFFER_MODE_TEMPLATE              RING_BUFFER_DISCARD
 #define RING_BUFFER_MODE_TEMPLATE_STRING       "discard"
+#define RING_BUFFER_OUTPUT_TEMPLATE            RING_BUFFER_SPLICE
 #include "ltt-ring-buffer-client.h"
 
 MODULE_LICENSE("GPL and additional rights");
diff --git a/ltt-ring-buffer-client-mmap-discard.c b/ltt-ring-buffer-client-mmap-discard.c
new file mode 100644 (file)
index 0000000..29819a7
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * ltt-ring-buffer-client-discard.c
+ *
+ * Copyright (C) 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * LTTng lib ring buffer client (discard mode).
+ *
+ * Dual LGPL v2.1/GPL v2 license.
+ */
+
+#include <linux/module.h>
+#include "ltt-tracer.h"
+
+#define RING_BUFFER_MODE_TEMPLATE              RING_BUFFER_DISCARD
+#define RING_BUFFER_MODE_TEMPLATE_STRING       "discard-mmap"
+#define RING_BUFFER_OUTPUT_TEMPLATE            RING_BUFFER_MMAP
+#include "ltt-ring-buffer-client.h"
+
+MODULE_LICENSE("GPL and additional rights");
+MODULE_AUTHOR("Mathieu Desnoyers");
+MODULE_DESCRIPTION("LTTng Ring Buffer Client Discard Mode");
diff --git a/ltt-ring-buffer-client-mmap-overwrite.c b/ltt-ring-buffer-client-mmap-overwrite.c
new file mode 100644 (file)
index 0000000..741aa7b
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * ltt-ring-buffer-client-overwrite.c
+ *
+ * Copyright (C) 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * LTTng lib ring buffer client (overwrite mode).
+ *
+ * Dual LGPL v2.1/GPL v2 license.
+ */
+
+#include <linux/module.h>
+#include "ltt-tracer.h"
+
+#define RING_BUFFER_MODE_TEMPLATE              RING_BUFFER_OVERWRITE
+#define RING_BUFFER_MODE_TEMPLATE_STRING       "overwrite-mmap"
+#define RING_BUFFER_OUTPUT_TEMPLATE            RING_BUFFER_MMAP
+#include "ltt-ring-buffer-client.h"
+
+MODULE_LICENSE("GPL and additional rights");
+MODULE_AUTHOR("Mathieu Desnoyers");
+MODULE_DESCRIPTION("LTTng Ring Buffer Client Overwrite Mode");
index ec3b1cf33f7515d2506266d827a0283e5778c8d6..9811941aa3696a86889212f71b2505080384e75c 100644 (file)
@@ -13,6 +13,7 @@
 
 #define RING_BUFFER_MODE_TEMPLATE              RING_BUFFER_OVERWRITE
 #define RING_BUFFER_MODE_TEMPLATE_STRING       "overwrite"
+#define RING_BUFFER_OUTPUT_TEMPLATE            RING_BUFFER_SPLICE
 #include "ltt-ring-buffer-client.h"
 
 MODULE_LICENSE("GPL and additional rights");
index 6389c98d5fc18f30307b216ae300edfeacbfd59c..39587dd0b15f2054454a57bda420cc78ec680a62 100644 (file)
@@ -361,7 +361,7 @@ static const struct lib_ring_buffer_config client_config = {
        .sync = RING_BUFFER_SYNC_PER_CPU,
        .mode = RING_BUFFER_MODE_TEMPLATE,
        .backend = RING_BUFFER_PAGE,
-       .output = RING_BUFFER_SPLICE,
+       .output = RING_BUFFER_OUTPUT_TEMPLATE,
        .oops = RING_BUFFER_OOPS_CONSISTENCY,
        .ipi = RING_BUFFER_IPI_BARRIER,
        .wakeup = RING_BUFFER_WAKEUP_BY_TIMER,
index 64f4408595eea77b44e37ba7edae8e3b9df0af58..ac6fe78c45e5ddd8df65b923410951a5037f256e 100644 (file)
@@ -13,6 +13,7 @@
 
 #define RING_BUFFER_MODE_TEMPLATE              RING_BUFFER_DISCARD
 #define RING_BUFFER_MODE_TEMPLATE_STRING       "metadata"
+#define RING_BUFFER_OUTPUT_TEMPLATE            RING_BUFFER_SPLICE
 #include "ltt-ring-buffer-metadata-client.h"
 
 MODULE_LICENSE("GPL and additional rights");
index 6d92e4282f229e6bd08a2aeb2fc5610498f091a4..43a711caa29c5da4ce4bbf7fea331c0eeeb4ed23 100644 (file)
@@ -142,7 +142,7 @@ static const struct lib_ring_buffer_config client_config = {
        .sync = RING_BUFFER_SYNC_GLOBAL,
        .mode = RING_BUFFER_MODE_TEMPLATE,
        .backend = RING_BUFFER_PAGE,
-       .output = RING_BUFFER_SPLICE,
+       .output = RING_BUFFER_OUTPUT_TEMPLATE,
        .oops = RING_BUFFER_OOPS_CONSISTENCY,
        .ipi = RING_BUFFER_IPI_BARRIER,
        .wakeup = RING_BUFFER_WAKEUP_BY_TIMER,
diff --git a/ltt-ring-buffer-metadata-mmap-client.c b/ltt-ring-buffer-metadata-mmap-client.c
new file mode 100644 (file)
index 0000000..5cad3f9
--- /dev/null
@@ -0,0 +1,21 @@
+/*
+ * ltt-ring-buffer-metadata-client.c
+ *
+ * Copyright (C) 2010 - Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
+ *
+ * LTTng lib ring buffer metadta client.
+ *
+ * Dual LGPL v2.1/GPL v2 license.
+ */
+
+#include <linux/module.h>
+#include "ltt-tracer.h"
+
+#define RING_BUFFER_MODE_TEMPLATE              RING_BUFFER_DISCARD
+#define RING_BUFFER_MODE_TEMPLATE_STRING       "metadata-mmap"
+#define RING_BUFFER_OUTPUT_TEMPLATE            RING_BUFFER_MMAP
+#include "ltt-ring-buffer-metadata-client.h"
+
+MODULE_LICENSE("GPL and additional rights");
+MODULE_AUTHOR("Mathieu Desnoyers");
+MODULE_DESCRIPTION("LTTng Ring Buffer Metadata Client");
This page took 0.030457 seconds and 4 git commands to generate.