lttng-ftrace module can be unloaded safely
[deliverable/lttng-modules.git] / probes / lttng-ftrace.c
index da6d79c1078ae537f7d1f3d63a89c0275c9d5321..7637e4b54dff1b1f1effda651ee3587e335ec03c 100644 (file)
@@ -38,7 +38,7 @@ void lttng_ftrace_handler(unsigned long ip, unsigned long parent_ip, void **data
                return;
        lib_ring_buffer_ctx_init(&ctx, chan->chan, NULL,
                                 sizeof(payload), ltt_alignof(payload), -1);
-       ret = chan->ops->event_reserve(&ctx);
+       ret = chan->ops->event_reserve(&ctx, event->id);
        if (ret < 0)
                return;
        payload.ip = ip;
@@ -152,7 +152,6 @@ void lttng_ftrace_unregister(struct ltt_event *event)
 }
 EXPORT_SYMBOL_GPL(lttng_ftrace_unregister);
 
-/* This module is permanent. */
 int lttng_ftrace_init(void)
 {
        wrapper_vmalloc_sync_all();
@@ -160,6 +159,15 @@ int lttng_ftrace_init(void)
 }
 module_init(lttng_ftrace_init)
 
+/*
+ * Ftrace takes care of waiting for a grace period (RCU sched) at probe
+ * unregistration, and disables preemption around probe call.
+ */
+void lttng_ftrace_exit(void)
+{
+}
+module_exit(lttng_ftrace_exit)
+
 MODULE_LICENSE("GPL and additional rights");
 MODULE_AUTHOR("Mathieu Desnoyers");
 MODULE_DESCRIPTION("Linux Trace Toolkit Ftrace Support");
This page took 0.02489 seconds and 5 git commands to generate.