chg: dev: Change QP and qpcache logging from DEBUG(1) to DEBUG(3)

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.

Merge branch 'alessio/higher-level-qp-log' into 'main'

See merge request isc-projects/bind9!10604
This commit is contained in:
Alessio Podda 2025-06-25 13:22:59 +00:00
commit 01a49e8e47
2 changed files with 12 additions and 7 deletions

View 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

View file

@ -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, "<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);