From: Wouter Wijngaards Date: Fri, 10 Feb 2012 14:48:09 +0000 (+0000) Subject: debug infra lines for infa timeout counters. X-Git-Tag: release-1.4.17rc1~57 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=850525139bda550f7b8b5a47b780efcb3f7f2f7f;p=thirdparty%2Funbound.git debug infra lines for infa timeout counters. git-svn-id: file:///svn/unbound/trunk@2616 be551aaa-1e26-0410-a405-d3ace91eadb9 --- diff --git a/daemon/cachedump.c b/daemon/cachedump.c index e5be8564e..b6a4de8c5 100644 --- a/daemon/cachedump.c +++ b/daemon/cachedump.c @@ -802,7 +802,8 @@ print_dp_details(SSL* ssl, struct worker* worker, struct delegpt* dp) { char buf[257]; struct delegpt_addr* a; - int lame, dlame, rlame, rto, edns_vs, to, delay, entry_ttl; + int lame, dlame, rlame, rto, edns_vs, to, delay, entry_ttl, + tA, tAAAA, tother; struct rtt_info ri; uint8_t edns_lame_known; for(a = dp->target_list; a; a = a->next_target) { @@ -817,9 +818,11 @@ print_dp_details(SSL* ssl, struct worker* worker, struct delegpt* dp) delay=0; entry_ttl = infra_get_host_rto(worker->env.infra_cache, &a->addr, a->addrlen, dp->name, dp->namelen, - &ri, &delay, *worker->env.now); + &ri, &delay, *worker->env.now, &tA, &tAAAA, &tother); if(entry_ttl == -2 && ri.rto >= USEFUL_SERVER_TOP_TIMEOUT) { - if(!ssl_printf(ssl, "expired, rto %d msec.\n", ri.rto)) + if(!ssl_printf(ssl, "expired, rto %d msec, tA %d " + "tAAAA %d tother %d.\n", ri.rto, tA, tAAAA, + tother)) return; continue; } @@ -840,11 +843,12 @@ print_dp_details(SSL* ssl, struct worker* worker, struct delegpt* dp) continue; /* skip stuff not in infra cache */ } if(!ssl_printf(ssl, "%s%s%s%srto %d msec, ttl %d, ping %d " - "var %d rtt %d", + "var %d rtt %d, tA %d, tAAAA %d, tother %d", lame?"LAME ":"", dlame?"NoDNSSEC ":"", a->lame?"AddrWasParentSide ":"", rlame?"NoAuthButRecursive ":"", rto, entry_ttl, - ri.srtt, ri.rttvar, rtt_notimeout(&ri))) + ri.srtt, ri.rttvar, rtt_notimeout(&ri), + tA, tAAAA, tother)) return; if(delay) if(!ssl_printf(ssl, ", probedelay %d", delay)) diff --git a/daemon/remote.c b/daemon/remote.c index a2b2204c2..15847daf4 100644 --- a/daemon/remote.c +++ b/daemon/remote.c @@ -1570,9 +1570,11 @@ dump_infra_host(struct lruhash_entry* e, void* arg) return; } if(!ssl_printf(a->ssl, "%s %s ttl %d ping %d var %d rtt %d rto %d " + "tA %d tAAAA %d tother %d " "ednsknown %d edns %d delay %d lame dnssec %d rec %d A %d " "other %d\n", ip_str, name, (int)(d->ttl - a->now), d->rtt.srtt, d->rtt.rttvar, rtt_notimeout(&d->rtt), d->rtt.rto, + d->timeout_A, d->timeout_AAAA, d->timeout_other, (int)d->edns_lame_known, (int)d->edns_version, (int)(a->nowprobedelay?d->probedelay-a->now:0), (int)d->isdnsseclame, (int)d->rec_lame, (int)d->lame_type_A, diff --git a/services/cache/infra.c b/services/cache/infra.c index 9baedd13f..06c5e947b 100644 --- a/services/cache/infra.c +++ b/services/cache/infra.c @@ -422,7 +422,8 @@ infra_rtt_update(struct infra_cache* infra, struct sockaddr_storage* addr, int infra_get_host_rto(struct infra_cache* infra, struct sockaddr_storage* addr, socklen_t addrlen, uint8_t* nm, - size_t nmlen, struct rtt_info* rtt, int* delay, uint32_t timenow) + size_t nmlen, struct rtt_info* rtt, int* delay, uint32_t timenow, + int* tA, int* tAAAA, int* tother) { struct lruhash_entry* e = infra_lookup_nottl(infra, addr, addrlen, nm, nmlen, 0); @@ -437,6 +438,9 @@ int infra_get_host_rto(struct infra_cache* infra, *delay = (int)(data->probedelay - timenow); else *delay = 0; } + *tA = data->timeout_A; + *tAAAA = data->timeout_AAAA; + *tother = data->timeout_other; lock_rw_unlock(&e->lock); return ttl; } diff --git a/services/cache/infra.h b/services/cache/infra.h index 5d15b5eee..161f5ab43 100644 --- a/services/cache/infra.h +++ b/services/cache/infra.h @@ -275,12 +275,16 @@ int infra_get_lame_rtt(struct infra_cache* infra, * @param rtt: the rtt_info is copied into here (caller alloced return struct). * @param delay: probe delay (if any). * @param timenow: what time it is now. + * @param tA: timeout counter on type A. + * @param tAAAA: timeout counter on type AAAA. + * @param tother: timeout counter on type other. * @return TTL the infra host element is valid for. If -1: not found in cache. * TTL -2: found but expired. */ int infra_get_host_rto(struct infra_cache* infra, struct sockaddr_storage* addr, socklen_t addrlen, uint8_t* name, - size_t namelen, struct rtt_info* rtt, int* delay, uint32_t timenow); + size_t namelen, struct rtt_info* rtt, int* delay, uint32_t timenow, + int* tA, int* tAAAA, int* tother); /** * Get memory used by the infra cache.