From: Julien Desfossez Date: Wed, 29 Jun 2011 21:12:16 +0000 (-0400) Subject: Add mmap client mode X-Git-Tag: v2.0-pre1~27 X-Git-Url: https://git.lttng.org./?a=commitdiff_plain;h=2db1399a47bc5a86dade078994cd1060d6d56f64;p=lttng-modules.git Add mmap client mode 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 Signed-off-by: Mathieu Desnoyers --- diff --git a/Makefile b/Makefile index 9a0effcf..1384ce48 100644 --- 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 \ diff --git a/ltt-ring-buffer-client-discard.c b/ltt-ring-buffer-client-discard.c index ca7dfa8e..eafcf45a 100644 --- a/ltt-ring-buffer-client-discard.c +++ b/ltt-ring-buffer-client-discard.c @@ -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 index 00000000..29819a73 --- /dev/null +++ b/ltt-ring-buffer-client-mmap-discard.c @@ -0,0 +1,21 @@ +/* + * ltt-ring-buffer-client-discard.c + * + * Copyright (C) 2010 - Mathieu Desnoyers + * + * LTTng lib ring buffer client (discard mode). + * + * Dual LGPL v2.1/GPL v2 license. + */ + +#include +#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 index 00000000..741aa7b4 --- /dev/null +++ b/ltt-ring-buffer-client-mmap-overwrite.c @@ -0,0 +1,21 @@ +/* + * ltt-ring-buffer-client-overwrite.c + * + * Copyright (C) 2010 - Mathieu Desnoyers + * + * LTTng lib ring buffer client (overwrite mode). + * + * Dual LGPL v2.1/GPL v2 license. + */ + +#include +#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"); diff --git a/ltt-ring-buffer-client-overwrite.c b/ltt-ring-buffer-client-overwrite.c index ec3b1cf3..9811941a 100644 --- a/ltt-ring-buffer-client-overwrite.c +++ b/ltt-ring-buffer-client-overwrite.c @@ -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"); diff --git a/ltt-ring-buffer-client.h b/ltt-ring-buffer-client.h index 6389c98d..39587dd0 100644 --- a/ltt-ring-buffer-client.h +++ b/ltt-ring-buffer-client.h @@ -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, diff --git a/ltt-ring-buffer-metadata-client.c b/ltt-ring-buffer-metadata-client.c index 64f44085..ac6fe78c 100644 --- a/ltt-ring-buffer-metadata-client.c +++ b/ltt-ring-buffer-metadata-client.c @@ -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"); diff --git a/ltt-ring-buffer-metadata-client.h b/ltt-ring-buffer-metadata-client.h index 6d92e428..43a711ca 100644 --- a/ltt-ring-buffer-metadata-client.h +++ b/ltt-ring-buffer-metadata-client.h @@ -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 index 00000000..5cad3f92 --- /dev/null +++ b/ltt-ring-buffer-metadata-mmap-client.c @@ -0,0 +1,21 @@ +/* + * ltt-ring-buffer-metadata-client.c + * + * Copyright (C) 2010 - Mathieu Desnoyers + * + * LTTng lib ring buffer metadta client. + * + * Dual LGPL v2.1/GPL v2 license. + */ + +#include +#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");