ia64/linux-2.6.18-xen.hg

annotate lib/debug_locks.c @ 740:bf8b1ee634e2

balloon: Fix the build by including <linux/init.h>

Signed-off-by: Keir Fraser <keir.fraser@citrix.com>
author Keir Fraser <keir.fraser@citrix.com>
date Tue Nov 25 11:19:41 2008 +0000 (2008-11-25)
parents 831230e53067
children
rev   line source
ian@0 1 /*
ian@0 2 * lib/debug_locks.c
ian@0 3 *
ian@0 4 * Generic place for common debugging facilities for various locks:
ian@0 5 * spinlocks, rwlocks, mutexes and rwsems.
ian@0 6 *
ian@0 7 * Started by Ingo Molnar:
ian@0 8 *
ian@0 9 * Copyright (C) 2006 Red Hat, Inc., Ingo Molnar <mingo@redhat.com>
ian@0 10 */
ian@0 11 #include <linux/rwsem.h>
ian@0 12 #include <linux/mutex.h>
ian@0 13 #include <linux/module.h>
ian@0 14 #include <linux/spinlock.h>
ian@0 15 #include <linux/debug_locks.h>
ian@0 16
ian@0 17 /*
ian@0 18 * We want to turn all lock-debugging facilities on/off at once,
ian@0 19 * via a global flag. The reason is that once a single bug has been
ian@0 20 * detected and reported, there might be cascade of followup bugs
ian@0 21 * that would just muddy the log. So we report the first one and
ian@0 22 * shut up after that.
ian@0 23 */
ian@0 24 int debug_locks = 1;
ian@0 25
ian@0 26 /*
ian@0 27 * The locking-testsuite uses <debug_locks_silent> to get a
ian@0 28 * 'silent failure': nothing is printed to the console when
ian@0 29 * a locking bug is detected.
ian@0 30 */
ian@0 31 int debug_locks_silent;
ian@0 32
ian@0 33 /*
ian@0 34 * Generic 'turn off all lock debugging' function:
ian@0 35 */
ian@0 36 int debug_locks_off(void)
ian@0 37 {
ian@0 38 if (xchg(&debug_locks, 0)) {
ian@0 39 if (!debug_locks_silent) {
ian@0 40 console_verbose();
ian@0 41 return 1;
ian@0 42 }
ian@0 43 }
ian@0 44 return 0;
ian@0 45 }