X-Git-Url: https://git.lttng.org/?a=blobdiff_plain;ds=sidebyside;f=src%2Fprobes%2Flttng-kretprobes.c;h=1d0a5ecbe6563c0a17df4b0f50794ad0cc921571;hb=6a35e5bd38fb1a47f57281d349218c7e4aae1da1;hp=7d0db416908f6ba95ff21600d115374a6f9dc477;hpb=6c8c025bf7552b6073c5c1884e1493badd842f42;p=lttng-modules.git diff --git a/src/probes/lttng-kretprobes.c b/src/probes/lttng-kretprobes.c index 7d0db416..1d0a5ecb 100644 --- a/src/probes/lttng-kretprobes.c +++ b/src/probes/lttng-kretprobes.c @@ -14,6 +14,7 @@ #include #include #include +#include #include #include #include @@ -53,15 +54,16 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi, { struct lttng_kernel_event_recorder *event_recorder = container_of(event, struct lttng_kernel_event_recorder, parent); - struct lttng_channel *chan = event_recorder->chan; + struct lttng_kernel_channel_buffer *chan = event_recorder->chan; - if (unlikely(!LTTNG_READ_ONCE(chan->session->active))) + if (unlikely(!LTTNG_READ_ONCE(chan->parent.session->active))) return 0; - if (unlikely(!LTTNG_READ_ONCE(chan->enabled))) + if (unlikely(!LTTNG_READ_ONCE(chan->parent.enabled))) return 0; break; } - case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */ + case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: + lttng_fallthrough; default: WARN_ON_ONCE(1); } @@ -74,7 +76,7 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi, { struct lttng_kernel_event_recorder *event_recorder = container_of(event, struct lttng_kernel_event_recorder, parent); - struct lttng_channel *chan = event_recorder->chan; + struct lttng_kernel_channel_buffer *chan = event_recorder->chan; struct lttng_kernel_ring_buffer_ctx ctx; int ret; @@ -86,12 +88,12 @@ int _lttng_kretprobes_handler(struct kretprobe_instance *krpi, ret = chan->ops->event_reserve(&ctx); if (ret < 0) return 0; - lib_ring_buffer_align_ctx(&ctx, lttng_alignof(payload)); - chan->ops->event_write(&ctx, &payload, sizeof(payload)); + chan->ops->event_write(&ctx, &payload, sizeof(payload), lttng_alignof(payload)); chan->ops->event_commit(&ctx); break; } - case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: /* Fall-through. */ + case LTTNG_KERNEL_EVENT_TYPE_NOTIFIER: + lttng_fallthrough; default: WARN_ON_ONCE(1); }