Re: [PATCH nft] src: rename pr_debug() to pr_gmp_debug() and use printf() whenever possible

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 08.01, Pablo Neira Ayuso wrote:
> Rename pr_debug() to pr_gmp_debug() so the new function name reminds
> us the explicit dependency with libgmp, as suggested by Patrick.
> 
> Moreover, use printf() instead of pr_debug() if no mpz_t types are
> used, so we get debugging information for proto-ctx as well.
> 
> pr_gmp_debug() is disabled with --with-mini-gmp since it relies on the
> gmp_printf(), which is not available in the mini-gmp implementation.


Not entirely, my suggestion was to keep the existing instances of
pr_debug() (mapped to printf) everywhere but in segtree.

> --- 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

So I wouldn't change this.
--
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Netfitler Users]     [LARTC]     [Bugtraq]     [Yosemite Forum]

  Powered by Linux