From: Mathieu Desnoyers Date: Wed, 11 May 2011 13:29:39 +0000 (-0400) Subject: Rename symbols.h to vmalloc.h X-Git-Tag: v2.0-pre1~165 X-Git-Url: https://git.liburcu.org/?a=commitdiff_plain;h=b13f3ebed2d2b80b450f72c12f684dc9e140ab40;p=lttng-modules.git Rename symbols.h to vmalloc.h Signed-off-by: Mathieu Desnoyers --- diff --git a/lib/ringbuffer/ring_buffer_backend.c b/lib/ringbuffer/ring_buffer_backend.c index 2d272c77..2ddb9f99 100644 --- a/lib/ringbuffer/ring_buffer_backend.c +++ b/lib/ringbuffer/ring_buffer_backend.c @@ -16,7 +16,7 @@ #include #include -#include "../../wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */ +#include "../../wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ #include "../../wrapper/ringbuffer/config.h" #include "../../wrapper/ringbuffer/backend.h" #include "../../wrapper/ringbuffer/frontend.h" diff --git a/ltt-debugfs-abi.c b/ltt-debugfs-abi.c index 4319ef3f..afee47c9 100644 --- a/ltt-debugfs-abi.c +++ b/ltt-debugfs-abi.c @@ -28,7 +28,7 @@ #include #include #include -#include "wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */ +#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ #include "wrapper/ringbuffer/vfs.h" #include "ltt-debugfs-abi.h" #include "ltt-events.h" diff --git a/ltt-events.c b/ltt-events.c index 9eb2c2f2..512e7a24 100644 --- a/ltt-events.c +++ b/ltt-events.c @@ -11,7 +11,7 @@ #include #include #include -#include "wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */ +#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ #include "ltt-events.h" static LIST_HEAD(sessions); diff --git a/ltt-ring-buffer-client.h b/ltt-ring-buffer-client.h index 00cac160..219f69be 100644 --- a/ltt-ring-buffer-client.h +++ b/ltt-ring-buffer-client.h @@ -10,7 +10,7 @@ #include #include -#include "wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */ +#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ #include "wrapper/trace-clock.h" #include "ltt-events.h" #include "ltt-tracer.h" diff --git a/probes/lttng-events.h b/probes/lttng-events.h index f697eadc..f031d450 100644 --- a/probes/lttng-events.h +++ b/probes/lttng-events.h @@ -1,7 +1,7 @@ #include #include #include -#include "../wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */ +#include "../wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ #include "../wrapper/ringbuffer/frontend_types.h" #include "../ltt-events.h" #include "../ltt-tracer-core.h" diff --git a/probes/lttng-types.c b/probes/lttng-types.c index 7f9d20e5..c447b7de 100644 --- a/probes/lttng-types.c +++ b/probes/lttng-types.c @@ -11,7 +11,7 @@ #include #include /* tid_t */ #include -#include "../wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */ +#include "../wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */ #include "lttng-types.h" struct dentry *lttng_types_dentry; diff --git a/wrapper/symbols.h b/wrapper/symbols.h deleted file mode 100644 index 523f553b..00000000 --- a/wrapper/symbols.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com) - * - * wrapper around vmalloc_sync_all. Using KALLSYMS to get its address when - * available, else we need to have a kernel that exports this function to GPL - * modules. - * - * Dual LGPL v2.1/GPL v2 license. - */ - -#ifdef CONFIG_KALLSYMS - -#include - -static inline -void wrapper_vmalloc_sync_all(void) -{ - void (*vmalloc_sync_all_sym)(void); - - vmalloc_sync_all_sym = (void *) kallsyms_lookup_name("vmalloc_sync_all"); - if (vmalloc_sync_all_sym) { - vmalloc_sync_all_sym(); - } else { -#ifdef CONFIG_X86 - /* - * Only x86 needs vmalloc_sync_all to make sure LTTng does not - * trigger recursive page faults. - */ - printk(KERN_WARNING "LTTng: vmalloc_sync_all symbol lookup failed.\n"); - printk(KERN_WARNING "Page fault handler and NMI tracing might trigger faults.\n"); -#endif - } -} -#else - -#include - -static inline -void wrapper_vmalloc_sync_all(void) -{ - return vmalloc_sync_all(); -} -#endif diff --git a/wrapper/vmalloc.h b/wrapper/vmalloc.h new file mode 100644 index 00000000..7d878556 --- /dev/null +++ b/wrapper/vmalloc.h @@ -0,0 +1,48 @@ +#ifndef _LTT_WRAPPER_VMALLOC_H +#define _LTT_WRAPPER_VMALLOC_H + +/* + * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com) + * + * wrapper around vmalloc_sync_all. Using KALLSYMS to get its address when + * available, else we need to have a kernel that exports this function to GPL + * modules. + * + * Dual LGPL v2.1/GPL v2 license. + */ + +#ifdef CONFIG_KALLSYMS + +#include + +static inline +void wrapper_vmalloc_sync_all(void) +{ + void (*vmalloc_sync_all_sym)(void); + + vmalloc_sync_all_sym = (void *) kallsyms_lookup_name("vmalloc_sync_all"); + if (vmalloc_sync_all_sym) { + vmalloc_sync_all_sym(); + } else { +#ifdef CONFIG_X86 + /* + * Only x86 needs vmalloc_sync_all to make sure LTTng does not + * trigger recursive page faults. + */ + printk(KERN_WARNING "LTTng: vmalloc_sync_all symbol lookup failed.\n"); + printk(KERN_WARNING "Page fault handler and NMI tracing might trigger faults.\n"); +#endif + } +} +#else + +#include + +static inline +void wrapper_vmalloc_sync_all(void) +{ + return vmalloc_sync_all(); +} +#endif + +#endif /* _LTT_WRAPPER_VMALLOC_H */