]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Change QP and qpcache logging from DEBUG(1) to DEBUG(3)
authorAlessio Podda <alessio@isc.org>
Thu, 19 Jun 2025 12:49:53 +0000 (14:49 +0200)
committerAlessio Podda <alessio@isc.org>
Wed, 25 Jun 2025 12:37:01 +0000 (14:37 +0200)
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.

lib/dns/qp.c
lib/dns/qpcache.c

index 7436d07cf5483c659e18468cbf305aa3eed5dd75..d2a8963162e2fb71ad7f82b62315876603e711ac 100644 (file)
@@ -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
index 40b7b206c7d1568691486fe77fe97fe3f5c60fc2..1716d55535ac685613385c461557665ee6e2451e 100644 (file)
 #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, "<UNKNOWN>", 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);