#include "lib/cache.h"
#include "lib/defines.h"
+#ifndef NDEBUG
#define DEBUG_MSG(fmt, ...) fprintf(stderr, "[cache] " fmt, ## __VA_ARGS__)
+#else
+#define DEBUG_MSG(fmt, ...)
+#endif
+
#define db_api namedb_lmdb_api()
namedb_t *kr_cache_open(const char *handle, mm_ctx_t *mm, size_t maxsize)
#include "lib/rplan.h"
#include "lib/utils.h"
+#ifndef NDEBUG
#define DEBUG_MSG(fmt, ...) fprintf(stderr, "[qiter] " fmt, ## __VA_ARGS__)
+#else
+#define DEBUG_MSG(fmt, ...)
+#endif
/* Iterator often walks through packet section, this is an abstraction. */
typedef int (*rr_callback_t)(const knot_rrset_t *, struct kr_layer_param *);
#include "lib/layer/iterate.h"
#include "lib/utils.h"
+#ifndef NDEBUG
#define DEBUG_MSG(fmt, ...) fprintf(stderr, "[cache] " fmt, ## __VA_ARGS__)
+#else
+#define DEBUG_MSG(fmt, ...)
+#endif
typedef int (*rr_callback_t)(const knot_rrset_t *, unsigned, struct kr_layer_param *);
#include "lib/layer/stats.h"
#include "lib/rplan.h"
+#ifndef NDEBUG
#define DEBUG_MSG(fmt, ...) fprintf(stderr, "[stats] " fmt, ## __VA_ARGS__)
+#else
+#define DEBUG_MSG(fmt, ...)
+#endif
//static void update_stats(struct kr_ns *ns, double rtt)
//{
static int finish(knot_layer_t *ctx)
{
+#ifndef NDEBUG
struct kr_layer_param *param = ctx->data;
struct kr_rplan *rplan = param->rplan;
const knot_pkt_t *answer = param->answer;
-#ifndef NDEBUG
/* Calculate total RTT and number of queries. */
double total_rtt = 0.0;
size_t nr_queries = list_size(&rplan->resolved);
#include "lib/layer/static.h"
#include "lib/layer/stats.h"
+#ifndef NDEBUG
#define DEBUG_MSG(fmt, ...) fprintf(stderr, "[reslv] " fmt, ## __VA_ARGS__)
+#else
+#define DEBUG_MSG(fmt, ...)
+#endif
/* Defines */
#define ITER_LIMIT 50
#include "lib/cache.h"
#include "lib/utils.h"
+#ifndef NDEBUG
#define DEBUG_MSG(fmt, ...) fprintf(stderr, "[rplan] " fmt, ## __VA_ARGS__)
+#else
+#define DEBUG_MSG(fmt, ...)
+#endif
static struct kr_query *query_create(mm_ctx_t *pool, const knot_dname_t *name)
{
#include "lib/utils.h"
#include "lib/rplan.h"
+#ifndef NDEBUG
#define DEBUG_MSG(fmt, ...) fprintf(stderr, "[z-cut] " fmt, ## __VA_ARGS__)
+#else
+#define DEBUG_MSG(fmt, ...)
+#endif
/* \brief Root hint descriptor. */
struct hint_info {