From e3fe89c802e6a856bc5bbbc89ba22fcbe442d220 Mon Sep 17 00:00:00 2001 From: Willem Toorop Date: Thu, 2 Jul 2015 12:49:50 +0200 Subject: [PATCH] Turn on specific debugging with configure options --- configure | 67 +++++++++++++++++++++++++++++++++++++++++++++ configure.ac | 25 +++++++++++++++++ src/config.h.in | 9 ++++++ src/util-internal.h | 5 +--- 4 files changed, 102 insertions(+), 4 deletions(-) diff --git a/configure b/configure index b9b00f3e..c86c59fe 100755 --- a/configure +++ b/configure @@ -759,6 +759,9 @@ with_gnu_ld with_sysroot enable_libtool_lock enable_rpath +enable_debug_sched +enable_debug_stub +enable_debug_sec enable_tcp_fastopen enable_native_stub_dnssec with_ssl @@ -1405,6 +1408,9 @@ Optional Features: optimize for fast installation [default=yes] --disable-libtool-lock avoid locking (might break parallel builds) --disable-rpath disable hardcoded rpath (default=enabled) + --enable-debug-sched Enable scheduling debugging messages + --enable-debug-stub Enable stub debugging messages + --enable-debug-sec Enable dnssec debugging messages --enable-tcp-fastopen Enable TCP Fast Open --disable-native-stub-dnssec Disable native stub DNSSEC support @@ -11710,6 +11716,55 @@ if test "x$enable_rpath" = xno; then fi +# Check whether --enable-debug-sched was given. +if test "${enable_debug_sched+set}" = set; then : + enableval=$enable_debug_sched; +fi + +case "$enable_debug_sched" in + yes) + +cat >>confdefs.h <<_ACEOF +#define SCHED_DEBUG 1 +_ACEOF + + ;; + no|*) + ;; +esac +# Check whether --enable-debug-stub was given. +if test "${enable_debug_stub+set}" = set; then : + enableval=$enable_debug_stub; +fi + +case "$enable_debug_stub" in + yes) + +cat >>confdefs.h <<_ACEOF +#define STUB_DEBUG 1 +_ACEOF + + ;; + no|*) + ;; +esac +# Check whether --enable-debug-sec was given. +if test "${enable_debug_sec+set}" = set; then : + enableval=$enable_debug_sec; +fi + +case "$enable_debug_sec" in + yes) + +cat >>confdefs.h <<_ACEOF +#define SEC_DEBUG 1 +_ACEOF + + ;; + no|*) + ;; +esac + # Check whether --enable-tcp-fastopen was given. if test "${enable_tcp_fastopen+set}" = set; then : enableval=$enable_tcp_fastopen; @@ -11737,6 +11792,18 @@ _ACEOF ;; esac +# Not yet enabled by default as crash found when TCP fails. +# AC_ARG_ENABLE(tcp-fastopen, AC_HELP_STRING([--disable-tcp-fastopen], Disable TCP Fast Open (default=enabled if available)), +# enable_tcp_fastopen="$enableval", enable_tcp_fastopen=yes) +# if test "x$enable_tcp_fastopen" = xno; then +# AC_MSG_WARN([TCP Fast Open is disabled]) +# else +# AC_CHECK_DECL([MSG_FASTOPEN], [AC_DEFINE_UNQUOTED([USE_TCP_FASTOPEN], [1], [Define this to enable TCP fast open.])], +# [AC_MSG_WARN([TCP Fast Open is not available.])], [AC_INCLUDES_DEFAULT +# #include +# ]) +# fi + # Check whether --enable-native-stub-dnssec was given. if test "${enable_native_stub_dnssec+set}" = set; then : enableval=$enable_native_stub_dnssec; diff --git a/configure.ac b/configure.ac index e766900f..48bb3997 100644 --- a/configure.ac +++ b/configure.ac @@ -120,6 +120,31 @@ fi ]) ACX_ARG_RPATH +AC_ARG_ENABLE(debug-sched, AC_HELP_STRING([--enable-debug-sched], [Enable scheduling debugging messages])) +case "$enable_debug_sched" in + yes) + AC_DEFINE_UNQUOTED([SCHED_DEBUG], [1], [Define this to enable printing of scheduling debugging messages.]) + ;; + no|*) + ;; +esac +AC_ARG_ENABLE(debug-stub, AC_HELP_STRING([--enable-debug-stub], [Enable stub debugging messages])) +case "$enable_debug_stub" in + yes) + AC_DEFINE_UNQUOTED([STUB_DEBUG], [1], [Define this to enable printing of stub debugging messages.]) + ;; + no|*) + ;; +esac +AC_ARG_ENABLE(debug-sec, AC_HELP_STRING([--enable-debug-sec], [Enable dnssec debugging messages])) +case "$enable_debug_sec" in + yes) + AC_DEFINE_UNQUOTED([SEC_DEBUG], [1], [Define this to enable printing of dnssec debugging messages.]) + ;; + no|*) + ;; +esac + AC_ARG_ENABLE(tcp-fastopen, AC_HELP_STRING([--enable-tcp-fastopen], [Enable TCP Fast Open])) case "$enable_tcp_fastopen" in yes) diff --git a/src/config.h.in b/src/config.h.in index ff26526c..d4232d83 100644 --- a/src/config.h.in +++ b/src/config.h.in @@ -189,9 +189,18 @@ /* Define as the return type of signal handlers (`int' or `void'). */ #undef RETSIGTYPE +/* Define this to enable printing of scheduling debugging messages. */ +#undef SCHED_DEBUG + +/* Define this to enable printing of dnssec debugging messages. */ +#undef SEC_DEBUG + /* Define to 1 if you have the ANSI C header files. */ #undef STDC_HEADERS +/* Define this to enable printing of stub debugging messages. */ +#undef STUB_DEBUG + /* Define this to enable native stub DNSSEC support. */ #undef STUB_NATIVE_DNSSEC diff --git a/src/util-internal.h b/src/util-internal.h index 5963fecf..a66ea4e9 100644 --- a/src/util-internal.h +++ b/src/util-internal.h @@ -38,13 +38,10 @@ #ifndef UTIL_INTERNAL_H #define UTIL_INTERNAL_H +#include "config.h" #include "context.h" #include "rr-iter.h" -#define SCHED_DEBUG 0 -#define WIRE_DEBUG 0 -#define STUB_DEBUG 0 -#define SEC_DEBUG 1 #ifdef S_SPLINT_S # define INLINE