Add enable/disable per event/channel/session (new ABI)
[lttng-modules.git] / probes / lttng-kprobes.c
index 89cfe07364779f6a2094979b16c6f039252fac89..38ee4513811691273de7454f0415ee56c6da44ce 100644 (file)
@@ -25,8 +25,13 @@ int lttng_kprobes_handler_pre(struct kprobe *p, struct pt_regs *regs)
        int ret;
        unsigned long data = (unsigned long) p->addr;
 
-       if (!ACCESS_ONCE(chan->session->active))
+       if (unlikely(!ACCESS_ONCE(chan->session->active)))
                return 0;
+       if (unlikely(!ACCESS_ONCE(chan->enabled)))
+               return 0;
+       if (unlikely(!ACCESS_ONCE(event->enabled)))
+               return 0;
+
        lib_ring_buffer_ctx_init(&ctx, chan->chan, event, sizeof(data),
                                 ltt_alignof(data), -1);
        ret = chan->ops->event_reserve(&ctx, event->id);
This page took 0.024356 seconds and 4 git commands to generate.