AC_ARG_ENABLE(buffer_useinline,
AS_HELP_STRING([--enable-buffer-useinline],
- [define ISC_BUFFER_USEINLINE when compiling
+ [define ISC_BUFFER_USEINLINE when compiling
[default=yes]]),
if test yes = "${enable}"
then
AC_DEFINE([ISC_BUFFER_USEINLINE], [1],
- [Define if you want to use inline buffers])
+ [Define if you want to use inline buffers])
fi,
AC_DEFINE([ISC_BUFFER_USEINLINE], [1]))
AC_ARG_ENABLE(mutex_atomics,
AS_HELP_STRING([--enable-mutex-atomics],
- [emulate atomics by mutex-locked variables, useful for debugging
+ [emulate atomics by mutex-locked variables, useful for debugging
[default=no]]),
[],
[enable_mutex_atomics=no])
AC_MSG_CHECKING([whether to emulate atomics with mutexes])
case "$enable_mutex_atomics" in
yes)
- AC_MSG_RESULT(yes)
- AC_DEFINE(ISC_MUTEX_ATOMICS, 1, [Define to emulate atomic variables with mutexes.])
- ;;
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(ISC_MUTEX_ATOMICS, 1, [Define to emulate atomic variables with mutexes.])
+ ;;
no)
- AC_MSG_RESULT(no)
- ;;
+ AC_MSG_RESULT(no)
+ ;;
*)
- AC_MSG_ERROR("--enable-mutex-atomics requires yes or no")
- ;;
+ AC_MSG_ERROR("--enable-mutex-atomics requires yes or no")
+ ;;
esac
#
AS_CASE([$with_zlib],
[no],[],
[auto],[PKG_CHECK_MODULES([ZLIB], [zlib],
- [AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])],
- [:])],
+ [AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])],
+ [:])],
[yes],[PKG_CHECK_MODULES([ZLIB], [zlib],
- [AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])])],
+ [AC_DEFINE([HAVE_ZLIB], [1], [Use zlib library])])],
[AC_MSG_ERROR([Specifying zlib installation path is not supported, adjust PKG_CONFIG_PATH instead])])
AC_SUBST([ZLIB_CFLAGS])
AC_SUBST([ZLIB_LIBS])
AC_MSG_NOTICE(using default system tuning)])
#
-# was --enable-querytrace specified?
+# was --enable-querytrace or --enable-singletrace specified?
#
+AC_ARG_ENABLE([singletrace],
+ AS_HELP_STRING([--enable-singletrace],
+ [enable single-query trace logging
+ [default=no]]),
+ enable_singletrace="$enableval", enable_singletrace="no")
+
+AC_MSG_CHECKING([whether to enable single-query trace logging])
+case "$enable_singletrace" in
+yes)
+ enable_querytrace=yes
+ AC_MSG_RESULT(yes)
+ AC_DEFINE(WANT_SINGLETRACE, 1, [Define to enable single-query tracing.])
+ ;;
+no)
+ AC_MSG_RESULT(no)
+ ;;
+*)
+ AC_MSG_ERROR("--enable-singletrace requires yes or no")
+ ;;
+esac
+
AC_ARG_ENABLE(querytrace,
AS_HELP_STRING([--enable-querytrace],
[enable very verbose query trace logging
[default=no]]),
- enable_querytrace="$enableval", enable_querytrace="no")
+ enable_querytrace="$enableval",
+ enable_querytrace="$enable_singletrace")
AC_MSG_CHECKING([whether to enable query trace logging])
case "$enable_querytrace" in
AC_DEFINE(WANT_QUERYTRACE, 1, [Define to enable very verbose query trace logging.])
;;
no)
+ AS_IF([test "$enable_singletrace" = "yes"],
+ [AC_MSG_ERROR([--enable-singletrace requires --enable-querytrace])])
AC_MSG_RESULT(no)
;;
*)
- AC_MSG_ERROR("--enable-querytrace requires yes or no")
+ AC_MSG_ERROR("--enable-querytrace requires yes or no (not $enable_querytrace)")
;;
esac
echo " Allow 'fixed' rrset-order (--enable-fixed-rrset)"
test "yes" = "$enable_querytrace" && \
echo " Very verbose query trace logging (--enable-querytrace)"
+ test "yes" = "$enable_singletrace" && \
+ echo " Single-query trace logging (--enable-singletrace)"
test -z "$HAVE_CMOCKA" || echo " CMocka Unit Testing Framework (--with-cmocka)"
test "auto" = "$validation_default" && echo " DNSSEC validation active by default (--enable-auto-validation)"
test "no" = "$with_dlz_stub" || \
echo " Stub (--with-dlz-stub)"
test "$with_dlz_bdb $with_dlz_ldap $with_dlz_mysql $with_dlz_odbc $with_dlz_postgres $with_dlz_filesystem $with_dlz_stub" = "no no no no no no no" && \
- echo " None"
+ echo " None"
echo "-------------------------------------------------------------------------------"
test "yes" = "$enable_querytrace" || \
echo " Very verbose query trace logging (--enable-querytrace)"
+ test "yes" = "$enable_singletrace" || \
+ echo " Single-query trace logging (--enable-singletrace)"
test "no" = "$with_cmocka" && echo " CMocka Unit Testing Framework (--with-cmocka)"
echo "LDFLAGS: $LDFLAGS"
if test "X$ac_unrecognized_opts" != "X"; then
- echo "-------------------------------------------------------------------------------"
+ echo "-------------------------------------------------------------------------------"
echo "Unrecognized options:"
echo " $ac_unrecognized_opts"
fi
#include <isc/stat.h>
#include <isc/stdio.h>
#include <isc/string.h>
+#include <isc/thread.h>
#include <isc/time.h>
#include <isc/util.h>
#define RDUNLOCK(lp) RWUNLOCK(lp, isc_rwlocktype_read);
#define WRUNLOCK(lp) RWUNLOCK(lp, isc_rwlocktype_write);
+static thread_local bool forcelog = false;
+
/*
* XXXDCL make dynamic?
*/
if (lctx == NULL) {
return (false);
}
+ if (forcelog) {
+ return (true);
+ }
int highest_level = atomic_load_acquire(&lctx->highest_level);
if (level <= highest_level) {
bool printcategory, printmodule, printlevel, buffered;
isc_logchannel_t *channel;
isc_logchannellist_t *category_channels;
+ int_fast32_t dlevel;
isc_result_t result;
REQUIRE(lctx == NULL || VALID_CONTEXT(lctx));
channel = category_channels->channel;
category_channels = ISC_LIST_NEXT(category_channels, link);
- int_fast32_t dlevel = atomic_load_acquire(&lctx->debug_level);
- if (((channel->flags & ISC_LOG_DEBUGONLY) != 0) && dlevel == 0)
- {
- continue;
- }
+ if (!forcelog) {
+ dlevel = atomic_load_acquire(&lctx->debug_level);
+ if (((channel->flags & ISC_LOG_DEBUGONLY) != 0) &&
+ dlevel == 0) {
+ continue;
+ }
- if (channel->level == ISC_LOG_DYNAMIC) {
- if (dlevel < level) {
+ if (channel->level == ISC_LOG_DYNAMIC) {
+ if (dlevel < level) {
+ continue;
+ }
+ } else if (channel->level < level) {
continue;
}
- } else if (channel->level < level) {
- continue;
}
if ((channel->flags & ISC_LOG_PRINTTIME) != 0 &&
UNLOCK(&lctx->lock);
RDUNLOCK(&lctx->lcfg_rwl);
}
+
+void
+isc_log_setforcelog(bool v) {
+ forcelog = v;
+}