From 0c07defb09d7be6983f6378e1ba7bfd0940a8565 Mon Sep 17 00:00:00 2001 From: Doug Evans Date: Wed, 17 Mar 2021 09:27:20 -0700 Subject: Move DEBUG_CALL("if_start") to DEBUG_VERBOSE_CALL This debugging printf reduces the overall S/N ratio of debug output in the normal case, so separate it out. Signed-off-by: Doug Evans --- src/debug.h | 8 ++++++++ src/if.c | 2 +- src/slirp.c | 1 + 3 files changed, 10 insertions(+), 1 deletion(-) diff --git a/src/debug.h b/src/debug.h index 47712bd..0f9f3ef 100644 --- a/src/debug.h +++ b/src/debug.h @@ -10,6 +10,7 @@ #define DBG_MISC (1 << 1) #define DBG_ERROR (1 << 2) #define DBG_TFTP (1 << 3) +#define DBG_VERBOSE_CALL (1 << 4) extern int slirp_debug; @@ -20,6 +21,13 @@ extern int slirp_debug; } \ } while (0) +#define DEBUG_VERBOSE_CALL(fmt, ...) \ + do { \ + if (G_UNLIKELY(slirp_debug & DBG_VERBOSE_CALL)) { \ + g_debug(fmt "...", ##__VA_ARGS__); \ + } \ + } while (0) + #define DEBUG_ARG(fmt, ...) \ do { \ if (G_UNLIKELY(slirp_debug & DBG_CALL)) { \ diff --git a/src/if.c b/src/if.c index 23190b5..83dcae3 100644 --- a/src/if.c +++ b/src/if.c @@ -143,7 +143,7 @@ void if_start(Slirp *slirp) bool from_batchq = false; struct mbuf *ifm, *ifm_next, *ifqt; - DEBUG_CALL("if_start"); + DEBUG_VERBOSE_CALL("if_start"); if (slirp->if_start_busy) { return; diff --git a/src/slirp.c b/src/slirp.c index 110e6fc..60f8802 100644 --- a/src/slirp.c +++ b/src/slirp.c @@ -362,6 +362,7 @@ static void slirp_init_once(void) { "misc", DBG_MISC }, { "error", DBG_ERROR }, { "tftp", DBG_TFTP }, + { "verbose_call", DBG_VERBOSE_CALL }, }; slirp_debug = g_parse_debug_string(debug, keys, G_N_ELEMENTS(keys)); } -- cgit v1.1