From: Alessio Podda Date: Thu, 19 Jun 2025 12:49:53 +0000 (+0200) Subject: Change QP and qpcache logging from DEBUG(1) to DEBUG(3) X-Git-Tag: v9.21.10~23^2 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ef95806e0571a6871a79217eec477d44c6de7754;p=thirdparty%2Fbind9.git Change QP and qpcache logging from DEBUG(1) to DEBUG(3) Per pspacek, currently qp and qpcache logs are too verbose and enabled at a level too low compared to how often the logging is useful. This commit increases the logging level, while keeping it configurable via a define. --- diff --git a/lib/dns/qp.c b/lib/dns/qp.c index 7436d07cf54..d2a8963162e 100644 --- a/lib/dns/qp.c +++ b/lib/dns/qp.c @@ -48,8 +48,8 @@ #include "qp_p.h" -#ifndef DNS_QP_LOG_STATS -#define DNS_QP_LOG_STATS 1 +#ifndef DNS_QP_LOG_STATS_LEVEL +#define DNS_QP_LOG_STATS_LEVEL 3 #endif #ifndef DNS_QP_TRACE #define DNS_QP_TRACE 0 @@ -68,10 +68,10 @@ static atomic_uint_fast64_t rollback_time; /* for LOG_STATS() format strings */ #define PRItime " %" PRIu64 " ns " -#if DNS_QP_LOG_STATS +#if DNS_QP_LOG_STATS_LEVEL #define LOG_STATS(...) \ isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_QP, \ - ISC_LOG_DEBUG(1), __VA_ARGS__) + ISC_LOG_DEBUG(DNS_QP_LOG_STATS_LEVEL), __VA_ARGS__) #else #define LOG_STATS(...) #endif diff --git a/lib/dns/qpcache.c b/lib/dns/qpcache.c index 40b7b206c7d..1716d55535a 100644 --- a/lib/dns/qpcache.c +++ b/lib/dns/qpcache.c @@ -59,6 +59,10 @@ #include "db_p.h" #include "qpcache_p.h" +#ifndef DNS_QPCACHE_LOG_STATS_LEVEL +#define DNS_QPCACHE_LOG_STATS_LEVEL 3 +#endif + #define CHECK(op) \ do { \ result = (op); \ @@ -589,11 +593,11 @@ static void delete_node(qpcache_t *qpdb, qpcnode_t *node) { isc_result_t result = ISC_R_UNEXPECTED; - if (isc_log_wouldlog(ISC_LOG_DEBUG(1))) { + if (isc_log_wouldlog(ISC_LOG_DEBUG(DNS_QPCACHE_LOG_STATS_LEVEL))) { char printname[DNS_NAME_FORMATSIZE]; dns_name_format(&node->name, printname, sizeof(printname)); isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE, - ISC_LOG_DEBUG(1), + ISC_LOG_DEBUG(DNS_QPCACHE_LOG_STATS_LEVEL), "delete_node(): %p %s (bucket %d)", node, printname, node->locknum); } @@ -2212,7 +2216,8 @@ qpcache__destroy(qpcache_t *qpdb) { strlcpy(buf, "", sizeof(buf)); } isc_log_write(DNS_LOGCATEGORY_DATABASE, DNS_LOGMODULE_CACHE, - ISC_LOG_DEBUG(1), "done %s(%s)", __func__, buf); + ISC_LOG_DEBUG(DNS_QPCACHE_LOG_STATS_LEVEL), "done %s(%s)", + __func__, buf); if (dns_name_dynamic(&qpdb->common.origin)) { dns_name_free(&qpdb->common.origin, qpdb->common.mctx);