mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-01 06:55:30 +00:00
add debug logging when creating or attaching to a query counter
fctx_create() now logs at debug level 9 when the fctx attaches to an existing counter or creates a new one.
This commit is contained in:
@@ -4520,16 +4520,6 @@ fctx_create(dns_resolver_t *res, isc_loop_t *loop, const dns_name_t *name,
|
|||||||
|
|
||||||
isc_mutex_init(&fctx->lock);
|
isc_mutex_init(&fctx->lock);
|
||||||
|
|
||||||
if (qc != NULL) {
|
|
||||||
isc_counter_attach(qc, &fctx->qc);
|
|
||||||
} else {
|
|
||||||
result = isc_counter_create(fctx->mctx, res->maxqueries,
|
|
||||||
&fctx->qc);
|
|
||||||
if (result != ISC_R_SUCCESS) {
|
|
||||||
goto cleanup_fetch;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Make fctx->info point to a copy of a formatted string
|
* Make fctx->info point to a copy of a formatted string
|
||||||
* "name/type". FCTXTRACE won't work until this is done.
|
* "name/type". FCTXTRACE won't work until this is done.
|
||||||
@@ -4542,6 +4532,24 @@ fctx_create(dns_resolver_t *res, isc_loop_t *loop, const dns_name_t *name,
|
|||||||
|
|
||||||
FCTXTRACE("create");
|
FCTXTRACE("create");
|
||||||
|
|
||||||
|
if (qc != NULL) {
|
||||||
|
isc_counter_attach(qc, &fctx->qc);
|
||||||
|
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
|
||||||
|
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(9),
|
||||||
|
"fctx %p(%s): attached to counter %p (%d)", fctx,
|
||||||
|
fctx->info, fctx->qc, isc_counter_used(fctx->qc));
|
||||||
|
} else {
|
||||||
|
result = isc_counter_create(fctx->mctx, res->maxqueries,
|
||||||
|
&fctx->qc);
|
||||||
|
if (result != ISC_R_SUCCESS) {
|
||||||
|
goto cleanup_fetch;
|
||||||
|
}
|
||||||
|
isc_log_write(dns_lctx, DNS_LOGCATEGORY_RESOLVER,
|
||||||
|
DNS_LOGMODULE_RESOLVER, ISC_LOG_DEBUG(9),
|
||||||
|
"fctx %p(%s): created counter %p", fctx,
|
||||||
|
fctx->info, fctx->qc);
|
||||||
|
}
|
||||||
|
|
||||||
#if DNS_RESOLVER_TRACE
|
#if DNS_RESOLVER_TRACE
|
||||||
fprintf(stderr, "fetchctx__init:%s:%s:%d:%p:%p->references = 1\n",
|
fprintf(stderr, "fetchctx__init:%s:%s:%d:%p:%p->references = 1\n",
|
||||||
__func__, __FILE__, __LINE__, fctx, fctx);
|
__func__, __FILE__, __LINE__, fctx, fctx);
|
||||||
|
Reference in New Issue
Block a user