* Dual LGPL v2.1/GPL v2 license.
*/
-#include <linux/vmalloc.h>
#include <linux/stddef.h>
#include <linux/module.h>
#include <linux/string.h>
#include <linux/cpu.h>
#include <linux/mm.h>
+#include "../../wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */
#include "../../wrapper/ringbuffer/config.h"
#include "../../wrapper/ringbuffer/backend.h"
#include "../../wrapper/ringbuffer/frontend.h"
* If kmalloc ever uses vmalloc underneath, make sure the buffer pages
* will not fault.
*/
- vmalloc_sync_all();
+ wrapper_vmalloc_sync_all();
kfree(virt);
kfree(pages);
return 0;
#include <linux/file.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
-#include <linux/vmalloc.h> /* For vmalloc_sync_all */
+#include "wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */
#include "wrapper/ringbuffer/vfs.h"
#include "ltt-debugfs-abi.h"
#include "ltt-events.h"
{
int ret = 0;
- vmalloc_sync_all();
+ wrapper_vmalloc_sync_all();
lttng_dentry = debugfs_create_file("lttng", S_IWUSR, NULL, NULL,
<tng_fops);
if (IS_ERR(lttng_dentry) || !lttng_dentry) {
#include <linux/mutex.h>
#include <linux/sched.h>
#include <linux/slab.h>
-#include <linux/vmalloc.h> /* For vmalloc_sync_all */
+#include "wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */
#include "ltt-events.h"
static LIST_HEAD(sessions);
* registered. We deal with this here so we don't have to call
* vmalloc_sync_all() in each module's init.
*/
- vmalloc_sync_all();
+ wrapper_vmalloc_sync_all();
mutex_lock(&sessions_mutex);
list_add_tail(&transport->node, <t_transport_list);
#include <linux/module.h>
#include <linux/types.h>
-#include <linux/vmalloc.h> /* for vmalloc_sync_all */
+#include "wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */
#include "wrapper/trace-clock.h"
#include "ltt-events.h"
#include "ltt-tracer.h"
* 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.
*/
- vmalloc_sync_all();
+ wrapper_vmalloc_sync_all();
printk(KERN_INFO "LTT : ltt ring buffer client init\n");
ltt_transport_register(<t_relay_transport);
return 0;
#include <lttng.h>
#include <lttng-types.h>
#include <linux/debugfs.h>
-#include <linux/vmalloc.h> /* for vmalloc_sync_all() */
+#include "../wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */
#include "../wrapper/ringbuffer/frontend_types.h"
#include "../ltt-events.h"
#include "../ltt-tracer-core.h"
int ret;
int i;
- vmalloc_sync_all();
+ wrapper_vmalloc_sync_all();
ret = TP_ID(__lttng_types_init__, TRACE_SYSTEM)();
if (ret)
return ret;
#include <linux/seq_file.h>
#include <linux/jbd.h> /* tid_t */
#include <linux/debugfs.h>
-#include <linux/vmalloc.h> /* for vmalloc_sync_all */
+#include "../wrapper/symbols.h" /* for wrapper_vmalloc_sync_all() */
#include "lttng-types.h"
struct dentry *lttng_types_dentry;
{
int ret = 0;
- vmalloc_sync_all();
+ wrapper_vmalloc_sync_all();
lttng_types_dentry = debugfs_create_file("lttng-types", S_IWUSR,
NULL, NULL, <tng_types_fops);
if (IS_ERR(lttng_types_dentry) || !lttng_types_dentry) {
--- /dev/null
+/*
+ * 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 <linux/kallsyms.h>
+
+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 <linux/vmalloc.h>
+
+static inline
+void wrapper_vmalloc_sync_all(void)
+{
+ return vmalloc_sync_all();
+}
+#endif