int tstate:1; /* Transient enable state */
};
-#define LTTNG_UST_STACK_CTX_PADDING 32
-struct lttng_stack_ctx {
+/*
+ * IMPORTANT: this structure is part of the ABI between the probe and
+ * UST. Fields need to be only added at the end, never reordered, never
+ * removed.
+ *
+ * The field @struct_size should be used to determine the size of the
+ * structure. It should be queried before using additional fields added
+ * at the end of the structure.
+ */
+struct lttng_ust_stack_ctx {
+ uint32_t struct_size; /* Size of this structure */
+
struct lttng_ust_event_recorder *event_recorder;
struct lttng_ctx *chan_ctx; /* RCU dereferenced. */
struct lttng_ctx *event_ctx; /* RCU dereferenced. */
- char padding[LTTNG_UST_STACK_CTX_PADDING];
+
+ /* End of base ABI. Fields below should be used after checking struct_size. */
};
struct lttng_ust_session_private;
struct lttng_ust_event_recorder *__event_recorder = (struct lttng_ust_event_recorder *) __event->child; \
struct lttng_channel *__chan = __event_recorder->chan; \
struct lttng_ust_lib_ring_buffer_ctx __ctx; \
- struct lttng_stack_ctx __lttng_ctx; \
+ struct lttng_ust_stack_ctx __lttng_ctx; \
\
__event_len = __event_get_size__##_provider##___##_name(__stackvar.__dynamic_len, \
_TP_ARGS_DATA_VAR(_args)); \
__event_align = __event_get_align__##_provider##___##_name(_TP_ARGS_VAR(_args)); \
memset(&__lttng_ctx, 0, sizeof(__lttng_ctx)); \
+ __lttng_ctx.struct_size = sizeof(struct lttng_ust_stack_ctx); \
__lttng_ctx.event_recorder = __event_recorder; \
__lttng_ctx.chan_ctx = tp_rcu_dereference(__chan->ctx); \
__lttng_ctx.event_ctx = tp_rcu_dereference(__event_recorder->ctx); \
struct lttng_client_ctx *client_ctx)
{
struct lttng_channel *lttng_chan = channel_get_private(chan);
- struct lttng_stack_ctx *lttng_ctx = ctx->priv;
+ struct lttng_ust_stack_ctx *lttng_ctx = ctx->priv;
size_t orig_offset = offset;
size_t padding;
uint32_t event_id)
{
struct lttng_channel *lttng_chan = channel_get_private(ctx->chan);
- struct lttng_stack_ctx *lttng_ctx = ctx->priv;
+ struct lttng_ust_stack_ctx *lttng_ctx = ctx->priv;
if (caa_unlikely(ctx->rflags))
goto slow_path;
uint32_t event_id)
{
struct lttng_channel *lttng_chan = channel_get_private(ctx->chan);
- struct lttng_stack_ctx *lttng_ctx = ctx->priv;
+ struct lttng_ust_stack_ctx *lttng_ctx = ctx->priv;
switch (lttng_chan->header_type) {
case 1: /* compact */
uint32_t event_id)
{
struct lttng_channel *lttng_chan = channel_get_private(ctx->chan);
- struct lttng_stack_ctx *lttng_ctx = ctx->priv;
+ struct lttng_ust_stack_ctx *lttng_ctx = ctx->priv;
struct lttng_client_ctx client_ctx;
int ret, cpu;