From: Mathieu Desnoyers Date: Thu, 19 May 2011 04:35:59 +0000 (-0400) Subject: Add vmalloc sync all calls in ftrace and kprobes modules X-Git-Tag: v2.0-pre1~136 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;ds=sidebyside;h=16a9a591f233adc076cc59462f37bd697d952604;p=lttng-modules.git Add vmalloc sync all calls in ftrace and kprobes modules Signed-off-by: Mathieu Desnoyers --- diff --git a/probes/lttng-ftrace.c b/probes/lttng-ftrace.c index f2190370..27f4e2be 100644 --- a/probes/lttng-ftrace.c +++ b/probes/lttng-ftrace.c @@ -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, <tng_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) diff --git a/probes/lttng-kprobes.c b/probes/lttng-kprobes.c index 9d9fb5b9..daef3600 100644 --- a/probes/lttng-kprobes.c +++ b/probes/lttng-kprobes.c @@ -12,6 +12,7 @@ #include #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;