1 #ifndef __LINUX_DEBUG_LOCKING_H
2 #define __LINUX_DEBUG_LOCKING_H
4 extern int debug_locks
;
5 extern int debug_locks_silent
;
8 * Generic 'turn off all lock debugging' function:
10 extern int debug_locks_off(void);
13 * In the debug case we carry the caller's instruction pointer into
14 * other functions, but we dont want the function argument overhead
15 * in the nondebug case - hence these macros:
17 #define _RET_IP_ (unsigned long)__builtin_return_address(0)
18 #define _THIS_IP_ ({ __label__ __here; __here: (unsigned long)&&__here; })
20 #define DEBUG_LOCKS_WARN_ON(c) \
25 if (debug_locks_off()) \
33 # define SMP_DEBUG_LOCKS_WARN_ON(c) DEBUG_LOCKS_WARN_ON(c)
35 # define SMP_DEBUG_LOCKS_WARN_ON(c) do { } while (0)
38 #ifdef CONFIG_DEBUG_LOCKING_API_SELFTESTS
39 extern void locking_selftest(void);
41 # define locking_selftest() do { } while (0)
45 extern void debug_show_all_locks(void);
46 extern void debug_show_held_locks(struct task_struct
*task
);
47 extern void debug_check_no_locks_freed(const void *from
, unsigned long len
);
48 extern void debug_check_no_locks_held(struct task_struct
*task
);
50 static inline void debug_show_all_locks(void)
54 static inline void debug_show_held_locks(struct task_struct
*task
)
59 debug_check_no_locks_freed(const void *from
, unsigned long len
)
64 debug_check_no_locks_held(struct task_struct
*task
)