From: Mathieu Desnoyers Date: Thu, 2 Apr 2020 20:57:48 +0000 (-0400) Subject: Bump LTTNG_UST_ABI version from 8.1 to 9.0 X-Git-Tag: v2.13.0-rc1~514 X-Git-Url: http://git.liburcu.org/?p=lttng-ust.git;a=commitdiff_plain;h=6a359b8a40062865e081cd959ecbef934c761861 Bump LTTNG_UST_ABI version from 8.1 to 9.0 Ensure an older liblttng-ust communicating with a newer liblttng-ust will refuse the handshake, so older session daemon do not get to interact with more recent lttng-ust which implements nested arrays and sequences. Introduce LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE to allow liblttng-ust to be backward compatible with a range of major versions. In this case, liblttng-ust ABI 9.0 is fully backward compatible with 8.x, given that none of the existing ABI in 8.x has changed in 9.0. Signed-off-by: Mathieu Desnoyers --- diff --git a/include/lttng/ust-abi.h b/include/lttng/ust-abi.h index 461e77c2..a823de54 100644 --- a/include/lttng/ust-abi.h +++ b/include/lttng/ust-abi.h @@ -46,8 +46,9 @@ #define LTTNG_UST_COMM_MAGIC 0xC57C57C5 /* Version for ABI between liblttng-ust, sessiond, consumerd */ -#define LTTNG_UST_ABI_MAJOR_VERSION 8 -#define LTTNG_UST_ABI_MINOR_VERSION 1 +#define LTTNG_UST_ABI_MAJOR_VERSION 9 +#define LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE 8 +#define LTTNG_UST_ABI_MINOR_VERSION 0 enum lttng_ust_instrumentation { LTTNG_UST_TRACEPOINT = 0, diff --git a/liblttng-ust-ctl/ustctl.c b/liblttng-ust-ctl/ustctl.c index 914ce94e..ea5ab9dc 100644 --- a/liblttng-ust-ctl/ustctl.c +++ b/liblttng-ust-ctl/ustctl.c @@ -1854,7 +1854,8 @@ int ustctl_recv_reg_msg(int sock, *uint64_t_alignment = reg_msg.uint64_t_alignment; *long_alignment = reg_msg.long_alignment; memcpy(name, reg_msg.name, LTTNG_UST_ABI_PROCNAME_LEN); - if (reg_msg.major != LTTNG_UST_ABI_MAJOR_VERSION) { + if (reg_msg.major < LTTNG_UST_ABI_MAJOR_VERSION_OLDEST_COMPATIBLE || + reg_msg.major > LTTNG_UST_ABI_MAJOR_VERSION) { return -LTTNG_UST_ERR_UNSUP_MAJOR; }