diff --git a/tools/perf/bench/sched-pipe.c b/tools/perf/bench/sched-pipe.c index 0c7454f8b8a9841f039568f5af0d74fecec0329e..15911e9c587a4f4f1cd4f27c00dac94d6b1d4958 100644 --- a/tools/perf/bench/sched-pipe.c +++ b/tools/perf/bench/sched-pipe.c @@ -56,13 +56,13 @@ int bench_sched_pipe(int argc, const char **argv, * causes error in building environment for perf */ int __used ret, wait_stat; - pid_t pid, retpid; + pid_t pid, retpid __used; argc = parse_options(argc, argv, options, bench_sched_pipe_usage, 0); - assert(!pipe(pipe_1)); - assert(!pipe(pipe_2)); + BUG_ON(pipe(pipe_1)); + BUG_ON(pipe(pipe_2)); pid = fork(); assert(pid >= 0); diff --git a/tools/perf/util/include/linux/kernel.h b/tools/perf/util/include/linux/kernel.h index b6842c1d02a8dfd6ed22da698e8e3cf65ff9a50c..4af9a10cc2d2ff00a039f66841bfa6af686e6283 100644 --- a/tools/perf/util/include/linux/kernel.h +++ b/tools/perf/util/include/linux/kernel.h @@ -47,8 +47,12 @@ #endif #ifndef BUG_ON +#ifdef NDEBUG +#define BUG_ON(cond) do { if (cond) {} } while (0) +#else #define BUG_ON(cond) assert(!(cond)) #endif +#endif /* * Both need more care to handle endianness