Remove dependency on vmalloc_sync_all symbol
[lttng-modules.git] / wrapper / symbols.h
1 /*
2 * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers@efficios.com)
3 *
4 * wrapper around vmalloc_sync_all. Using KALLSYMS to get its address when
5 * available, else we need to have a kernel that exports this function to GPL
6 * modules.
7 *
8 * Dual LGPL v2.1/GPL v2 license.
9 */
10
11 #ifdef CONFIG_KALLSYMS
12
13 #include <linux/kallsyms.h>
14
15 static inline
16 void wrapper_vmalloc_sync_all(void)
17 {
18 void (*vmalloc_sync_all_sym)(void);
19
20 vmalloc_sync_all_sym = (void *) kallsyms_lookup_name("vmalloc_sync_all");
21 if (vmalloc_sync_all_sym) {
22 vmalloc_sync_all_sym();
23 } else {
24 #ifdef CONFIG_X86
25 /*
26 * Only x86 needs vmalloc_sync_all to make sure LTTng does not
27 * trigger recursive page faults.
28 */
29 printk(KERN_WARNING "LTTng: vmalloc_sync_all symbol lookup failed.\n");
30 printk(KERN_WARNING "Page fault handler and NMI tracing might trigger faults.\n");
31 #endif
32 }
33 }
34 #else
35
36 #include <linux/vmalloc.h>
37
38 static inline
39 void wrapper_vmalloc_sync_all(void)
40 {
41 return vmalloc_sync_all();
42 }
43 #endif
This page took 0.0323 seconds and 5 git commands to generate.