From bd640d74f149ce079f81103221a8aaafca02ce04 Mon Sep 17 00:00:00 2001 From: Mathieu Desnoyers Date: Thu, 11 Mar 2021 16:02:00 -0500 Subject: [PATCH] Add structure size field to struct lttng_session Made possible by ABI bump. This scheme can be used for extensibility. Signed-off-by: Mathieu Desnoyers Change-Id: I8d264969b866e7f06a835731753911718dd09727 --- 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 37e5575e..0e80c282 100644 --- a/include/lttng/ust-events.h +++ b/include/lttng/ust-events.h @@ -559,6 +559,7 @@ struct lttng_ust_session_private; * removed. */ struct lttng_session { + uint32_t struct_size; /* Size of this structure */ struct lttng_ust_session_private *priv; /* Private session interface */ int active; /* Is trace session active ? */ diff --git a/liblttng-ust/lttng-events.c b/liblttng-ust/lttng-events.c index d29a6c71..92f04a3c 100644 --- a/liblttng-ust/lttng-events.c +++ b/liblttng-ust/lttng-events.c @@ -138,6 +138,7 @@ struct lttng_session *lttng_session_create(void) session = zmalloc(sizeof(struct lttng_session)); if (!session) return NULL; + session->struct_size = sizeof(struct lttng_session); session_priv = zmalloc(sizeof(struct lttng_ust_session_private)); if (!session_priv) { free(session); -- 2.34.1