[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CAOJsxLEBNsg9g4ShwzQsnjydAmbEGjZq3ELsdf=JbJ36V1ffYg@mail.gmail.com>
Date: Sat, 8 Sep 2012 11:18:57 +0300
From: Pekka Enberg <penberg@...nel.org>
To: Irina Tirdea <irina.tirdea@...il.com>
Cc: mingo@...hat.com, acme@...stprotocols.net, a.p.zijlstra@...llo.nl,
rostedt@...dmis.org, paulus@...ba.org, dsahern@...il.com,
namhyung.kim@....com, linux-kernel@...r.kernel.org,
Irina Tirdea <irina.tirdea@...el.com>
Subject: Re: [PATCH v3] perf bench: fix assert when NDEBUG is defined
On Sat, Sep 8, 2012 at 8:35 AM, Irina Tirdea <irina.tirdea@...il.com> wrote:
> From: Irina Tirdea <irina.tirdea@...el.com>
>
> When NDEBUG is defined, the assert macro will be expanded to nothing.
> Some assert calls used in perf are also including some functionality
> (e.g. system calls), not only validity checks. Therefore, if NDEBUG is
> defined, this functionality will be removed along with the assert.
> Perf also defines BUG_ON based on assert, so it has the same problem.
>
> Define BUG_ON so that the condition will be executed when NDEBUG is defined.
> Replace the assert statements that have these side effects with BUG_ON.
>
> For defining BUG_ON, use "if (cond) {}" insted of "if (cond) ;" because in
> the latter case build fails with "error: suggest braces around empty body in
> an ‘if’ statement [-Werror=empty-body]"
>
> Suggested-by: Peter Zijlstra <a.p.zijlstra@...llo.nl>
> Signed-off-by: Irina Tirdea <irina.tirdea@...el.com>
Reviewed-by: Pekka Enberg <penberg@...nel.org>
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
Powered by blists - more mailing lists