diff options
Diffstat (limited to 'lib/Kconfig.debug')
-rw-r--r-- | lib/Kconfig.debug | 127 |
1 files changed, 114 insertions, 13 deletions
diff --git a/lib/Kconfig.debug b/lib/Kconfig.debug index e4fcbd12cf6e..e5889b1a33ff 100644 --- a/lib/Kconfig.debug +++ b/lib/Kconfig.debug | |||
@@ -48,7 +48,7 @@ config DEBUG_KERNEL | |||
48 | config LOG_BUF_SHIFT | 48 | config LOG_BUF_SHIFT |
49 | int "Kernel log buffer size (16 => 64KB, 17 => 128KB)" if DEBUG_KERNEL | 49 | int "Kernel log buffer size (16 => 64KB, 17 => 128KB)" if DEBUG_KERNEL |
50 | range 12 21 | 50 | range 12 21 |
51 | default 17 if S390 | 51 | default 17 if S390 || LOCKDEP |
52 | default 16 if X86_NUMAQ || IA64 | 52 | default 16 if X86_NUMAQ || IA64 |
53 | default 15 if SMP | 53 | default 15 if SMP |
54 | default 14 | 54 | default 14 |
@@ -107,7 +107,7 @@ config DEBUG_SLAB_LEAK | |||
107 | 107 | ||
108 | config DEBUG_PREEMPT | 108 | config DEBUG_PREEMPT |
109 | bool "Debug preemptible kernel" | 109 | bool "Debug preemptible kernel" |
110 | depends on DEBUG_KERNEL && PREEMPT | 110 | depends on DEBUG_KERNEL && PREEMPT && TRACE_IRQFLAGS_SUPPORT |
111 | default y | 111 | default y |
112 | help | 112 | help |
113 | If you say Y here then the kernel will use a debug variant of the | 113 | If you say Y here then the kernel will use a debug variant of the |
@@ -115,14 +115,6 @@ config DEBUG_PREEMPT | |||
115 | if kernel code uses it in a preemption-unsafe way. Also, the kernel | 115 | if kernel code uses it in a preemption-unsafe way. Also, the kernel |
116 | will detect preemption count underflows. | 116 | will detect preemption count underflows. |
117 | 117 | ||
118 | config DEBUG_MUTEXES | ||
119 | bool "Mutex debugging, deadlock detection" | ||
120 | default n | ||
121 | depends on DEBUG_KERNEL | ||
122 | help | ||
123 | This allows mutex semantics violations and mutex related deadlocks | ||
124 | (lockups) to be detected and reported automatically. | ||
125 | |||
126 | config DEBUG_RT_MUTEXES | 118 | config DEBUG_RT_MUTEXES |
127 | bool "RT Mutex debugging, deadlock detection" | 119 | bool "RT Mutex debugging, deadlock detection" |
128 | depends on DEBUG_KERNEL && RT_MUTEXES | 120 | depends on DEBUG_KERNEL && RT_MUTEXES |
@@ -142,7 +134,7 @@ config RT_MUTEX_TESTER | |||
142 | This option enables a rt-mutex tester. | 134 | This option enables a rt-mutex tester. |
143 | 135 | ||
144 | config DEBUG_SPINLOCK | 136 | config DEBUG_SPINLOCK |
145 | bool "Spinlock debugging" | 137 | bool "Spinlock and rw-lock debugging: basic checks" |
146 | depends on DEBUG_KERNEL | 138 | depends on DEBUG_KERNEL |
147 | help | 139 | help |
148 | Say Y here and build SMP to catch missing spinlock initialization | 140 | Say Y here and build SMP to catch missing spinlock initialization |
@@ -150,13 +142,122 @@ config DEBUG_SPINLOCK | |||
150 | best used in conjunction with the NMI watchdog so that spinlock | 142 | best used in conjunction with the NMI watchdog so that spinlock |
151 | deadlocks are also debuggable. | 143 | deadlocks are also debuggable. |
152 | 144 | ||
145 | config DEBUG_MUTEXES | ||
146 | bool "Mutex debugging: basic checks" | ||
147 | depends on DEBUG_KERNEL | ||
148 | help | ||
149 | This feature allows mutex semantics violations to be detected and | ||
150 | reported. | ||
151 | |||
152 | config DEBUG_RWSEMS | ||
153 | bool "RW-sem debugging: basic checks" | ||
154 | depends on DEBUG_KERNEL | ||
155 | help | ||
156 | This feature allows read-write semaphore semantics violations to | ||
157 | be detected and reported. | ||
158 | |||
159 | config DEBUG_LOCK_ALLOC | ||
160 | bool "Lock debugging: detect incorrect freeing of live locks" | ||
161 | depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT | ||
162 | select DEBUG_SPINLOCK | ||
163 | select DEBUG_MUTEXES | ||
164 | select DEBUG_RWSEMS | ||
165 | select LOCKDEP | ||
166 | help | ||
167 | This feature will check whether any held lock (spinlock, rwlock, | ||
168 | mutex or rwsem) is incorrectly freed by the kernel, via any of the | ||
169 | memory-freeing routines (kfree(), kmem_cache_free(), free_pages(), | ||
170 | vfree(), etc.), whether a live lock is incorrectly reinitialized via | ||
171 | spin_lock_init()/mutex_init()/etc., or whether there is any lock | ||
172 | held during task exit. | ||
173 | |||
174 | config PROVE_LOCKING | ||
175 | bool "Lock debugging: prove locking correctness" | ||
176 | depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT | ||
177 | select LOCKDEP | ||
178 | select DEBUG_SPINLOCK | ||
179 | select DEBUG_MUTEXES | ||
180 | select DEBUG_RWSEMS | ||
181 | select DEBUG_LOCK_ALLOC | ||
182 | default n | ||
183 | help | ||
184 | This feature enables the kernel to prove that all locking | ||
185 | that occurs in the kernel runtime is mathematically | ||
186 | correct: that under no circumstance could an arbitrary (and | ||
187 | not yet triggered) combination of observed locking | ||
188 | sequences (on an arbitrary number of CPUs, running an | ||
189 | arbitrary number of tasks and interrupt contexts) cause a | ||
190 | deadlock. | ||
191 | |||
192 | In short, this feature enables the kernel to report locking | ||
193 | related deadlocks before they actually occur. | ||
194 | |||
195 | The proof does not depend on how hard and complex a | ||
196 | deadlock scenario would be to trigger: how many | ||
197 | participant CPUs, tasks and irq-contexts would be needed | ||
198 | for it to trigger. The proof also does not depend on | ||
199 | timing: if a race and a resulting deadlock is possible | ||
200 | theoretically (no matter how unlikely the race scenario | ||
201 | is), it will be proven so and will immediately be | ||
202 | reported by the kernel (once the event is observed that | ||
203 | makes the deadlock theoretically possible). | ||
204 | |||
205 | If a deadlock is impossible (i.e. the locking rules, as | ||
206 | observed by the kernel, are mathematically correct), the | ||
207 | kernel reports nothing. | ||
208 | |||
209 | NOTE: this feature can also be enabled for rwlocks, mutexes | ||
210 | and rwsems - in which case all dependencies between these | ||
211 | different locking variants are observed and mapped too, and | ||
212 | the proof of observed correctness is also maintained for an | ||
213 | arbitrary combination of these separate locking variants. | ||
214 | |||
215 | For more details, see Documentation/lockdep-design.txt. | ||
216 | |||
217 | config LOCKDEP | ||
218 | bool | ||
219 | depends on TRACE_IRQFLAGS_SUPPORT && STACKTRACE_SUPPORT && LOCKDEP_SUPPORT | ||
220 | select STACKTRACE | ||
221 | select FRAME_POINTER | ||
222 | select KALLSYMS | ||
223 | select KALLSYMS_ALL | ||
224 | |||
225 | config DEBUG_LOCKDEP | ||
226 | bool "Lock dependency engine debugging" | ||
227 | depends on LOCKDEP | ||
228 | help | ||
229 | If you say Y here, the lock dependency engine will do | ||
230 | additional runtime checks to debug itself, at the price | ||
231 | of more runtime overhead. | ||
232 | |||
233 | config TRACE_IRQFLAGS | ||
234 | bool | ||
235 | default y | ||
236 | depends on TRACE_IRQFLAGS_SUPPORT | ||
237 | depends on PROVE_LOCKING | ||
238 | |||
153 | config DEBUG_SPINLOCK_SLEEP | 239 | config DEBUG_SPINLOCK_SLEEP |
154 | bool "Sleep-inside-spinlock checking" | 240 | bool "Spinlock debugging: sleep-inside-spinlock checking" |
155 | depends on DEBUG_KERNEL | 241 | depends on DEBUG_KERNEL |
156 | help | 242 | help |
157 | If you say Y here, various routines which may sleep will become very | 243 | If you say Y here, various routines which may sleep will become very |
158 | noisy if they are called with a spinlock held. | 244 | noisy if they are called with a spinlock held. |
159 | 245 | ||
246 | config DEBUG_LOCKING_API_SELFTESTS | ||
247 | bool "Locking API boot-time self-tests" | ||
248 | depends on DEBUG_KERNEL | ||
249 | help | ||
250 | Say Y here if you want the kernel to run a short self-test during | ||
251 | bootup. The self-test checks whether common types of locking bugs | ||
252 | are detected by debugging mechanisms or not. (if you disable | ||
253 | lock debugging then those bugs wont be detected of course.) | ||
254 | The following locking APIs are covered: spinlocks, rwlocks, | ||
255 | mutexes and rwsems. | ||
256 | |||
257 | config STACKTRACE | ||
258 | bool | ||
259 | depends on STACKTRACE_SUPPORT | ||
260 | |||
160 | config DEBUG_KOBJECT | 261 | config DEBUG_KOBJECT |
161 | bool "kobject debugging" | 262 | bool "kobject debugging" |
162 | depends on DEBUG_KERNEL | 263 | depends on DEBUG_KERNEL |
@@ -212,7 +313,7 @@ config DEBUG_VM | |||
212 | 313 | ||
213 | config FRAME_POINTER | 314 | config FRAME_POINTER |
214 | bool "Compile the kernel with frame pointers" | 315 | bool "Compile the kernel with frame pointers" |
215 | depends on DEBUG_KERNEL && (X86 || CRIS || M68K || M68KNOMMU || FRV || UML) | 316 | depends on DEBUG_KERNEL && (X86 || CRIS || M68K || M68KNOMMU || FRV || UML || S390) |
216 | default y if DEBUG_INFO && UML | 317 | default y if DEBUG_INFO && UML |
217 | help | 318 | help |
218 | If you say Y here the resulting kernel image will be slightly larger | 319 | If you say Y here the resulting kernel image will be slightly larger |