On Mon, 2005-06-27 at 09:28 +0200, Andi Kleen wrote:
> You can just dump the expression (with #argument). That is what
> traditional userspace assert did forever.
>
> It won't help for BUG_ON(a || b || c || d || e) but these
> are bad style anyways and should be avoided.
Sounds good to me. Jens, would this work for you?
Pekka
Show BUG_ON expression when assertion fails.
Signed-off-by: Pekka Enberg <[email protected]>
---
bug.h | 7 ++++++-
1 files changed, 6 insertions(+), 1 deletion(-)
Index: 2.6/include/asm-generic/bug.h
===================================================================
--- 2.6.orig/include/asm-generic/bug.h
+++ 2.6/include/asm-generic/bug.h
@@ -13,7 +13,12 @@
#endif
#ifndef HAVE_ARCH_BUG_ON
-#define BUG_ON(condition) do { if (unlikely((condition)!=0)) BUG(); } while(0)
+#define BUG_ON(condition) do { \
+ if (unlikely((condition) != 0)) { \
+ printk("kernel BUG '%s' at %s:%d!\n", #condition, __FILE__, __LINE__); \
+ panic("BUG!"); \
+ } \
+} while(0)
#endif
#ifndef HAVE_ARCH_WARN_ON
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
[Index of Archives]
[Kernel Newbies]
[Netfilter]
[Bugtraq]
[Photo]
[Stuff]
[Gimp]
[Yosemite News]
[MIPS Linux]
[ARM Linux]
[Linux Security]
[Linux RAID]
[Video 4 Linux]
[Linux for the blind]
[Linux Resources]