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