From: Willy Tarreau Date: Thu, 27 Apr 2023 16:05:38 +0000 (+0200) Subject: BUG/MINOR: opentracing: use 'date' instead of 'now' in debug output X-Git-Tag: v2.8-dev9~23 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=64651d176915a461a8ae13c40df334a451c7e36f;p=thirdparty%2Fhaproxy.git BUG/MINOR: opentracing: use 'date' instead of 'now' in debug output The filter was using "now" in visible output in debug mode, that's not correct, we should rather use "date" since it's visible. No backport is needed as it was mostly emphasized by commit 28360dc ("MEDIUM: clock: force internal time to wrap early after boot") in 2.8.. --- diff --git a/addons/ot/include/debug.h b/addons/ot/include/debug.h index 6274961014..c749960c8f 100644 --- a/addons/ot/include/debug.h +++ b/addons/ot/include/debug.h @@ -26,9 +26,9 @@ #ifdef DEBUG_OT # ifdef DEBUG_OT_SYSTIME -# define FLT_OT_DBG_FMT(f) "[% 2d] %ld.%06ld [" FLT_OT_SCOPE "]: " f, tid, now.tv_sec, now.tv_usec +# define FLT_OT_DBG_FMT(f) "[% 2d] %ld.%06ld [" FLT_OT_SCOPE "]: " f, tid, date.tv_sec, date.tv_usec # else -# define FLT_OT_DBG_FMT(f) "[% 2d] %11.6f [" FLT_OT_SCOPE "]: " f, tid, FLT_OT_TV_UDIFF(&(flt_ot_debug.start), &now) / 1e6 +# define FLT_OT_DBG_FMT(f) "[% 2d] %11.6f [" FLT_OT_SCOPE "]: " f, tid, FLT_OT_TV_UDIFF(&(flt_ot_debug.start), &date) / 1e6 # endif # define FLT_OT_DBG_INDENT " " # define FLT_OT_DBG(l,f, ...) \ diff --git a/addons/ot/src/parser.c b/addons/ot/src/parser.c index 1fd7007ff8..3607e48c9f 100644 --- a/addons/ot/src/parser.c +++ b/addons/ot/src/parser.c @@ -1134,7 +1134,7 @@ static int flt_ot_parse(char **args, int *cur_arg, struct proxy *px, struct flt_ #ifdef DEBUG_OT FLT_OT_RUN_ONCE( # ifndef DEBUG_OT_SYSTIME - (void)memcpy(&(flt_ot_debug.start), &now, sizeof(flt_ot_debug.start)); + (void)memcpy(&(flt_ot_debug.start), &date, sizeof(flt_ot_debug.start)); # endif flt_ot_debug.level = FLT_OT_DEBUG_LEVEL;