Remove event context dead code
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Thu, 27 Jan 2022 20:36:45 +0000 (15:36 -0500)
committerMathieu Desnoyers <mathieu.desnoyers@efficios.com>
Fri, 12 Jul 2024 15:39:52 +0000 (11:39 -0400)
The event context is never wired up by the lttng ust abi, so it is never
actually used. Remove this dead code which adds complexity for no
reason.

This code is all internal to lttng-ust (not exposed to probe providers),
which makes it easy to add this back if needed in the future.

Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com>
Change-Id: I52e93835ffe6d3040ead7fb8d3113ab20a555019

src/common/events.h
src/common/ringbuffer-clients/template.h
src/lib/lttng-ust/lttng-events.c

index c8d370463383920d022a515641a4ce9d21775101..a7ede2008750e901cae7047499c96cc41eb1fc4d 100644 (file)
@@ -307,8 +307,6 @@ struct lttng_ust_event_common_private {
 struct lttng_ust_event_session_common_private {
        struct lttng_ust_event_common_private parent;
 
-       struct lttng_ust_ctx *ctx;
-
        struct lttng_ust_channel_common *chan;
 
        uint64_t id;                            /* Event id */
index 96c55d8bbfb4562c1c81f5ae01a8903d2291fadb..2ebcbf6d5fc8195e82ddec7ea02d394ca2c2113f 100644 (file)
@@ -60,7 +60,6 @@ struct lttng_client_ctx {
        size_t packet_context_len;
        size_t event_context_len;
        struct lttng_ust_ctx *chan_ctx;
-       struct lttng_ust_ctx *event_ctx;
 };
 
 /*
@@ -189,8 +188,6 @@ size_t record_header_size(
        }
        offset += ctx_get_aligned_size(offset, client_ctx->chan_ctx,
                        client_ctx->packet_context_len);
-       offset += ctx_get_aligned_size(offset, client_ctx->event_ctx,
-                       client_ctx->event_context_len);
        *pre_header_padding = padding;
        return offset - orig_offset;
 }
@@ -255,7 +252,6 @@ void lttng_write_event_header(const struct lttng_ust_ring_buffer_config *config,
        }
 
        ctx_record(ctx, lttng_chan, client_ctx->chan_ctx);
-       ctx_record(ctx, lttng_chan, client_ctx->event_ctx);
        lttng_ust_ring_buffer_align_ctx(ctx, ctx->largest_align);
 
        return;
@@ -329,7 +325,6 @@ void lttng_write_event_header_slow(const struct lttng_ust_ring_buffer_config *co
                WARN_ON_ONCE(1);
        }
        ctx_record(ctx, lttng_chan, client_ctx->chan_ctx);
-       ctx_record(ctx, lttng_chan, client_ctx->event_ctx);
        lttng_ust_ring_buffer_align_ctx(ctx, ctx->largest_align);
 }
 
@@ -689,10 +684,8 @@ int lttng_event_reserve(struct lttng_ust_ring_buffer_ctx *ctx)
 
        event_id = (uint32_t) event_recorder->priv->parent.id;
        client_ctx.chan_ctx = lttng_ust_rcu_dereference(lttng_chan->priv->ctx);
-       client_ctx.event_ctx = lttng_ust_rcu_dereference(event_recorder->priv->parent.ctx);
        /* Compute internal size of context structures. */
        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)
index dae92cb52bbeaf0ac2bd8a90c8439db82f425eb5..b45e670b05f9a5690212af91da076a5e65d7100f 100644 (file)
@@ -1585,20 +1585,6 @@ void _lttng_event_destroy(struct lttng_ust_event_common *event)
        /* Remove from event hash table. */
        cds_hlist_del(&event->priv->name_hlist_node);
 
-       switch (event->type) {
-       case LTTNG_UST_EVENT_TYPE_RECORDER:
-       {
-               struct lttng_ust_event_session_common_private *event_session_priv =
-                       caa_container_of(event->priv, struct lttng_ust_event_session_common_private, parent);
-
-               lttng_destroy_context(event_session_priv->ctx);
-               break;
-       }
-       case LTTNG_UST_EVENT_TYPE_NOTIFIER:
-               break;
-       default:
-               abort();
-       }
        lttng_ust_event_free(event);
 }
 
@@ -2159,7 +2145,6 @@ void lttng_ust_context_set_session_provider(const char *name,
 
        cds_list_for_each_entry(session_priv, &sessions, node) {
                struct lttng_ust_channel_buffer_private *chan;
-               struct lttng_ust_event_common_private *event_priv;
                int ret;
 
                ret = lttng_ust_context_set_provider_rcu(&session_priv->ctx,
@@ -2172,15 +2157,6 @@ void lttng_ust_context_set_session_provider(const char *name,
                        if (ret)
                                abort();
                }
-               cds_list_for_each_entry(event_priv, &session_priv->events_head, node) {
-                       struct lttng_ust_event_session_common_private *event_session_priv =
-                               caa_container_of(event_priv, struct lttng_ust_event_session_common_private, parent);
-
-                       ret = lttng_ust_context_set_provider_rcu(&event_session_priv->ctx,
-                                       name, get_size, record, get_value);
-                       if (ret)
-                               abort();
-               }
        }
 }
 
This page took 0.027088 seconds and 4 git commands to generate.