netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: netfilter-devel@vger.kernel.org
Cc: kaber@trash.net
Subject: [PATCH nft] src: use printf() instead of pr_debug() whenever possible
Date: Thu,  8 Jan 2015 13:13:46 +0100	[thread overview]
Message-ID: <1420719226-5475-1-git-send-email-pablo@netfilter.org> (raw)

pr_debug() is disabled with --with-mini-gmp since it relies on the
gmp_printf(), which is not available in the mini-gmp implementation.
Use printf() instead of pr_debug() if no mpz_t types are used, so
we get debugging information for proto-ctx as well.

This leaves the pr_debug() usage limited to src/segtree.c.

Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
---
 src/netlink_delinearize.c |    2 --
 src/proto.c               |   14 +++++++-------
 2 files changed, 7 insertions(+), 9 deletions(-)

diff --git a/src/netlink_delinearize.c b/src/netlink_delinearize.c
index e9a04dd..b34d586 100644
--- a/src/netlink_delinearize.c
+++ b/src/netlink_delinearize.c
@@ -915,8 +915,6 @@ static void expr_postprocess(struct rule_pp_ctx *ctx,
 {
 	struct expr *expr = *exprp, *i;
 
-	//pr_debug("%s len %u\n", expr->ops->name, expr->len);
-
 	switch (expr->ops->type) {
 	case EXPR_MAP:
 		expr_postprocess(ctx, stmt, &expr->map);
diff --git a/src/proto.c b/src/proto.c
index 7dc7b3e..6a12ee8 100644
--- a/src/proto.c
+++ b/src/proto.c
@@ -137,15 +137,15 @@ static void proto_ctx_debug(const struct proto_ctx *ctx, enum proto_bases base)
 	if (!(debug_level & DEBUG_PROTO_CTX))
 		return;
 
-	pr_debug("update %s protocol context:\n", proto_base_names[base]);
+	printf("update %s protocol context:\n", proto_base_names[base]);
 	for (i = PROTO_BASE_LL_HDR; i <= PROTO_BASE_MAX; i++) {
-		pr_debug(" %-20s: %s%s\n",
-			 proto_base_names[i],
-			 ctx->protocol[i].desc ? ctx->protocol[i].desc->name :
-						 "none",
-			 i == base ? " <-" : "");
+		printf(" %-20s: %s%s\n",
+		       proto_base_names[i],
+		       ctx->protocol[i].desc ? ctx->protocol[i].desc->name :
+					       "none",
+		       i == base ? " <-" : "");
 	}
-	pr_debug("\n");
+	printf("\n");
 #endif
 }
 
-- 
1.7.10.4


             reply	other threads:[~2015-01-08 12:11 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-08 12:13 Pablo Neira Ayuso [this message]
2015-01-08 12:21 ` [PATCH nft] src: use printf() instead of pr_debug() whenever possible Patrick McHardy
2015-01-08 12:31   ` Pablo Neira Ayuso

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1420719226-5475-1-git-send-email-pablo@netfilter.org \
    --to=pablo@netfilter.org \
    --cc=kaber@trash.net \
    --cc=netfilter-devel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).