Rename "tsc" to "timestamp"
[lttng-modules.git] / src / lttng-context-user-ns.c
index f774d9716487f23c22c56621a7c1065c60ecf77b..f7ee3f913234c9ecc7de246488e5b385e4317182 100644 (file)
@@ -9,6 +9,8 @@
  *
  */
 
+#ifdef CONFIG_USER_NS
+
 #include <linux/module.h>
 #include <linux/slab.h>
 #include <linux/sched.h>
 #include <lttng/events-internal.h>
 #include <ringbuffer/frontend_types.h>
 #include <wrapper/vmalloc.h>
-#include <wrapper/namespace.h>
 #include <lttng/tracer.h>
 
-#if defined(CONFIG_USER_NS) && \
-       (LTTNG_LINUX_VERSION_CODE >= LTTNG_KERNEL_VERSION(3,8,0))
-
 static
-size_t user_ns_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t offset)
+size_t user_ns_get_size(void *priv, struct lttng_kernel_probe_ctx *probe_ctx, size_t offset)
 {
        size_t size = 0;
 
@@ -34,28 +32,27 @@ size_t user_ns_get_size(void *priv, struct lttng_probe_ctx *probe_ctx, size_t of
 }
 
 static
-void user_ns_record(void *priv, struct lttng_probe_ctx *probe_ctx,
-                struct lib_ring_buffer_ctx *ctx,
-                struct lttng_channel *chan)
+void user_ns_record(void *priv, struct lttng_kernel_probe_ctx *probe_ctx,
+                struct lttng_kernel_ring_buffer_ctx *ctx,
+                struct lttng_kernel_channel_buffer *chan)
 {
        unsigned int user_ns_inum = 0;
 
        if (current_user_ns())
-               user_ns_inum = current_user_ns()->lttng_ns_inum;
+               user_ns_inum = current_user_ns()->ns.inum;
 
-       lib_ring_buffer_align_ctx(ctx, lttng_alignof(user_ns_inum));
-       chan->ops->event_write(ctx, &user_ns_inum, sizeof(user_ns_inum));
+       chan->ops->event_write(ctx, &user_ns_inum, sizeof(user_ns_inum), lttng_alignof(user_ns_inum));
 }
 
 static
 void user_ns_get_value(void *priv,
-               struct lttng_probe_ctx *lttng_probe_ctx,
+               struct lttng_kernel_probe_ctx *lttng_probe_ctx,
                struct lttng_ctx_value *value)
 {
        unsigned int user_ns_inum = 0;
 
        if (current_user_ns())
-               user_ns_inum = current_user_ns()->lttng_ns_inum;
+               user_ns_inum = current_user_ns()->ns.inum;
 
        value->u.s64 = user_ns_inum;
 }
@@ -63,7 +60,7 @@ void user_ns_get_value(void *priv,
 static const struct lttng_kernel_ctx_field *ctx_field = lttng_kernel_static_ctx_field(
        lttng_kernel_static_event_field("user_ns",
                lttng_kernel_static_type_integer_from_type(unsigned int, __BYTE_ORDER, 10),
-               false, false, false),
+               false, false),
        user_ns_get_size,
        user_ns_record,
        user_ns_get_value,
This page took 0.02435 seconds and 4 git commands to generate.