[lttng-dev] [PATCH 02/11] Remove LTTng vmalloc_sync_all wrapper
Mathieu Desnoyers
mathieu.desnoyers at efficios.com
Thu Dec 1 16:41:14 EST 2011
Use the newly exported vmalloc_sync_all symbol.
Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
---
.../lttng/lib/ringbuffer/ring_buffer_backend.c | 3 +-
drivers/staging/lttng/ltt-context.c | 1 -
drivers/staging/lttng/ltt-debugfs-abi.c | 3 +-
drivers/staging/lttng/ltt-events.c | 3 +-
drivers/staging/lttng/ltt-ring-buffer-client.h | 3 +-
.../lttng/ltt-ring-buffer-metadata-client.h | 3 +-
drivers/staging/lttng/lttng-context-nice.c | 3 +-
.../staging/lttng/lttng-context-perf-counters.c | 3 +-
drivers/staging/lttng/lttng-context-pid.c | 3 +-
drivers/staging/lttng/lttng-context-ppid.c | 3 +-
drivers/staging/lttng/lttng-context-prio.c | 3 +-
drivers/staging/lttng/lttng-context-procname.c | 3 +-
drivers/staging/lttng/lttng-context-tid.c | 3 +-
drivers/staging/lttng/lttng-context-vpid.c | 3 +-
drivers/staging/lttng/lttng-context-vppid.c | 3 +-
drivers/staging/lttng/lttng-context-vtid.c | 3 +-
drivers/staging/lttng/lttng-syscalls.c | 2 +-
drivers/staging/lttng/probes/lttng-events.h | 3 +-
drivers/staging/lttng/probes/lttng-ftrace.c | 5 +-
drivers/staging/lttng/probes/lttng-kprobes.c | 3 +-
drivers/staging/lttng/probes/lttng-kretprobes.c | 3 +-
drivers/staging/lttng/probes/lttng-types.c | 3 +-
drivers/staging/lttng/wrapper/vmalloc.h | 49 --------------------
23 files changed, 22 insertions(+), 92 deletions(-)
delete mode 100644 drivers/staging/lttng/wrapper/vmalloc.h
diff --git a/drivers/staging/lttng/lib/ringbuffer/ring_buffer_backend.c b/drivers/staging/lttng/lib/ringbuffer/ring_buffer_backend.c
index d1b5b8c..a406f12 100644
--- a/drivers/staging/lttng/lib/ringbuffer/ring_buffer_backend.c
+++ b/drivers/staging/lttng/lib/ringbuffer/ring_buffer_backend.c
@@ -16,7 +16,6 @@
#include <linux/cpu.h>
#include <linux/mm.h>
-#include "../../wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "../../wrapper/ringbuffer/config.h"
#include "../../wrapper/ringbuffer/backend.h"
#include "../../wrapper/ringbuffer/frontend.h"
@@ -131,7 +130,7 @@ int lib_ring_buffer_backend_allocate(const struct lib_ring_buffer_config *config
* If kmalloc ever uses vmalloc underneath, make sure the buffer pages
* will not fault.
*/
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
kfree(virt);
kfree(pages);
return 0;
diff --git a/drivers/staging/lttng/ltt-context.c b/drivers/staging/lttng/ltt-context.c
index 60ea525..1773b8c 100644
--- a/drivers/staging/lttng/ltt-context.c
+++ b/drivers/staging/lttng/ltt-context.c
@@ -12,7 +12,6 @@
#include <linux/list.h>
#include <linux/mutex.h>
#include <linux/slab.h>
-#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "ltt-events.h"
#include "ltt-tracer.h"
diff --git a/drivers/staging/lttng/ltt-debugfs-abi.c b/drivers/staging/lttng/ltt-debugfs-abi.c
index 37cccfa..97ef3a6 100644
--- a/drivers/staging/lttng/ltt-debugfs-abi.c
+++ b/drivers/staging/lttng/ltt-debugfs-abi.c
@@ -31,7 +31,6 @@
#include <linux/file.h>
#include <linux/uaccess.h>
#include <linux/slab.h>
-#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "wrapper/ringbuffer/vfs.h"
#include "wrapper/poll.h"
#include "ltt-debugfs-abi.h"
@@ -750,7 +749,7 @@ int __init ltt_debugfs_abi_init(void)
{
int ret = 0;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
lttng_dentry = debugfs_create_file("lttng", S_IWUSR, NULL, NULL,
<tng_fops);
if (IS_ERR(lttng_dentry))
diff --git a/drivers/staging/lttng/ltt-events.c b/drivers/staging/lttng/ltt-events.c
index 4229914..f7438c5 100644
--- a/drivers/staging/lttng/ltt-events.c
+++ b/drivers/staging/lttng/ltt-events.c
@@ -15,7 +15,6 @@
#include <linux/slab.h>
#include <linux/jiffies.h>
#include "wrapper/uuid.h"
-#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "ltt-events.h"
#include "ltt-tracer.h"
@@ -954,7 +953,7 @@ void ltt_transport_register(struct ltt_transport *transport)
* registered. We deal with this here so we don't have to call
* vmalloc_sync_all() in each module's init.
*/
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
mutex_lock(&sessions_mutex);
list_add_tail(&transport->node, <t_transport_list);
diff --git a/drivers/staging/lttng/ltt-ring-buffer-client.h b/drivers/staging/lttng/ltt-ring-buffer-client.h
index 8df3790..a35dfbb 100644
--- a/drivers/staging/lttng/ltt-ring-buffer-client.h
+++ b/drivers/staging/lttng/ltt-ring-buffer-client.h
@@ -11,7 +11,6 @@
#include <linux/module.h>
#include <linux/types.h>
#include "lib/bitfield.h"
-#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "wrapper/trace-clock.h"
#include "ltt-events.h"
#include "ltt-tracer.h"
@@ -549,7 +548,7 @@ static int __init ltt_ring_buffer_client_init(void)
* 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.
*/
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
ltt_transport_register(<t_relay_transport);
return 0;
}
diff --git a/drivers/staging/lttng/ltt-ring-buffer-metadata-client.h b/drivers/staging/lttng/ltt-ring-buffer-metadata-client.h
index 529bbb1..b859358 100644
--- a/drivers/staging/lttng/ltt-ring-buffer-metadata-client.h
+++ b/drivers/staging/lttng/ltt-ring-buffer-metadata-client.h
@@ -10,7 +10,6 @@
#include <linux/module.h>
#include <linux/types.h>
-#include "wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "ltt-events.h"
#include "ltt-tracer.h"
@@ -310,7 +309,7 @@ static int __init ltt_ring_buffer_client_init(void)
* 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.
*/
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
ltt_transport_register(<t_relay_transport);
return 0;
}
diff --git a/drivers/staging/lttng/lttng-context-nice.c b/drivers/staging/lttng/lttng-context-nice.c
index 9b99b54..d238185 100644
--- a/drivers/staging/lttng/lttng-context-nice.c
+++ b/drivers/staging/lttng/lttng-context-nice.c
@@ -12,7 +12,6 @@
#include <linux/sched.h>
#include "ltt-events.h"
#include "wrapper/ringbuffer/frontend_types.h"
-#include "wrapper/vmalloc.h"
#include "ltt-tracer.h"
static
@@ -58,7 +57,7 @@ int lttng_add_nice_to_ctx(struct lttng_ctx **ctx)
field->event_field.type.u.basic.integer.encoding = lttng_encode_none;
field->get_size = nice_get_size;
field->record = nice_record;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return 0;
}
EXPORT_SYMBOL_GPL(lttng_add_nice_to_ctx);
diff --git a/drivers/staging/lttng/lttng-context-perf-counters.c b/drivers/staging/lttng/lttng-context-perf-counters.c
index 3ae2266..9910066 100644
--- a/drivers/staging/lttng/lttng-context-perf-counters.c
+++ b/drivers/staging/lttng/lttng-context-perf-counters.c
@@ -14,7 +14,6 @@
#include <linux/string.h>
#include "ltt-events.h"
#include "wrapper/ringbuffer/frontend_types.h"
-#include "wrapper/vmalloc.h"
#include "wrapper/perf.h"
#include "ltt-tracer.h"
@@ -240,7 +239,7 @@ int lttng_add_perf_counter_to_ctx(uint32_t type,
field->u.perf_counter = perf_field;
perf_field->hp_enable = 1;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return 0;
counter_busy:
diff --git a/drivers/staging/lttng/lttng-context-pid.c b/drivers/staging/lttng/lttng-context-pid.c
index 698b242..0cd3900 100644
--- a/drivers/staging/lttng/lttng-context-pid.c
+++ b/drivers/staging/lttng/lttng-context-pid.c
@@ -12,7 +12,6 @@
#include <linux/sched.h>
#include "ltt-events.h"
#include "wrapper/ringbuffer/frontend_types.h"
-#include "wrapper/vmalloc.h"
#include "ltt-tracer.h"
static
@@ -58,7 +57,7 @@ int lttng_add_pid_to_ctx(struct lttng_ctx **ctx)
field->event_field.type.u.basic.integer.encoding = lttng_encode_none;
field->get_size = pid_get_size;
field->record = pid_record;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return 0;
}
EXPORT_SYMBOL_GPL(lttng_add_pid_to_ctx);
diff --git a/drivers/staging/lttng/lttng-context-ppid.c b/drivers/staging/lttng/lttng-context-ppid.c
index 738f7e6..673ff26 100644
--- a/drivers/staging/lttng/lttng-context-ppid.c
+++ b/drivers/staging/lttng/lttng-context-ppid.c
@@ -13,7 +13,6 @@
#include <linux/syscalls.h>
#include "ltt-events.h"
#include "wrapper/ringbuffer/frontend_types.h"
-#include "wrapper/vmalloc.h"
#include "ltt-tracer.h"
static
@@ -61,7 +60,7 @@ int lttng_add_ppid_to_ctx(struct lttng_ctx **ctx)
field->event_field.type.u.basic.integer.encoding = lttng_encode_none;
field->get_size = ppid_get_size;
field->record = ppid_record;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return 0;
}
EXPORT_SYMBOL_GPL(lttng_add_ppid_to_ctx);
diff --git a/drivers/staging/lttng/lttng-context-prio.c b/drivers/staging/lttng/lttng-context-prio.c
index 1ee3a54..f4f64de 100644
--- a/drivers/staging/lttng/lttng-context-prio.c
+++ b/drivers/staging/lttng/lttng-context-prio.c
@@ -12,7 +12,6 @@
#include <linux/sched.h>
#include "ltt-events.h"
#include "wrapper/ringbuffer/frontend_types.h"
-#include "wrapper/vmalloc.h"
#include "wrapper/kallsyms.h"
#include "ltt-tracer.h"
@@ -79,7 +78,7 @@ int lttng_add_prio_to_ctx(struct lttng_ctx **ctx)
field->event_field.type.u.basic.integer.encoding = lttng_encode_none;
field->get_size = prio_get_size;
field->record = prio_record;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return 0;
}
EXPORT_SYMBOL_GPL(lttng_add_prio_to_ctx);
diff --git a/drivers/staging/lttng/lttng-context-procname.c b/drivers/staging/lttng/lttng-context-procname.c
index c6bc646..0993613 100644
--- a/drivers/staging/lttng/lttng-context-procname.c
+++ b/drivers/staging/lttng/lttng-context-procname.c
@@ -12,7 +12,6 @@
#include <linux/sched.h>
#include "ltt-events.h"
#include "wrapper/ringbuffer/frontend_types.h"
-#include "wrapper/vmalloc.h"
#include "ltt-tracer.h"
static
@@ -62,7 +61,7 @@ int lttng_add_procname_to_ctx(struct lttng_ctx **ctx)
field->get_size = procname_get_size;
field->record = procname_record;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return 0;
}
EXPORT_SYMBOL_GPL(lttng_add_procname_to_ctx);
diff --git a/drivers/staging/lttng/lttng-context-tid.c b/drivers/staging/lttng/lttng-context-tid.c
index d5ccdb6..3b2b47d 100644
--- a/drivers/staging/lttng/lttng-context-tid.c
+++ b/drivers/staging/lttng/lttng-context-tid.c
@@ -12,7 +12,6 @@
#include <linux/sched.h>
#include "ltt-events.h"
#include "wrapper/ringbuffer/frontend_types.h"
-#include "wrapper/vmalloc.h"
#include "ltt-tracer.h"
static
@@ -58,7 +57,7 @@ int lttng_add_tid_to_ctx(struct lttng_ctx **ctx)
field->event_field.type.u.basic.integer.encoding = lttng_encode_none;
field->get_size = tid_get_size;
field->record = tid_record;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return 0;
}
EXPORT_SYMBOL_GPL(lttng_add_tid_to_ctx);
diff --git a/drivers/staging/lttng/lttng-context-vpid.c b/drivers/staging/lttng/lttng-context-vpid.c
index 3f16e03..49947be 100644
--- a/drivers/staging/lttng/lttng-context-vpid.c
+++ b/drivers/staging/lttng/lttng-context-vpid.c
@@ -12,7 +12,6 @@
#include <linux/sched.h>
#include "ltt-events.h"
#include "wrapper/ringbuffer/frontend_types.h"
-#include "wrapper/vmalloc.h"
#include "ltt-tracer.h"
static
@@ -64,7 +63,7 @@ int lttng_add_vpid_to_ctx(struct lttng_ctx **ctx)
field->event_field.type.u.basic.integer.encoding = lttng_encode_none;
field->get_size = vpid_get_size;
field->record = vpid_record;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return 0;
}
EXPORT_SYMBOL_GPL(lttng_add_vpid_to_ctx);
diff --git a/drivers/staging/lttng/lttng-context-vppid.c b/drivers/staging/lttng/lttng-context-vppid.c
index f01b020..983537a 100644
--- a/drivers/staging/lttng/lttng-context-vppid.c
+++ b/drivers/staging/lttng/lttng-context-vppid.c
@@ -13,7 +13,6 @@
#include <linux/syscalls.h>
#include "ltt-events.h"
#include "wrapper/ringbuffer/frontend_types.h"
-#include "wrapper/vmalloc.h"
#include "ltt-tracer.h"
static
@@ -69,7 +68,7 @@ int lttng_add_vppid_to_ctx(struct lttng_ctx **ctx)
field->event_field.type.u.basic.integer.encoding = lttng_encode_none;
field->get_size = vppid_get_size;
field->record = vppid_record;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return 0;
}
EXPORT_SYMBOL_GPL(lttng_add_vppid_to_ctx);
diff --git a/drivers/staging/lttng/lttng-context-vtid.c b/drivers/staging/lttng/lttng-context-vtid.c
index 264bbb3..45d7d7e 100644
--- a/drivers/staging/lttng/lttng-context-vtid.c
+++ b/drivers/staging/lttng/lttng-context-vtid.c
@@ -12,7 +12,6 @@
#include <linux/sched.h>
#include "ltt-events.h"
#include "wrapper/ringbuffer/frontend_types.h"
-#include "wrapper/vmalloc.h"
#include "ltt-tracer.h"
static
@@ -64,7 +63,7 @@ int lttng_add_vtid_to_ctx(struct lttng_ctx **ctx)
field->event_field.type.u.basic.integer.encoding = lttng_encode_none;
field->get_size = vtid_get_size;
field->record = vtid_record;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return 0;
}
EXPORT_SYMBOL_GPL(lttng_add_vtid_to_ctx);
diff --git a/drivers/staging/lttng/lttng-syscalls.c b/drivers/staging/lttng/lttng-syscalls.c
index 16624a7f7..0ceb4e3 100644
--- a/drivers/staging/lttng/lttng-syscalls.c
+++ b/drivers/staging/lttng/lttng-syscalls.c
@@ -319,7 +319,7 @@ int lttng_syscalls_register(struct ltt_channel *chan, void *filter)
struct lttng_kernel_event ev;
int ret;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
if (!chan->sc_table) {
/* create syscall table mapping syscall to events */
diff --git a/drivers/staging/lttng/probes/lttng-events.h b/drivers/staging/lttng/probes/lttng-events.h
index ff6273f..16eee9a 100644
--- a/drivers/staging/lttng/probes/lttng-events.h
+++ b/drivers/staging/lttng/probes/lttng-events.h
@@ -10,7 +10,6 @@
#include <linux/debugfs.h>
#include "lttng.h"
#include "lttng-types.h"
-#include "../wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "../wrapper/ringbuffer/frontend_types.h"
#include "../ltt-events.h"
#include "../ltt-tracer-core.h"
@@ -679,7 +678,7 @@ static void __event_probe__##_name(void *__data) \
#ifndef TP_MODULE_OVERRIDE
static int TP_ID(__lttng_events_init__, TRACE_SYSTEM)(void)
{
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return ltt_probe_register(&TP_ID(__probe_desc___, TRACE_SYSTEM));
}
diff --git a/drivers/staging/lttng/probes/lttng-ftrace.c b/drivers/staging/lttng/probes/lttng-ftrace.c
index 1aa7183..7aae75b 100644
--- a/drivers/staging/lttng/probes/lttng-ftrace.c
+++ b/drivers/staging/lttng/probes/lttng-ftrace.c
@@ -23,7 +23,6 @@
#include "../ltt-events.h"
#include "../wrapper/ringbuffer/frontend_types.h"
#include "../wrapper/ftrace.h"
-#include "../wrapper/vmalloc.h"
#include "../ltt-tracer.h"
static
@@ -133,7 +132,7 @@ int lttng_ftrace_register(const char *name,
goto name_error;
/* Ensure the memory we just allocated don't trigger page faults */
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
ret = wrapper_register_ftrace_function_probe(event->u.ftrace.symbol_name,
<tng_ftrace_ops, event);
@@ -169,7 +168,7 @@ EXPORT_SYMBOL_GPL(lttng_ftrace_destroy_private);
int lttng_ftrace_init(void)
{
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
return 0;
}
module_init(lttng_ftrace_init)
diff --git a/drivers/staging/lttng/probes/lttng-kprobes.c b/drivers/staging/lttng/probes/lttng-kprobes.c
index 784002a..d3d43cd 100644
--- a/drivers/staging/lttng/probes/lttng-kprobes.c
+++ b/drivers/staging/lttng/probes/lttng-kprobes.c
@@ -12,7 +12,6 @@
#include <linux/slab.h>
#include "../ltt-events.h"
#include "../wrapper/ringbuffer/frontend_types.h"
-#include "../wrapper/vmalloc.h"
#include "../ltt-tracer.h"
static
@@ -126,7 +125,7 @@ int lttng_kprobes_register(const char *name,
* Well.. kprobes itself puts the page fault handler on the blacklist,
* but we can never be too careful.
*/
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
ret = register_kprobe(&event->u.kprobe.kp);
if (ret)
diff --git a/drivers/staging/lttng/probes/lttng-kretprobes.c b/drivers/staging/lttng/probes/lttng-kretprobes.c
index 6b29101..60aadcd 100644
--- a/drivers/staging/lttng/probes/lttng-kretprobes.c
+++ b/drivers/staging/lttng/probes/lttng-kretprobes.c
@@ -13,7 +13,6 @@
#include <linux/kref.h>
#include "../ltt-events.h"
#include "../wrapper/ringbuffer/frontend_types.h"
-#include "../wrapper/vmalloc.h"
#include "../ltt-tracer.h"
enum lttng_kretprobe_type {
@@ -215,7 +214,7 @@ int lttng_kretprobes_register(const char *name,
* Well.. kprobes itself puts the page fault handler on the blacklist,
* but we can never be too careful.
*/
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
ret = register_kretprobe(<tng_krp->krp);
if (ret)
diff --git a/drivers/staging/lttng/probes/lttng-types.c b/drivers/staging/lttng/probes/lttng-types.c
index 93a9ae5..8b4c071 100644
--- a/drivers/staging/lttng/probes/lttng-types.c
+++ b/drivers/staging/lttng/probes/lttng-types.c
@@ -10,7 +10,6 @@
#include <linux/module.h>
#include <linux/types.h>
-#include "../wrapper/vmalloc.h" /* for wrapper_vmalloc_sync_all() */
#include "../ltt-events.h"
#include "lttng-types.h"
#include <linux/hrtimer.h>
@@ -31,7 +30,7 @@ static int lttng_types_init(void)
{
int ret = 0;
- wrapper_vmalloc_sync_all();
+ vmalloc_sync_all();
/* TODO */
return ret;
}
diff --git a/drivers/staging/lttng/wrapper/vmalloc.h b/drivers/staging/lttng/wrapper/vmalloc.h
deleted file mode 100644
index 765f2ad..0000000
--- a/drivers/staging/lttng/wrapper/vmalloc.h
+++ /dev/null
@@ -1,49 +0,0 @@
-#ifndef _LTT_WRAPPER_VMALLOC_H
-#define _LTT_WRAPPER_VMALLOC_H
-
-/*
- * Copyright (C) 2011 Mathieu Desnoyers (mathieu.desnoyers at 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>
-#include "kallsyms.h"
-
-static inline
-void wrapper_vmalloc_sync_all(void)
-{
- void (*vmalloc_sync_all_sym)(void);
-
- vmalloc_sync_all_sym = (void *) kallsyms_lookup_funcptr("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
-
-#endif /* _LTT_WRAPPER_VMALLOC_H */
--
1.7.5.4
More information about the lttng-dev
mailing list