Namespace private ABI lttng_transport_find symbol
[lttng-ust.git] / liblttng-ust / lttng-ring-buffer-client.h
index 5d9cdc0a703ce894009f117e87a5ea32dc0aa1e2..ad33673774396cb25fe32097ed90c4ff01b48642 100644 (file)
@@ -13,6 +13,7 @@
 #include "ust-bitfield.h"
 #include "ust-compat.h"
 #include "clock.h"
+#include "context-internal.h"
 #include "lttng-tracer.h"
 #include "../libringbuffer/frontend_types.h"
 
@@ -171,8 +172,7 @@ size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config *config,
                                 struct lttng_client_ctx *client_ctx)
 {
        struct lttng_channel *lttng_chan = channel_get_private(chan);
-       struct lttng_event *event = ctx->priv;
-       struct lttng_stack_ctx *lttng_ctx = ctx->priv2;
+       struct lttng_ust_stack_ctx *lttng_ctx = ctx->priv;
        size_t orig_offset = offset;
        size_t padding;
 
@@ -211,19 +211,10 @@ size_t record_header_size(const struct lttng_ust_lib_ring_buffer_config *config,
                padding = 0;
                WARN_ON_ONCE(1);
        }
-       if (lttng_ctx) {
-               /* 2.8+ probe ABI. */
-               offset += ctx_get_aligned_size(offset, lttng_ctx->chan_ctx,
-                               client_ctx->packet_context_len);
-               offset += ctx_get_aligned_size(offset, lttng_ctx->event_ctx,
-                               client_ctx->event_context_len);
-       } else {
-               /* Pre 2.8 probe ABI. */
-               offset += ctx_get_aligned_size(offset, lttng_chan->ctx,
-                               client_ctx->packet_context_len);
-               offset += ctx_get_aligned_size(offset, event->ctx,
-                               client_ctx->event_context_len);
-       }
+       offset += ctx_get_aligned_size(offset, lttng_ctx->chan_ctx,
+                       client_ctx->packet_context_len);
+       offset += ctx_get_aligned_size(offset, lttng_ctx->event_ctx,
+                       client_ctx->event_context_len);
        *pre_header_padding = padding;
        return offset - orig_offset;
 }
