linux/arch/s390
Steven Rostedt 71e308a239 function-graph: add stack frame test
In case gcc does something funny with the stack frames, or the return
from function code, we would like to detect that.

An arch may implement passing of a variable that is unique to the
function and can be saved on entering a function and can be tested
when exiting the function. Usually the frame pointer can be used for
this purpose.

This patch also implements this for x86. Where it passes in the stack
frame of the parent function, and will test that frame on exit.

There was a case in x86_32 with optimize for size (-Os) where, for a
few functions, gcc would align the stack frame and place a copy of the
return address into it. The function graph tracer modified the copy and
not the actual return address. On return from the funtion, it did not go
to the tracer hook, but returned to the parent. This broke the function
graph tracer, because the return of the parent (where gcc did not do
this funky manipulation) returned to the location that the child function
was suppose to. This caused strange kernel crashes.

This test detected the problem and pointed out where the issue was.

This modifies the parameters of one of the functions that the arch
specific code calls, so it includes changes to arch code to accommodate
the new prototype.

Note, I notice that the parsic arch implements its own push_return_trace.
This is now a generic function and the ftrace_push_return_trace should be
used instead. This patch does not touch that code.

Cc: Benjamin Herrenschmidt <benh@kernel.crashing.org>
Cc: Paul Mackerras <paulus@samba.org>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: Martin Schwidefsky <schwidefsky@de.ibm.com>
Cc: Frederic Weisbecker <fweisbec@gmail.com>
Cc: Helge Deller <deller@gmx.de>
Cc: Kyle McMartin <kyle@mcmartin.ca>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
2009-06-18 18:40:18 -04:00
..
appldata [S390] appldata: avoid deadlock with appldata_mem 2009-04-23 13:58:17 +02:00
boot [PATCH] use ${CROSS_COMPILE}installkernel in arch/*/boot/install.sh 2005-06-23 09:45:07 -07:00
crypto Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6 2009-03-26 16:04:22 -07:00
hypfs [S390] fix hypfs build failure 2009-03-31 19:17:03 +02:00
include/asm Merge branch 'for-linus' of git://git390.marist.edu/pub/scm/linux-2.6 2009-06-12 18:18:05 -07:00
kernel function-graph: add stack frame test 2009-06-18 18:40:18 -04:00
kvm [S390] uaccess: use might_fault() instead of might_sleep() 2009-06-12 10:27:33 +02:00
lib [S390] implement interrupt-enabling rwlocks 2009-06-12 10:27:29 +02:00
math-emu [S390] remove -traditional 2008-04-30 13:38:44 +02:00
mm [S390] maccess: arch specific probe_kernel_write() implementation 2009-06-12 10:27:37 +02:00
oprofile Combine instrumentation menus in kernel/Kconfig.instrumentation 2007-10-19 11:53:54 -07:00
defconfig [S390] update default configuration. 2009-04-23 13:58:18 +02:00
Kconfig [S390] ftrace: add system call tracer support 2009-06-12 10:27:39 +02:00
Kconfig.debug generic debug pagealloc: build fix 2009-04-02 19:04:48 -07:00
Makefile [S390] Add processor type march=z10 and a processor type safety check. 2008-12-25 13:39:12 +01:00