]> git.ipfire.org Git - thirdparty/knot-resolver.git/commitdiff
QRVERBOSE: fix ignoring the log groups
authorVladimír Čunát <vladimir.cunat@nic.cz>
Mon, 12 Jul 2021 20:00:15 +0000 (22:00 +0200)
committerTomas Krizek <tomas.krizek@nic.cz>
Thu, 29 Jul 2021 09:42:34 +0000 (11:42 +0200)
It would be yet another condition to check; overall I think the
necessary checks would get too complex to be done in a macro
and therefore copied all over the place.

Note: it's interesting that such a change reduces binary size
by about 3% (on master), and I suspect that speed won't suffer at all
(after that TODO is done).

lib/layer.h
lib/log.c

index 66644f60c9f7145c459659c41957676f1476cc20..f3526e40c575218776656bee349ace44a8388d47 100644 (file)
@@ -8,17 +8,7 @@
 #include "lib/defines.h"
 #include "lib/utils.h"
 
-/** Print a debug message related to resolution.
- * \param _query       associated kr_query, may be NULL
- * \param _cls identifying string, typically of length exactly four (padded)
- * \param ...  printf-compatible list of parameters
- */
-#define QRVERBOSE(_query, grp, ...) do { \
-       const struct kr_query *_qry = (_query); \
-       if (VERBOSE_STATUS || kr_log_qtrace_enabled(_qry)) { \
-               kr_log_q(_query, grp, ##  __VA_ARGS__); \
-       }  \
-} while (false)
+#define QRVERBOSE kr_log_q // TODO: perhaps eliminate
 
 /** Layer processing states.  Only one value at a time (but see TODO).
  *
index f8859d26bbb8a059104860eb647becb423453bba..2dfad264f7a210b1b7d0171eae0f42a94f0e123e 100644 (file)
--- a/lib/log.c
+++ b/lib/log.c
@@ -287,6 +287,7 @@ void kr_log_req1(const struct kr_request * const req, uint32_t qry_uid,
 void kr_log_q1(const struct kr_query * const qry,
                enum kr_log_group group, const char *tag, const char *fmt, ...)
 {
+       // TODO(optim.): early return if there's nothing to do
        unsigned ind = 0;
        for (const struct kr_query *q = qry; q; q = q->parent)
                ind += 2;