X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;f=probes%2Flttng-kprobes.c;h=38ee4513811691273de7454f0415ee56c6da44ce;hb=e64957da15e3652322dcf6a5389beb01901de8e6;hp=89cfe07364779f6a2094979b16c6f039252fac89;hpb=a33e44a60b7128349043753e53affba8ebc40716;p=lttng-modules.git diff --git a/probes/lttng-kprobes.c b/probes/lttng-kprobes.c index 89cfe073..38ee4513 100644 --- a/probes/lttng-kprobes.c +++ b/probes/lttng-kprobes.c @@ -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);