From: Mathieu Desnoyers Date: Thu, 11 Mar 2021 21:00:19 +0000 (-0500) Subject: Add structure size field to struct lttng_event X-Git-Tag: v2.13.0-rc1~309 X-Git-Url: https://git.lttng.org/?a=commitdiff_plain;h=74579d3b9664fd1f60c0241cb569c6a2bfee05ff;p=lttng-ust.git 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 --- 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;