@@ -251,8 +242,7 @@ void lttng_write_event_header(const struct lttng_ust_lib_ring_buffer_config *con
                            uint32_t event_id)
 {
        struct lttng_channel *lttng_chan = channel_get_private(ctx->chan);
-       struct lttng_event *event = ctx->priv;
-       struct lttng_stack_ctx *lttng_ctx = ctx->priv2;
+       struct lttng_ust_stack_ctx *lttng_ctx = ctx->priv;
 
        if (caa_unlikely(ctx->rflags))
                goto slow_path;
@@ -287,15 +277,8 @@ void lttng_write_event_header(const struct lttng_ust_lib_ring_buffer_config *con
                WARN_ON_ONCE(1);
        }
 
-       if (lttng_ctx) {
-               /* 2.8+ probe ABI. */
-               ctx_record(ctx, lttng_chan, lttng_ctx->chan_ctx, APP_CTX_ENABLED);
-               ctx_record(ctx, lttng_chan, lttng_ctx->event_ctx, APP_CTX_ENABLED);
-       } else {
-               /* Pre 2.8 probe ABI. */
-               ctx_record(ctx, lttng_chan, lttng_chan->ctx, APP_CTX_DISABLED);
-               ctx_record(ctx, lttng_chan, event->ctx, APP_CTX_DISABLED);
-       }
+       ctx_record(ctx, lttng_chan, lttng_ctx->chan_ctx, APP_CTX_ENABLED);
+       ctx_record(ctx, lttng_chan, lttng_ctx->event_ctx, APP_CTX_ENABLED);
        lib_ring_buffer_align_ctx(ctx, ctx->largest_align);
 
        return;
@@ -310,8 +293,7 @@ void lttng_write_event_header_slow(const struct lttng_ust_lib_ring_buffer_config
                                 uint32_t event_id)
 {
        struct lttng_channel *lttng_chan = channel_get_private(ctx->chan);
-       struct lttng_event *event = ctx->priv;
-       struct lttng_stack_ctx *lttng_ctx = ctx->priv2;
+       struct lttng_ust_stack_ctx *lttng_ctx = ctx->priv;
 
        switch (lttng_chan->header_type) {
        case 1: /* compact */
@@ -368,15 +350,8 @@ void lttng_write_event_header_slow(const struct lttng_ust_lib_ring_buffer_config
        default:
                WARN_ON_ONCE(1);
        }
-       if (lttng_ctx) {
-               /* 2.8+ probe ABI. */
-               ctx_record(ctx, lttng_chan, lttng_ctx->chan_ctx, APP_CTX_ENABLED);
-               ctx_record(ctx, lttng_chan, lttng_ctx->event_ctx, APP_CTX_ENABLED);
-       } else {
-               /* Pre 2.8 probe ABI. */
-               ctx_record(ctx, lttng_chan, lttng_chan->ctx, APP_CTX_DISABLED);
-               ctx_record(ctx, lttng_chan, event->ctx, APP_CTX_DISABLED);
-       }
+       ctx_record(ctx, lttng_chan, lttng_ctx->chan_ctx, APP_CTX_ENABLED);
+       ctx_record(ctx, lttng_chan, lttng_ctx->event_ctx, APP_CTX_ENABLED);
        lib_ring_buffer_align_ctx(ctx, ctx->largest_align);
 }
 
@@ -705,26 +680,15 @@ int lttng_event_reserve(struct lttng_ust_lib_ring_buffer_ctx *ctx,
                      uint32_t event_id)
 {
        struct lttng_channel *lttng_chan = channel_get_private(ctx->chan);
-       struct lttng_event *event = ctx->priv;
-       struct lttng_stack_ctx *lttng_ctx = ctx->priv2;
+       struct lttng_ust_stack_ctx *lttng_ctx = ctx->priv;
        struct lttng_client_ctx client_ctx;
        int ret, cpu;
 
        /* Compute internal size of context structures. */
-
-       if (lttng_ctx) {
-               /* 2.8+ probe ABI. */
-               ctx_get_struct_size(lttng_ctx->chan_ctx, &client_ctx.packet_context_len,
-                               APP_CTX_ENABLED);
-               ctx_get_struct_size(lttng_ctx->event_ctx, &client_ctx.event_context_len,
-                               APP_CTX_ENABLED);
-       } else {
-               /* Pre 2.8 probe ABI. */
-               ctx_get_struct_size(lttng_chan->ctx, &client_ctx.packet_context_len,
-                               APP_CTX_DISABLED);
-               ctx_get_struct_size(event->ctx, &client_ctx.event_context_len,
-                               APP_CTX_DISABLED);
-       }
+       ctx_get_struct_size(lttng_ctx->chan_ctx, &client_ctx.packet_context_len,
+                       APP_CTX_ENABLED);
+       ctx_get_struct_size(lttng_ctx->event_ctx, &client_ctx.event_context_len,
+                       APP_CTX_ENABLED);
 
        cpu = lib_ring_buffer_get_cpu(&client_config);
        if (cpu < 0)
@@ -747,13 +711,10 @@ int lttng_event_reserve(struct lttng_ust_lib_ring_buffer_ctx *ctx,
        ret = lib_ring_buffer_reserve(&client_config, ctx, &client_ctx);
        if (caa_unlikely(ret))
                goto put;
-       if (caa_likely(ctx->ctx_len
-                       >= sizeof(struct lttng_ust_lib_ring_buffer_ctx))) {
-               if (lib_ring_buffer_backend_get_pages(&client_config, ctx,
-                               &ctx->backend_pages)) {
-                       ret = -EPERM;
-                       goto put;
-               }
+       if (lib_ring_buffer_backend_get_pages(&client_config, ctx,
+                       &ctx->backend_pages)) {
+               ret = -EPERM;
+               goto put;
        }
        lttng_write_event_header(&client_config, ctx, event_id);
        return 0;
@@ -831,6 +792,7 @@ int lttng_flush_buffer(struct channel *chan, struct lttng_ust_shm_handle *handle
 static struct lttng_transport lttng_relay_transport = {
        .name = "relay-" RING_BUFFER_MODE_TEMPLATE_STRING "-mmap",
        .ops = {
+               .struct_size = sizeof(struct lttng_ust_channel_ops),
                .channel_create = _channel_create,
                .channel_destroy = lttng_channel_destroy,
                .event_reserve = lttng_event_reserve,
This page took 0.025557 seconds and 4 git commands to generate.