1 #ifndef __LINUX_DEBUG_LOCKING_H
2 #define __LINUX_DEBUG_LOCKING_H
6 extern int debug_locks;
7 extern int debug_locks_silent;
10 * Generic 'turn off all lock debugging' function:
12 extern int debug_locks_off(void);
15 * In the debug case we carry the caller's instruction pointer into
16 * other functions, but we dont want the function argument overhead
17 * in the nondebug case - hence these macros:
19 #define _RET_IP_ (unsigned long)__builtin_return_address(0)
20 #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
22 #define DEBUG_LOCKS_WARN_ON(c) \
27 if (debug_locks_off()) \
35 # define SMP_DEBUG_LOCKS_WARN_ON(c) DEBUG_LOCKS_WARN_ON(c)
37 # define SMP_DEBUG_LOCKS_WARN_ON(c) do { } while (0)
40 #ifdef CONFIG_DEBUG_LOCKING_API_SELFTESTS
41 extern void locking_selftest(void);
43 # define locking_selftest() do { } while (0)
47 extern void debug_show_all_locks(void);
48 extern void debug_show_held_locks(struct task_struct *task);
49 extern void debug_check_no_locks_freed(const void *from, unsigned long len);
50 extern void debug_check_no_locks_held(struct task_struct *task);
52 static inline void debug_show_all_locks(void)
56 static inline void debug_show_held_locks(struct task_struct *task)
61 debug_check_no_locks_freed(const void *from, unsigned long len)
66 debug_check_no_locks_held(struct task_struct *task)