OpenCloudOS-Kernel/tools/perf/util/include/linux
Irina Tirdea 8bf98b8968 perf bench: fix assert when NDEBUG is defined
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>
Reviewed-by: Pekka Enberg <penberg@kernel.org>
Cc: David Ahern <dsahern@gmail.com>
Cc: Ingo Molnar <mingo@redhat.com>
Cc: Namhyung Kim <namhyung.kim@lge.com>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Peter Zijlstra <a.p.zijlstra@chello.nl>
Cc: Steven Rostedt <rostedt@goodmis.org>
Link: http://lkml.kernel.org/r/1347082551-2394-1-git-send-email-irina.tirdea@intel.com
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
2012-09-08 13:18:54 -03:00
..
bitmap.h perf tools: Add bitmap_or function into bitmap object 2012-02-13 23:28:10 -02:00
bitops.h perf tools: Fix endianity swapping for adds_features bitmask 2012-06-11 11:20:01 -03:00
compiler.h perf tools: Support for DWARF CFI unwinding on post processing 2012-08-11 15:06:56 -03:00
const.h perf tools: Fix build on older systems 2011-05-26 11:16:29 -03:00
ctype.h perf tools: Bring linear set of section headers for features 2009-11-11 07:30:19 +01:00
export.h perf tools: Switch module.h into export.h 2012-03-26 17:19:57 +02:00
hash.h perf: Add util/include/linuxhash.h to include hash.h of kernel 2010-01-31 08:27:53 +01:00
kernel.h perf bench: fix assert when NDEBUG is defined 2012-09-08 13:18:54 -03:00
linkage.h perf bench: Add feature that measures the performance of the arch/x86/lib/memcpy_64.S memcpy routines via 'perf bench mem' 2010-11-26 08:15:57 +01:00
list.h Merge branch 'perf-urgent-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip 2011-05-23 09:25:52 -07:00
poison.h perf_counter tools: Share list.h with the kernel 2009-07-01 22:37:23 +02:00
prefetch.h perf_counter tools: Share list.h with the kernel 2009-07-01 22:37:23 +02:00
rbtree.h perf tools: Fix build for another rbtree.c change 2012-09-07 22:21:59 -03:00
string.h perf tools: Add missing tools/perf/util/include/string.h 2009-10-20 02:59:34 +02:00
types.h perf: Add back list_head data types 2010-08-12 21:50:00 +02:00