summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Sandeen <sandeen@sgi.com>2006-06-26 14:00:08 +0200
committerLinus Torvalds <torvalds@g5.osdl.org>2006-06-26 10:48:22 -0700
commit8501a2fbe762b21d2504ed3aca3b52be61b5e6e4 (patch)
tree899bf4085bb29927a71dd90b3ed1fb444ed4b0ea /include
parent4961f10e2205d0ededa291e12ec634efc58aa93c (diff)
downloadblackbird-op-linux-8501a2fbe762b21d2504ed3aca3b52be61b5e6e4.tar.gz
blackbird-op-linux-8501a2fbe762b21d2504ed3aca3b52be61b5e6e4.zip
[PATCH] x86_64: x86_64 stack usage debugging
Applies to git & 2.6.17-rc6 after CONFIG_DEBUG_STACKOVERFLOW patch uses same stack-zeroing mechanism as on i386 to discover maximum stack excursions. Signed-off-by: Eric Sandeen <sandeen@sgi.com> Signed-off-by: Andi Kleen <ak@suse.de> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
Diffstat (limited to 'include')
-rw-r--r--include/asm-x86_64/thread_info.h13
1 files changed, 13 insertions, 0 deletions
diff --git a/include/asm-x86_64/thread_info.h b/include/asm-x86_64/thread_info.h
index b5e88216fd80..2029b00351f3 100644
--- a/include/asm-x86_64/thread_info.h
+++ b/include/asm-x86_64/thread_info.h
@@ -73,8 +73,21 @@ static inline struct thread_info *stack_thread_info(void)
}
/* thread information allocation */
+#ifdef CONFIG_DEBUG_STACK_USAGE
+#define alloc_thread_info(tsk) \
+ ({ \
+ struct thread_info *ret; \
+ \
+ ret = ((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER)); \
+ if (ret) \
+ memset(ret, 0, THREAD_SIZE); \
+ ret; \
+ })
+#else
#define alloc_thread_info(tsk) \
((struct thread_info *) __get_free_pages(GFP_KERNEL,THREAD_ORDER))
+#endif
+
#define free_thread_info(ti) free_pages((unsigned long) (ti), THREAD_ORDER)
#else /* !__ASSEMBLY__ */
OpenPOWER on IntegriCloud