* Ftrace function tracer does not seem to provide synchronization between probe
* teardown and callback execution. Therefore, we make this module permanently
* loaded (unloadable).
+ *
+ * TODO: Move to register_ftrace_function() (which is exported for
+ * modules) for Linux >= 3.0. It is faster (only enables the selected
+ * functions), and will stay there.
*/
#include <linux/module.h>
} payload;
int ret;
- if (!ACCESS_ONCE(chan->session->active))
+ if (unlikely(!ACCESS_ONCE(chan->session->active)))
+ return;
+ if (unlikely(!ACCESS_ONCE(chan->enabled)))
return;
+ if (unlikely(!ACCESS_ONCE(event->enabled)))
+ return;
+
lib_ring_buffer_ctx_init(&ctx, chan->chan, event,
sizeof(payload), ltt_alignof(payload), -1);
ret = chan->ops->event_reserve(&ctx, event->id);