From: Vladimír Čunát Date: Fri, 15 Jun 2018 16:40:20 +0000 (+0200) Subject: reduce verbose logging - cases not really useful X-Git-Tag: v2.4.0~19^2~4 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=b6049563f26a2422bd2263fdad97a9f419a25ea1;p=thirdparty%2Fknot-resolver.git reduce verbose logging - cases not really useful Also tweak order of information when logging cache stash, as it was rather unnatural. --- diff --git a/lib/cache/api.c b/lib/cache/api.c index 4e7140319..5d3974276 100644 --- a/lib/cache/api.c +++ b/lib/cache/api.c @@ -550,9 +550,9 @@ static ssize_t stash_rrset(struct kr_cache *cache, const struct kr_query *qry, || rr->type == KNOT_RRTYPE_NS) { auto_free char *type_str = kr_rrtype_text(rr->type), *encl_str = kr_dname_text(encloser); - VERBOSE_MSG(qry, "=> stashed rank: 0%.2o, %s %s%s " - "(%d B total, incl. %d RRSIGs)\n", - rank, type_str, (wild_labels ? "*." : ""), encl_str, + VERBOSE_MSG(qry, "=> stashed %s%s %s, rank 0%.2o, " + "%d B total, incl. %d RRSIGs\n", + (wild_labels ? "*." : ""), encl_str, type_str, rank, (int)val_new_entry.len, (rr_sigs ? rr_sigs->rrs.rr_count : 0) ); } } @@ -569,6 +569,9 @@ static int stash_rrarray_entry(ranked_rr_array_t *arr, int arr_i, return kr_ok(); } const knot_rrset_t *rr = entry->rr; + if (rr->type == KNOT_RRTYPE_RRSIG) { + return kr_ok(); /* reduce verbose logging from the following call */ + } int ret = stash_rrset_precond(rr, qry); if (ret <= 0) { return ret; diff --git a/lib/cache/peek.c b/lib/cache/peek.c index c16e75e90..55a037a82 100644 --- a/lib/cache/peek.c +++ b/lib/cache/peek.c @@ -107,7 +107,6 @@ int peek_nosync(kr_layer_t *ctx, knot_pkt_t *pkt) knot_db_val_t val = { NULL, 0 }; ret = cache_op(cache, read, &key, &val, 1); if (!ret) { - VERBOSE_MSG(qry, "=> read OK\n"); /* found an entry: test conditions, materialize into pkt, etc. */ ret = found_exact_hit(ctx, pkt, val, lowest_rank); } @@ -438,7 +437,6 @@ static int found_exact_hit(kr_layer_t *ctx, knot_pkt_t *pkt, knot_db_val_t val, int ret = entry_h_seek(&val, qry->stype); if (ret) return ret; - VERBOSE_MSG(qry, "=> FEH seek OK \n"); const struct entry_h *eh = entry_h_consistent(val, qry->stype); if (!eh) { assert(false); @@ -446,7 +444,6 @@ static int found_exact_hit(kr_layer_t *ctx, knot_pkt_t *pkt, knot_db_val_t val, // LATER: recovery in case of error, perhaps via removing the entry? // LATER(optim): pehaps optimize the zone cut search } - VERBOSE_MSG(qry, "=> FEH consistent OK \n"); int32_t new_ttl = get_new_ttl(eh, qry, qry->sname, qry->stype, qry->timestamp.tv_sec); diff --git a/lib/resolve.c b/lib/resolve.c index 373554b1d..ba94cf058 100644 --- a/lib/resolve.c +++ b/lib/resolve.c @@ -595,7 +595,6 @@ static int answer_finalize(struct kr_request *request, int state) * Be conservative. Primary approach: check ranks of all RRs in wire. * Only "negative answers" need special handling. */ bool secure = (last != NULL); /* suspicious otherwise */ - VERBOSE_MSG(NULL, "AD: secure (start)\n"); if (last && (last->flags.STUB)) { secure = false; /* don't trust forwarding for now */ } @@ -618,7 +617,6 @@ static int answer_finalize(struct kr_request *request, int state) } } - VERBOSE_MSG(NULL, "AD: secure (between ANS and AUTH)\n"); /* Write authority records. */ if (answer->current < KNOT_AUTHORITY) { knot_pkt_begin(answer, KNOT_AUTHORITY); @@ -645,7 +643,6 @@ static int answer_finalize(struct kr_request *request, int state) /* AD: "negative answers" need more handling. */ if (last && secure) { - VERBOSE_MSG(NULL, "AD: secure (1)\n"); if (kr_response_classify(answer) != PKT_NOERROR /* Additionally check for CNAME chains that "end in NODATA", * as those would also be PKT_NOERROR. */