Rename symbols.h to vmalloc.h
[lttng-modules.git] / ltt-ring-buffer-client.h
index 229c06aab31fde8f7daae1b9bab283e6fb364fb2..219f69be239e67a41a025a90f80d1b055c7694b5 100644 (file)
@@ -10,7 +10,8 @@
 
 #include <linux/module.h>
 #include <linux/types.h>
-#include <linux/trace-clock.h>
+#include "wrapper/vmalloc.h"   /* for wrapper_vmalloc_sync_all() */
+#include "wrapper/trace-clock.h"
 #include "ltt-events.h"
 #include "ltt-tracer.h"
 
@@ -105,11 +106,6 @@ static const struct lib_ring_buffer_config client_config = {
        .alloc = RING_BUFFER_ALLOC_PER_CPU,
        .sync = RING_BUFFER_SYNC_PER_CPU,
        .mode = RING_BUFFER_MODE_TEMPLATE,
-#ifdef RING_BUFFER_ALIGN
-       .align = RING_BUFFER_NATURAL,
-#else
-       .align = RING_BUFFER_PACKED,
-#endif
        .backend = RING_BUFFER_PAGE,
        .output = RING_BUFFER_SPLICE,
        .oops = RING_BUFFER_OOPS_CONSISTENCY,
@@ -181,6 +177,11 @@ void ltt_event_commit(struct lib_ring_buffer_ctx *ctx)
        lib_ring_buffer_put_cpu(&client_config);
 }
 
+void ltt_event_write(struct lib_ring_buffer_ctx *ctx, const void *src,
+                    size_t len)
+{
+       lib_ring_buffer_write(&client_config, ctx, src, len);
+}
 
 static struct ltt_transport ltt_relay_transport = {
        .name = "relay-" RING_BUFFER_MODE_TEMPLATE_STRING,
@@ -192,11 +193,17 @@ static struct ltt_transport ltt_relay_transport = {
                .buffer_read_close = ltt_buffer_read_close,
                .event_reserve = ltt_event_reserve,
                .event_commit = ltt_event_commit,
+               .event_write = ltt_event_write,
        },
 };
 
 static int __init ltt_ring_buffer_client_init(void)
 {
+       /*
+        * This vmalloc sync all also takes care of the lib ring buffer
+        * vmalloc'd module pages when it is built as a module into LTTng.
+        */
+       wrapper_vmalloc_sync_all();
        printk(KERN_INFO "LTT : ltt ring buffer client init\n");
        ltt_transport_register(&ltt_relay_transport);
        return 0;
This page took 0.023986 seconds and 4 git commands to generate.