提交 c761c841 编写于 作者: R Robert P. J. Day 提交者: Linus Torvalds

kconfig: centralize the selection of semaphore debugging in lib/Kconfig.debug

Remove the Kconfig selection of semaphore debugging from the ALPHA and FRV
Kconfig files, and centralize it in lib/Kconfig.debug.

There doesn't seem to be much point in letting individual architectures
independently define the same Kconfig option when it can just as easily be
put in a single Kconfig file and made dependent on a subset of
architectures.  that way, at least the option shows up in the same relative
location in the menu each time.
Signed-off-by: NRobert P. J. Day <rpjday@mindspring.com>
Cc: David Howells <dhowells@redhat.com>
Cc: Ivan Kokshaysky <ink@jurassic.park.msu.ru>
Cc: Richard Henderson <rth@twiddle.net>
Signed-off-by: NAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: NLinus Torvalds <torvalds@linux-foundation.org>
上级 f87367a6
...@@ -16,14 +16,6 @@ config DEBUG_RWLOCK ...@@ -16,14 +16,6 @@ config DEBUG_RWLOCK
too many attempts. If you suspect a rwlock problem or a kernel too many attempts. If you suspect a rwlock problem or a kernel
hacker asks for this option then say Y. Otherwise say N. hacker asks for this option then say Y. Otherwise say N.
config DEBUG_SEMAPHORE
bool "Semaphore debugging"
depends on DEBUG_KERNEL
help
If you say Y here then semaphore processing will issue lots of
verbose debugging messages. If you suspect a semaphore problem or a
kernel hacker asks for this option then say Y. Otherwise say N.
config ALPHA_LEGACY_START_ADDRESS config ALPHA_LEGACY_START_ADDRESS
bool "Legacy kernel start address" bool "Legacy kernel start address"
depends on ALPHA_GENERIC depends on ALPHA_GENERIC
......
...@@ -19,7 +19,7 @@ struct sem_waiter { ...@@ -19,7 +19,7 @@ struct sem_waiter {
struct task_struct *task; struct task_struct *task;
}; };
#if SEMAPHORE_DEBUG #ifdef CONFIG_DEBUG_SEMAPHORE
void semtrace(struct semaphore *sem, const char *str) void semtrace(struct semaphore *sem, const char *str)
{ {
if (sem->debug) if (sem->debug)
......
...@@ -20,8 +20,6 @@ ...@@ -20,8 +20,6 @@
#include <linux/spinlock.h> #include <linux/spinlock.h>
#include <linux/rwsem.h> #include <linux/rwsem.h>
#define SEMAPHORE_DEBUG 0
/* /*
* the semaphore definition * the semaphore definition
* - if counter is >0 then there are tokens available on the semaphore for down to collect * - if counter is >0 then there are tokens available on the semaphore for down to collect
...@@ -32,12 +30,12 @@ struct semaphore { ...@@ -32,12 +30,12 @@ struct semaphore {
unsigned counter; unsigned counter;
spinlock_t wait_lock; spinlock_t wait_lock;
struct list_head wait_list; struct list_head wait_list;
#if SEMAPHORE_DEBUG #ifdef CONFIG_DEBUG_SEMAPHORE
unsigned __magic; unsigned __magic;
#endif #endif
}; };
#if SEMAPHORE_DEBUG #ifdef CONFIG_DEBUG_SEMAPHORE
# define __SEM_DEBUG_INIT(name) , (long)&(name).__magic # define __SEM_DEBUG_INIT(name) , (long)&(name).__magic
#else #else
# define __SEM_DEBUG_INIT(name) # define __SEM_DEBUG_INIT(name)
...@@ -76,7 +74,7 @@ static inline void down(struct semaphore *sem) ...@@ -76,7 +74,7 @@ static inline void down(struct semaphore *sem)
{ {
unsigned long flags; unsigned long flags;
#if SEMAPHORE_DEBUG #ifdef CONFIG_DEBUG_SEMAPHORE
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
...@@ -95,7 +93,7 @@ static inline int down_interruptible(struct semaphore *sem) ...@@ -95,7 +93,7 @@ static inline int down_interruptible(struct semaphore *sem)
unsigned long flags; unsigned long flags;
int ret = 0; int ret = 0;
#if SEMAPHORE_DEBUG #ifdef CONFIG_DEBUG_SEMAPHORE
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
...@@ -119,7 +117,7 @@ static inline int down_trylock(struct semaphore *sem) ...@@ -119,7 +117,7 @@ static inline int down_trylock(struct semaphore *sem)
unsigned long flags; unsigned long flags;
int success = 0; int success = 0;
#if SEMAPHORE_DEBUG #ifdef CONFIG_DEBUG_SEMAPHORE
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
...@@ -136,7 +134,7 @@ static inline void up(struct semaphore *sem) ...@@ -136,7 +134,7 @@ static inline void up(struct semaphore *sem)
{ {
unsigned long flags; unsigned long flags;
#if SEMAPHORE_DEBUG #ifdef CONFIG_DEBUG_SEMAPHORE
CHECK_MAGIC(sem->__magic); CHECK_MAGIC(sem->__magic);
#endif #endif
......
...@@ -201,6 +201,16 @@ config DEBUG_MUTEXES ...@@ -201,6 +201,16 @@ config DEBUG_MUTEXES
This feature allows mutex semantics violations to be detected and This feature allows mutex semantics violations to be detected and
reported. reported.
config DEBUG_SEMAPHORE
bool "Semaphore debugging"
depends on DEBUG_KERNEL
depends on ALPHA || FRV
default n
help
If you say Y here then semaphore processing will issue lots of
verbose debugging messages. If you suspect a semaphore problem or a
kernel hacker asks for this option then say Y. Otherwise say N.
config DEBUG_LOCK_ALLOC config DEBUG_LOCK_ALLOC
bool "Lock debugging: detect incorrect freeing of live locks" bool "Lock debugging: detect incorrect freeing of live locks"
depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT depends on DEBUG_KERNEL && TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册