[lttng-dev] [LTTNG-TOOLS PATCH] Fix: relayd protocol version

Mathieu Desnoyers mathieu.desnoyers at efficios.com
Mon Aug 5 15:49:23 EDT 2013


* Julien Desfossez (jdesfossez at efficios.com) wrote:
> Since we heritate the relayd protocol version from the sessiond and
> relayd version, use the VERSION macro instead of additionnal fields.

I merged these instead:

commit d83a952ce0d3a03bd3d36505d665db99b2c65fa2
Author: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date:   Mon Aug 5 15:26:41 2013 -0400

    relayd: use version macros from build rather than scanf
    
    Acked-by: Julien Desfossez <jdesfossez at efficios.com>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>

commit 6947778efd60badf06cec2bd5c39d7f96f5ba7ad
Author: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date:   Mon Aug 5 15:24:31 2013 -0400

    sessiond: use version major/minor from build for communication with relayd
    
    Acked-by: Julien Desfossez <jdesfossez at efficios.com>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>

commit 81265501f5370482b1ee9c24d3fa6537c5ca0389
Author: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>
Date:   Mon Aug 5 15:23:27 2013 -0400

    build: export major/minor/patchlevel numbers
    
    Acked-by: Julien Desfossez <jdesfossez at efficios.com>
    Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers at efficios.com>

> 
> Signed-off-by: Julien Desfossez <jdesfossez at efficios.com>
> ---
>  src/bin/lttng-sessiond/cmd.c      |   11 +++++++++--
>  src/common/sessiond-comm/relayd.h |    3 ---
>  2 files changed, 9 insertions(+), 5 deletions(-)
> 
> diff --git a/src/bin/lttng-sessiond/cmd.c b/src/bin/lttng-sessiond/cmd.c
> index 84594ad..07366af 100644
> --- a/src/bin/lttng-sessiond/cmd.c
> +++ b/src/bin/lttng-sessiond/cmd.c
> @@ -491,9 +491,16 @@ static int create_connect_relayd(struct lttng_uri *uri,
>  {
>  	int ret;
>  	struct lttcomm_relayd_sock *rsock;
> +	uint32_t major, minor;
>  
> -	rsock = lttcomm_alloc_relayd_sock(uri, RELAYD_VERSION_COMM_MAJOR,
> -			RELAYD_VERSION_COMM_MINOR);
> +	ret = sscanf(VERSION, "%10u.%10u", &major, &minor);
> +	if (ret < 2) {
> +		ERR("Error in scanning version");
> +		ret = -1;
> +		goto error;
> +	}
> +
> +	rsock = lttcomm_alloc_relayd_sock(uri, major, minor);
>  	if (!rsock) {
>  		ret = LTTNG_ERR_FATAL;
>  		goto error;
> diff --git a/src/common/sessiond-comm/relayd.h b/src/common/sessiond-comm/relayd.h
> index aa99248..836327c 100644
> --- a/src/common/sessiond-comm/relayd.h
> +++ b/src/common/sessiond-comm/relayd.h
> @@ -27,9 +27,6 @@
>  #include <lttng/lttng.h>
>  #include <common/defaults.h>
>  
> -#define RELAYD_VERSION_COMM_MAJOR             2
> -#define RELAYD_VERSION_COMM_MINOR             2
> -
>  /*
>   * lttng-relayd communication header.
>   */
> -- 
> 1.7.10.4
> 

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com



More information about the lttng-dev mailing list