]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
reduce verbose logging - cases not really useful
authorVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 15 Jun 2018 16:40:20 +0000 (18:40 +0200)
committerVladimír Čunát <vladimir.cunat@nic.cz>
Fri, 15 Jun 2018 16:40:20 +0000 (18:40 +0200)
Also tweak order of information when logging cache stash,
as it was rather unnatural.

lib/cache/api.c
lib/cache/peek.c
lib/resolve.c

index 4e7140319f6ab3c20da6870188cca7dcdcf07be7..5d3974276343cc47441a667bb8bd9b6fe798624d 100644 (file)
@@ -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;
index c16e75e902a9520741909c49b642853b56a8a506..55a037a82f4d256eb59bd2c8eeba2ca57ba57aac 100644 (file)
@@ -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);
index 373554b1d54e4bc1318779756376799de4b40bb6..ba94cf0580cb5d3a76986d4c695035807feeedaa 100644 (file)
@@ -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. */