DEBUG: opentracing: show return values of all functions in the debug output

If the OpenTracing filter is compiled using the 'OT_DEBUG=1' option, then
log messages are printed to stderr when the filter is running.  In the log
one can then find (among other things) the order in which the function is
called and the value that the function returns (if it is not a void type).

Prior to applying this patch, no value returned by a function was logged.

Log output example:
  [ 1]    0.038807 [OT]: flt_ot_init_per_thread(0x56365bd45ec0, 0x56365bd48210) {
  [ 1]    0.038807 [OT]:    ot_start(0x56365bd58920, 0x56365bd4e3a0, 0x7f561acba168:(nil)) {
  [ 1]    0.038807 [OT]:    } = 0
  [ 1]    0.038807 [OT]: } = 0

This patch must be backported as far as 2.4.

(cherry picked from commit ca09e01a137ebb557fbda3edb79dd22922753667)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
(cherry picked from commit 83eb076c3be8ef2eaa61c3b33f219d1decb575cb)
Signed-off-by: Christopher Faulet <cfaulet@haproxy.com>
diff --git a/addons/ot/src/vars.c b/addons/ot/src/vars.c
index a6074c6..d307b52 100644
--- a/addons/ot/src/vars.c
+++ b/addons/ot/src/vars.c
@@ -173,7 +173,7 @@
 	FLT_OT_FUNC("%p, %zu, %p, \"%s\", %p:%p", var_name, size, len, name, FLT_OT_DPTR_ARGS(err));
 
 	if (!FLT_OT_STR_ISVALID(name))
-		FLT_OT_RETURN(retval);
+		FLT_OT_RETURN_INT(retval);
 
 	/*
 	 * In case the name of the variable consists of several elements,
@@ -219,7 +219,7 @@
 	if (retval == -1)
 		*len = retval;
 
-	FLT_OT_RETURN(retval);
+	FLT_OT_RETURN_INT(retval);
 }
 
 
@@ -256,7 +256,7 @@
 	if (retval == -1)
 		FLT_OT_ERR("failed to construct variable name '%s.%s.%s'", scope, prefix, name);
 
-	FLT_OT_RETURN(retval);
+	FLT_OT_RETURN_INT(retval);
 }
 
 
@@ -286,7 +286,7 @@
 
 	var_name_len = flt_ot_var_name(scope, prefix, name, var_name, sizeof(var_name), err);
 	if (var_name_len == -1)
-		FLT_OT_RETURN(retval);
+		FLT_OT_RETURN_INT(retval);
 
 	/* Set <size> to 0 to not release var_name memory in vars_check_arg(). */
 	(void)memset(&arg, 0, sizeof(arg));
@@ -302,7 +302,7 @@
 		retval = var_name_len;
 	}
 
-	FLT_OT_RETURN(retval);
+	FLT_OT_RETURN_INT(retval);
 }
 
 
@@ -335,7 +335,7 @@
 
 	var_name_len = flt_ot_var_name(scope, prefix, name, var_name, sizeof(var_name), err);
 	if (var_name_len == -1)
-		FLT_OT_RETURN(retval);
+		FLT_OT_RETURN_INT(retval);
 
 	flt_ot_smp_init(s, &smp, opt, SMP_T_STR, value);
 
@@ -347,7 +347,7 @@
 		retval = var_name_len;
 	}
 
-	FLT_OT_RETURN(retval);
+	FLT_OT_RETURN_INT(retval);
 }
 
 
@@ -381,11 +381,11 @@
 
 	vars = flt_ot_get_vars(s, scope);
 	if (vars == NULL)
-		FLT_OT_RETURN(retval);
+		FLT_OT_RETURN_INT(retval);
 
 	var_prefix_len = flt_ot_var_name(NULL, prefix, NULL, var_prefix, sizeof(var_prefix), err);
 	if (var_prefix_len == -1)
-		FLT_OT_RETURN(retval);
+		FLT_OT_RETURN_INT(retval);
 
 	retval = 0;
 
@@ -412,7 +412,7 @@
 	}
 	HA_RWLOCK_WRUNLOCK(VARS_LOCK, &(vars->rwlock));
 
-	FLT_OT_RETURN(retval);
+	FLT_OT_RETURN_INT(retval);
 }
 
 
@@ -445,11 +445,11 @@
 
 	vars = flt_ot_get_vars(s, scope);
 	if (vars == NULL)
-		FLT_OT_RETURN(retptr);
+		FLT_OT_RETURN_PTR(retptr);
 
 	rc = flt_ot_var_name(NULL, prefix, NULL, var_name, sizeof(var_name), err);
 	if (rc == -1)
-		FLT_OT_RETURN(retptr);
+		FLT_OT_RETURN_PTR(retptr);
 
 	HA_RWLOCK_RDLOCK(VARS_LOCK, &(vars->rwlock));
 	list_for_each_entry(var, &(vars->head), l) {
@@ -515,7 +515,7 @@
 		otc_text_map_destroy(&retptr, OTC_TEXT_MAP_FREE_KEY | OTC_TEXT_MAP_FREE_VALUE);
 	}
 
-	FLT_OT_RETURN(retptr);
+	FLT_OT_RETURN_PTR(retptr);
 }
 
 /*