netfilter-devel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Pablo Neira Ayuso <pablo@netfilter.org>
To: Steven Barth <cyrus@openwrt.org>
Cc: netfilter-devel@vger.kernel.org, kaber@trash.net
Subject: Re: [nft PATCHv2 0/4] support for mini-gmp / embedded friendliness
Date: Wed, 7 Jan 2015 13:52:41 +0100	[thread overview]
Message-ID: <20150107125241.GA26629@salvia> (raw)
In-Reply-To: <54AD268E.8020702@openwrt.org>

On Wed, Jan 07, 2015 at 01:29:02PM +0100, Steven Barth wrote:
> 
> On 07.01.2015 13:22, Pablo Neira Ayuso wrote:
> >
> >I think you mentioned to me already but
> >
> >  configure: error: --with-mini-gmp MUST be used with --disable-debug
> >
> >any reason to enforce this?
> 
> The problem here is that pr_debug expands to gmp_printf which is not
> part of mini-gmp and the little replacement mpz_printf I added only
> allows for formatting a single mpz_t (which is enough for all the
> non-debug cases).
> 
> So there are 3 options basically.
> 1. Try to make gmp_printf standalone and port it from libgmp to mini-gmp.
>     This looked like a huge and complicated effort and would likely
> blow up stuff considerably again.
> 2. Replace pr_debug's gmp_printf with regular printf and rewrite all
> the debug-calls to mpz_get_str()
>     and free() which sounds painful.
> 3. Simply disabling debugging with mini-gmp.
>     Easy way out without obstructing things too much otherwise.

I see. pr_debug() seems to be only relevant in sec/segtree.c, other
spots can be replaced by printf in src/proto.c

I think it would be good for us to have the debugging option enabled
in embedded builds at this stage, at least as much as we can get in
some easy way. We can ask people to run commands with --debug and
paste the result of it.

We can probably have something like:

#ifdef DEBUG && !MINIGMP
#define pr_debug(fmt, arg...) gmp_printf(fmt, ##arg)
#else
#define pr_debug(fmt, arg...) ({ if (false) {}; 0; })
#endif

so only segtree debugging is turned off and document this in the
INSTALL file.

  reply	other threads:[~2015-01-07 12:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-06 22:40 [nft PATCHv2 0/4] support for mini-gmp / embedded friendliness Steven Barth
2015-01-06 22:40 ` [PATCH 1/4] parser: rename VERSION token to HDRVERSION Steven Barth
2015-01-06 22:40 ` [PATCH 2/4] datatype: use mpz_set_str instead of gmp_sscanf Steven Barth
2015-01-06 22:40 ` [PATCH 3/4] erec: use stdio vasprintf instead of gmp_vasprintf Steven Barth
2015-01-06 22:40 ` [PATCH 4/4] build: add --with-mini-gmp switch to use mini-gmp instead of libgmp Steven Barth
2015-01-07 12:22 ` [nft PATCHv2 0/4] support for mini-gmp / embedded friendliness Pablo Neira Ayuso
2015-01-07 12:29   ` Steven Barth
2015-01-07 12:52     ` Pablo Neira Ayuso [this message]
2015-01-07 13:04 ` 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=20150107125241.GA26629@salvia \
    --to=pablo@netfilter.org \
    --cc=cyrus@openwrt.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).