Move the clock plugin implementation to liblttng-ust-common
[lttng-ust.git] / src / lib / lttng-ust / lttng-ring-buffer-client-template.h
index 14aa2a48bede21ab1aa49de5e77a5864320dff02..e4401c900f82caf7806cab1387e055440d74fcd7 100644 (file)
@@ -14,7 +14,7 @@
 #include <lttng/urcu/pointer.h>
 #include "common/bitfield.h"
 #include "common/align.h"
-#include "clock.h"
+#include "common/clock.h"
 #include "context-internal.h"
 #include "lttng-tracer.h"
 #include "common/ringbuffer/frontend_types.h"
@@ -71,9 +71,9 @@ typedef struct lttng_ust_ring_buffer_ctx_private private_ctx_stack_t[LIB_RING_BU
 static DEFINE_URCU_TLS(private_ctx_stack_t, private_ctx_stack);
 
 /*
- * Force a read (imply TLS fixup for dlopen) of TLS variables.
+ * Force a read (imply TLS allocation for dlopen) of TLS variables.
  */
-void RING_BUFFER_MODE_TEMPLATE_TLS_FIXUP(void)
+void RING_BUFFER_MODE_TEMPLATE_ALLOC_TLS(void)
 {
        asm volatile ("" : : "m" (URCU_TLS(private_ctx_stack)));
 }
@@ -98,7 +98,8 @@ size_t ctx_get_aligned_size(size_t offset, struct lttng_ust_ctx *ctx,
 }
 
 static inline
-void ctx_get_struct_size(struct lttng_ust_ctx *ctx, size_t *ctx_len)
+void ctx_get_struct_size(struct lttng_ust_ring_buffer_ctx *bufctx,
+               struct lttng_ust_ctx *ctx, size_t *ctx_len)
 {
        int i;
        size_t offset = 0;
@@ -108,7 +109,7 @@ void ctx_get_struct_size(struct lttng_ust_ctx *ctx, size_t *ctx_len)
                return;
        }
        for (i = 0; i < ctx->nr_fields; i++)
-               offset += ctx->fields[i].get_size(ctx->fields[i].priv, offset);
+               offset += ctx->fields[i].get_size(ctx->fields[i].priv, bufctx->probe_ctx, offset);
        *ctx_len = offset;
 }
 
@@ -123,7 +124,7 @@ void ctx_record(struct lttng_ust_ring_buffer_ctx *bufctx,
                return;
        lttng_ust_ring_buffer_align_ctx(bufctx, ctx->largest_align);
        for (i = 0; i < ctx->nr_fields; i++)
-               ctx->fields[i].record(ctx->fields[i].priv, bufctx, chan);
+               ctx->fields[i].record(ctx->fields[i].priv, bufctx->probe_ctx, bufctx, chan);
 }
 
 /*
@@ -690,8 +691,8 @@ int lttng_event_reserve(struct lttng_ust_ring_buffer_ctx *ctx)
        client_ctx.chan_ctx = lttng_ust_rcu_dereference(lttng_chan->priv->ctx);
        client_ctx.event_ctx = lttng_ust_rcu_dereference(event_recorder->priv->ctx);
        /* Compute internal size of context structures. */
-       ctx_get_struct_size(client_ctx.chan_ctx, &client_ctx.packet_context_len);
-       ctx_get_struct_size(client_ctx.event_ctx, &client_ctx.event_context_len);
+       ctx_get_struct_size(ctx, client_ctx.chan_ctx, &client_ctx.packet_context_len);
+       ctx_get_struct_size(ctx, client_ctx.event_ctx, &client_ctx.event_context_len);
 
        nesting = lib_ring_buffer_nesting_inc(&client_config);
        if (nesting < 0)
This page took 0.024048 seconds and 4 git commands to generate.