| .. | .. |
|---|
| 2 | 2 | #ifndef __LINUX_DEBUG_LOCKING_H |
|---|
| 3 | 3 | #define __LINUX_DEBUG_LOCKING_H |
|---|
| 4 | 4 | |
|---|
| 5 | | -#include <linux/kernel.h> |
|---|
| 6 | 5 | #include <linux/atomic.h> |
|---|
| 7 | 6 | #include <linux/bug.h> |
|---|
| 7 | +#include <linux/printk.h> |
|---|
| 8 | +#include <linux/cache.h> |
|---|
| 8 | 9 | |
|---|
| 9 | 10 | struct task_struct; |
|---|
| 10 | 11 | |
|---|
| 11 | | -extern int debug_locks; |
|---|
| 12 | | -extern int debug_locks_silent; |
|---|
| 12 | +extern int debug_locks __read_mostly; |
|---|
| 13 | +extern int debug_locks_silent __read_mostly; |
|---|
| 13 | 14 | |
|---|
| 14 | 15 | |
|---|
| 15 | | -static inline int __debug_locks_off(void) |
|---|
| 16 | +static __always_inline int __debug_locks_off(void) |
|---|
| 16 | 17 | { |
|---|
| 17 | 18 | return xchg(&debug_locks, 0); |
|---|
| 18 | 19 | } |
|---|
| .. | .. |
|---|
| 27 | 28 | int __ret = 0; \ |
|---|
| 28 | 29 | \ |
|---|
| 29 | 30 | if (!oops_in_progress && unlikely(c)) { \ |
|---|
| 31 | + instrumentation_begin(); \ |
|---|
| 30 | 32 | if (debug_locks_off() && !debug_locks_silent) \ |
|---|
| 31 | 33 | WARN(1, "DEBUG_LOCKS_WARN_ON(%s)", #c); \ |
|---|
| 34 | + instrumentation_end(); \ |
|---|
| 32 | 35 | __ret = 1; \ |
|---|
| 33 | 36 | } \ |
|---|
| 34 | 37 | __ret; \ |
|---|