mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Namhyung Kim <namhyung@kernel.org>
To: Irina Tirdea <irina.tirdea@gmail.com>
Cc: mingo@redhat.com, acme@ghostprotocols.net,
	a.p.zijlstra@chello.nl, rostedt@goodmis.org, paulus@samba.org,
	dsahern@gmail.com, namhyung.kim@lge.com,
	linux-kernel@vger.kernel.org,
	Irina Tirdea <irina.tirdea@intel.com>
Subject: Re: [PATCH v3] perf bench: fix assert when NDEBUG is defined
Date: Sat, 08 Sep 2012 23:11:57 +0900	[thread overview]
Message-ID: <87a9x0a9jm.fsf@kernel.org> (raw)
In-Reply-To: <1347082551-2394-1-git-send-email-irina.tirdea@intel.com> (Irina Tirdea's message of "Sat, 8 Sep 2012 08:35:51 +0300")

On Sat,  8 Sep 2012 08:35:51 +0300, Irina Tirdea wrote:
> From: Irina Tirdea <irina.tirdea@intel.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@chello.nl>
> Signed-off-by: Irina Tirdea <irina.tirdea@intel.com>

Reviewed-by: Namhyung Kim <namhyung@kernel.org>

Thanks,
Namhyung

  parent reply	other threads:[~2012-09-08 14:12 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-08  5:35 Irina Tirdea
2012-09-08  8:18 ` Pekka Enberg
2012-09-08 14:11 ` Namhyung Kim [this message]
2012-09-09  8:52 ` [tip:perf/core] " tip-bot for Irina Tirdea

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=87a9x0a9jm.fsf@kernel.org \
    --to=namhyung@kernel.org \
    --cc=a.p.zijlstra@chello.nl \
    --cc=acme@ghostprotocols.net \
    --cc=dsahern@gmail.com \
    --cc=irina.tirdea@gmail.com \
    --cc=irina.tirdea@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mingo@redhat.com \
    --cc=namhyung.kim@lge.com \
    --cc=paulus@samba.org \
    --cc=rostedt@goodmis.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

Powered by JetHome