Add vmalloc sync all calls in ftrace and kprobes modules
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 19 May 2011 04:35:59 +0000 (00:35 -0400)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 19 May 2011 04:35:59 +0000 (00:35 -0400)
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
probes/lttng-ftrace.c
probes/lttng-kprobes.c

index f2190370cdcdc9e2124ee4daa82520fb600c9880..27f4e2bef81117b6bb1e0dc257b838f1c97162c0 100644 (file)
@@ -19,6 +19,7 @@
 #include "../ltt-events.h"
 #include "../wrapper/ringbuffer/frontend_types.h"
 #include "../wrapper/ftrace.h"
+#include "../wrapper/vmalloc.h"
 #include "../ltt-tracer.h"
 
 static
@@ -115,6 +116,9 @@ int lttng_ftrace_register(const char *name,
        if (!event->u.ftrace.symbol_name)
                goto name_error;
 
+       /* Ensure the memory we just allocated don't trigger page faults */
+       wrapper_vmalloc_sync_all();
+
        ret = wrapper_register_ftrace_function_probe(event->u.ftrace.symbol_name,
                        &lttng_ftrace_ops, event);
        if (ret)
@@ -144,6 +148,7 @@ EXPORT_SYMBOL_GPL(lttng_ftrace_unregister);
 /* This module is permanent. */
 int lttng_ftrace_init(void)
 {
+       wrapper_vmalloc_sync_all();
        return 0;
 }
 module_init(lttng_ftrace_init)
index 9d9fb5b9a759fd6445f70478c907657736f1f082..daef3600feefd580bb0db79357d09428f8eb21eb 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/slab.h>
 #include "../ltt-events.h"
 #include "../wrapper/ringbuffer/frontend_types.h"
+#include "../wrapper/vmalloc.h"
 #include "../ltt-tracer.h"
 
 static
@@ -101,6 +102,14 @@ int lttng_kprobes_register(const char *name,
                event->u.kprobe.symbol_name;
        event->u.kprobe.kp.offset = offset;
        event->u.kprobe.kp.addr = (void *) addr;
+
+       /*
+        * Ensure the memory we just allocated don't trigger page faults.
+        * Well.. kprobes itself puts the page fault handler on the blacklist,
+        * but we can never be too careful.
+        */
+       wrapper_vmalloc_sync_all();
+
        ret = register_kprobe(&event->u.kprobe.kp);
        if (ret)
                goto register_error;
This page took 0.02686 seconds and 4 git commands to generate.