diff options
author | Irina Tirdea <[email protected]> | 2012-09-08 08:35:51 +0300 |
---|---|---|
committer | Arnaldo Carvalho de Melo <[email protected]> | 2012-09-08 13:18:54 -0300 |
commit | 8bf98b89688c3d7ec071bf26d49761e38d846b47 (patch) | |
tree | ba72d4cfd34862992d9d2a1111956cc26eaae839 /tools/perf/util/scripting-engines/trace-event-python.c | |
parent | ef34eb4da3eb62a1511592adf7c76d74faca0b14 (diff) |
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 <[email protected]>
Signed-off-by: Irina Tirdea <[email protected]>
Reviewed-by: Namhyung Kim <[email protected]>
Reviewed-by: Pekka Enberg <[email protected]>
Cc: David Ahern <[email protected]>
Cc: Ingo Molnar <[email protected]>
Cc: Namhyung Kim <[email protected]>
Cc: Paul Mackerras <[email protected]>
Cc: Peter Zijlstra <[email protected]>
Cc: Steven Rostedt <[email protected]>
Link: http://lkml.kernel.org/r/[email protected]
Signed-off-by: Arnaldo Carvalho de Melo <[email protected]>
Diffstat (limited to 'tools/perf/util/scripting-engines/trace-event-python.c')
0 files changed, 0 insertions, 0 deletions