X-Git-Url: http://git.liburcu.org/?a=blobdiff_plain;f=probes%2Flttng-kprobes.c;h=38ee4513811691273de7454f0415ee56c6da44ce;hb=c9604bd31e116434dbcf95503952dc1790462bc0;hp=9dd3569b4a794d59f5a7cbec2a060fb1d3cd9a6f;hpb=edeb3137b6064818f310567ded5c60e442a933e6;p=lttng-modules.git diff --git a/probes/lttng-kprobes.c b/probes/lttng-kprobes.c index 9dd3569b..38ee4513 100644 --- a/probes/lttng-kprobes.c +++ b/probes/lttng-kprobes.c @@ -25,9 +25,14 @@ 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; - lib_ring_buffer_ctx_init(&ctx, chan->chan, NULL, sizeof(data), + 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); if (ret < 0) @@ -67,7 +72,7 @@ int lttng_create_kprobe_event(const char *name, struct ltt_event *event) field->type.atype = atype_integer; field->type.u.basic.integer.size = sizeof(unsigned long) * CHAR_BIT; field->type.u.basic.integer.alignment = ltt_alignof(unsigned long) * CHAR_BIT; - field->type.u.basic.integer.signedness = 0; + field->type.u.basic.integer.signedness = is_signed_type(unsigned long); field->type.u.basic.integer.reverse_byte_order = 0; field->type.u.basic.integer.base = 16; field->type.u.basic.integer.encoding = lttng_encode_none;