diff options
| author | Stephen Hemminger <shemminger@osdl.org> | 2003-09-22 14:12:56 -0700 |
|---|---|---|
| committer | Stephen Hemminger <shemminger@osdl.org> | 2003-09-22 14:12:56 -0700 |
| commit | f3b65b776ea63fc3e77b4185685f8050765f71d3 (patch) | |
| tree | 4831b190991d4ddbcc7e4d6fd1117e5a24907e23 | |
| parent | 70a209fbe4794269d101d46cb1ef386aee5df413 (diff) | |
[NET]: rtnetlink -- ASSERT_RTNL and BUG_TRAP.
Change ASSERT_RTNL and BUG_TRAP
- unlikely to occur
- tag message as error
- dump_stack in ASSERT_RTNL to aide finding code path
- make all format's which a smart compiler can optimize
| -rw-r--r-- | include/linux/rtnetlink.h | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h index 3406e8cfc32c..1141ec3c5321 100644 --- a/include/linux/rtnetlink.h +++ b/include/linux/rtnetlink.h @@ -683,11 +683,21 @@ extern void rtnl_lock(void); extern void rtnl_unlock(void); extern void rtnetlink_init(void); -#define ASSERT_RTNL() do { if (down_trylock(&rtnl_sem) == 0) { up(&rtnl_sem); \ -printk("RTNL: assertion failed at " __FILE__ "(%d)\n", __LINE__); } \ - } while(0) -#define BUG_TRAP(x) if (!(x)) { printk("KERNEL: assertion (" #x ") failed at " __FILE__ "(%d)\n", __LINE__); } - +#define ASSERT_RTNL() do { \ + if (unlikely(down_trylock(&rtnl_sem) == 0)) { \ + up(&rtnl_sem); \ + printk(KERN_ERR "RTNL: assertion failed at %s (%d)\n", \ + __FILE__, __LINE__); \ + dump_stack(); \ + } \ +} while(0) + +#define BUG_TRAP(x) do { \ + if (unlikely(!(x))) { \ + printk(KERN_ERR "KERNEL: assertion (%s) failed at %s (%d)\n", \ + #x, __FILE__ , __LINE__); \ + } \ +} while(0) #endif /* __KERNEL__ */ |
