/*1* lib/debug_locks.c2*3* Generic place for common debugging facilities for various locks:4* spinlocks, rwlocks, mutexes and rwsems.5*6* Started by Ingo Molnar:7*8* Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <[email protected]>9*/10#include <linux/rwsem.h>11#include <linux/mutex.h>12#include <linux/module.h>13#include <linux/spinlock.h>14#include <linux/debug_locks.h>1516/*17* We want to turn all lock-debugging facilities on/off at once,18* via a global flag. The reason is that once a single bug has been19* detected and reported, there might be cascade of followup bugs20* that would just muddy the log. So we report the first one and21* shut up after that.22*/23int debug_locks = 1;24EXPORT_SYMBOL_GPL(debug_locks);2526/*27* The locking-testsuite uses <debug_locks_silent> to get a28* 'silent failure': nothing is printed to the console when29* a locking bug is detected.30*/31int debug_locks_silent;3233/*34* Generic 'turn off all lock debugging' function:35*/36int debug_locks_off(void)37{38if (__debug_locks_off()) {39if (!debug_locks_silent) {40console_verbose();41return 1;42}43}44return 0;45}464748