menu "Kernel hacking"
+config DEBUG_KERNEL
+ bool "Kernel debugging"
+ help
+ Say Y here if you are developing drivers or trying to debug and
+ identify kernel problems.
+
+config DEBUG_STACK_USAGE
+ bool "Enable stack utilization instrumentation"
+ depends on DEBUG_KERNEL
+ help
+ Enables the display of the minimum amount of free stack which each
+ task has ever had available in the sysrq-T and sysrq-P debug output.
+
+ This option will slow down process creation somewhat.
+
config DEBUG_SLAB
bool "Debug memory allocations"
+ depends on DEBUG_KERNEL
+ help
+ Say Y here to have the kernel do limited verification on memory
+ allocation as well as poisoning memory on free to catch use of freed
+ memory.
config MAGIC_SYSRQ
bool "Magic SysRq key"
+ depends on DEBUG_KERNEL
help
If you say Y here, you will have some control over the system even
if the system crashes for example during kernel debugging (e.g., you
config DEBUG_SPINLOCK
bool "Spinlock debugging"
+ depends on DEBUG_KERNEL
+ help
+ Say Y here and build SMP to catch missing spinlock initialization
+ and certain other kinds of spinlock errors commonly made. This is
+ best used in conjunction with the NMI watchdog so that spinlock
+ deadlocks are also debuggable.
config DEBUG_HIGHMEM
bool "Highmem debugging"
depends on DEBUG_KERNEL && HIGHMEM
help
- This options enables addition error checking for high memory systems.
- Disable for production systems.
+ This options enables additional error checking for high memory
+ systems. Disable for production systems.
config DEBUG_SPINLOCK_SLEEP
bool "Sleep-inside-spinlock checking"
+ depends on DEBUG_KERNEL
help
If you say Y here, various routines which may sleep will become very
noisy if they are called with a spinlock held.
config DEBUG_BUGVERBOSE
bool "Verbose BUG() reporting (adds 70K)"
+ depends on DEBUG_KERNEL
help
Say Y here to make BUG() panics output the file name and line number
of the BUG call as well as the EIP and oops trace. This aids
*/
struct thread_info *srmmu_alloc_thread_info(void)
{
- return (struct thread_info *)
- __get_free_pages(GFP_KERNEL, THREAD_INFO_ORDER);
+ struct thread_info *ret;
+
+ ret = (struct thread_info *)__get_free_pages(GFP_KERNEL,
+ THREAD_INFO_ORDER);
+#ifdef CONFIG_DEBUG_STACK_USAGE
+ memset(ret, 0, PAGE_SIZE << THREAD_INFO_ORDER);
+#endif /* DEBUG_STACK_USAGE */
+
+ return ret;
}
static void srmmu_free_thread_info(struct thread_info *ti)