Rename struct lib_ring_buffer_ctx to struct lttng_kernel_ring_buffer_ctx
[lttng-modules.git] / src / lttng-context-preemptible.c
index 67c155a245741b1fff7f9d9905107abe89ec727d..ac9aab5932e49ff6c59f09799ed643043e9cb99e 100644 (file)
@@ -12,6 +12,7 @@
 #include <linux/sched.h>
 #include <linux/irqflags.h>
 #include <lttng/events.h>
+#include <lttng/events-internal.h>
 #include <ringbuffer/frontend_types.h>
 #include <wrapper/vmalloc.h>
 #include <lttng/tracer.h>
@@ -25,7 +26,7 @@
 #define LTTNG_PREEMPT_DISABLE_NESTING  2
 
 static
-size_t preemptible_get_size(size_t offset)
+size_t preemptible_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_t offset)
 {
        size_t size = 0;
 
@@ -35,8 +36,8 @@ size_t preemptible_get_size(size_t offset)
 }
 
 static
-void preemptible_record(struct lttng_kernel_ctx_field *field,
-               struct lib_ring_buffer_ctx *ctx,
+void preemptible_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
+               struct lttng_kernel_ring_buffer_ctx *ctx,
                struct lttng_channel *chan)
 {
        int pc = preempt_count();
@@ -50,17 +51,17 @@ void preemptible_record(struct lttng_kernel_ctx_field *field,
 }
 
 static
-void preemptible_get_value(struct lttng_kernel_ctx_field *field,
-               struct lttng_probe_ctx *lttng_probe_ctx,
-               union lttng_ctx_value *value)
+void preemptible_get_value(void *priv,
+               struct lttng_kernel_probe_ctx *lttng_probe_ctx,
+               struct lttng_ctx_value *value)
 {
        int pc = preempt_count();
 
        WARN_ON_ONCE(pc < LTTNG_PREEMPT_DISABLE_NESTING);
        if (pc == LTTNG_PREEMPT_DISABLE_NESTING)
-               value->s64 = 1;
+               value->u.s64 = 1;
        else
-               value->s64 = 0;
+               value->u.s64 = 0;
 }
 
 static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
@@ -68,7 +69,6 @@ static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_
                lttng_kernel_static_type_integer_from_type(uint8_t, __BYTE_ORDER, 10),
                false, false, false),
        preemptible_get_size,
-       NULL,
        preemptible_record,
        preemptible_get_value,
        NULL, NULL);
This page took 0.023991 seconds and 4 git commands to generate.