From 74579d3b9664fd1f60c0241cb569c6a2bfee05ff Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 11 Mar 2021 16:00:19 -0500 Subject: [PATCH] Add structure size field to struct lttng_event Made possible by ABI bump. This scheme can be used for extensibility. Signed-off-by: Mathieu Desnoyers Change-Id: I38b15636605339f3f8702983aeaffafa1ab56719 --- include/lttng/ust-events.h | 1 + liblttng-ust/lttng-events.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/lttng/ust-events.h b/include/lttng/ust-events.h index d75a7323..37e5575e 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -395,6 +395,7 @@ struct lttng_bytecode_runtime { struct lttng_ust_event_private; struct lttng_event { + uint32_t struct_size; /* Size of this structure. */ struct lttng_ust_event_private *priv; /* Private event interface */ unsigned int id; diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index b024c4cf..d29a6c71 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -784,6 +784,7 @@ int lttng_event_create(const struct lttng_event_desc *desc, ret = -ENOMEM; goto cache_error; } + event->struct_size = sizeof(struct lttng_event); event_priv = zmalloc(sizeof(struct lttng_ust_event_private)); if (!event_priv) { ret = -ENOMEM; -- 2.34.1