aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDoug Evans <dje@google.com>2021-03-17 09:27:20 -0700
committerDoug Evans <dje@google.com>2021-03-17 09:30:33 -0700
commit0c07defb09d7be6983f6378e1ba7bfd0940a8565 (patch)
tree05651f61f2a376aa8ea4294dbefe934dcfa18f1b
parent84579d030ab42f6d8d462bf2ac1041fff18962d1 (diff)
downloadslirp-0c07defb09d7be6983f6378e1ba7bfd0940a8565.zip
slirp-0c07defb09d7be6983f6378e1ba7bfd0940a8565.tar.gz
slirp-0c07defb09d7be6983f6378e1ba7bfd0940a8565.tar.bz2
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 <dje@google.com>
-rw-r--r--src/debug.h8
-rw-r--r--src/if.c2
-rw-r--r--src/slirp.c1
3 files changed, 10 insertions, 1 deletions
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));
}