From: Vladimír Čunát Date: Mon, 12 Jul 2021 20:00:15 +0000 (+0200) Subject: QRVERBOSE: fix ignoring the log groups X-Git-Tag: v5.4.0~2^2~29 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=5d7e9f15847efc97e7e52b1016e955a84f387f9c;p=thirdparty%2Fknot-resolver.git QRVERBOSE: fix ignoring the log groups 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). --- diff --git a/lib/layer.h b/lib/layer.h index 66644f60c..f3526e40c 100644 --- a/lib/layer.h +++ b/lib/layer.h @@ -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). * diff --git a/lib/log.c b/lib/log.c index f8859d26b..2dfad264f 100644 --- 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;