linux/arch/powerpc
Steven Rostedt c7b0d17366 powerpc: ftrace, do nothing in mcount call for dyn ftrace
Impact: quicken mcount calls that are not replaced by dyn ftrace

Dynamic ftrace no longer does on the fly recording of mcount locations.
The mcount locations are now found at compile time. The mcount
function no longer needs to store registers and call a stub function.
It can now just simply return.

Since there are some functions that do not get converted to a nop
(.init sections and other code that may disappear), this patch should
help speed up that code.

Also, the stub for mcount on PowerPC 32 can not be a simple branch
link register like it is on PowerPC 64. According to the ABI specification:

"The _mcount routine is required to restore the link register from
 the stack so that the profiling code can be inserted transparently,
 whether or not the profiled function saves the link register itself."

This means that we must restore the link register that was used
to make the call to mcount.  The minimal mcount function for PPC32
ends up being:

 mcount:
        mflr    r0
        mtctr   r0
        lwz     r0, 4(r1)
        mtlr    r0
        bctr

Where we move the link register used to call mcount into the
ctr register, and then restore the link register from the stack.
Then we use the ctr register to jump back to the mcount caller.
The r0 register is free for us to use.

Signed-off-by: Steven Rostedt <srostedt@redhat.com>
Signed-off-by: Ingo Molnar <mingo@elte.hu>
2008-11-28 14:07:45 +01:00
..
boot powerpc/86xx: Correct SOC bus-frequency in GE Fanuc SBC610 DTS 2008-11-08 12:39:01 -06:00
configs powerpc: Update desktop/server defconfigs 2008-11-11 19:42:30 +11:00
include/asm powerpc/ppc32: ftrace, dynamic ftrace to handle modules 2008-11-20 10:52:53 -08:00
kernel powerpc: ftrace, do nothing in mcount call for dyn ftrace 2008-11-28 14:07:45 +01:00
kvm KVM: switch to get_user_pages_fast 2008-10-15 14:25:06 +02:00
lib powerpc: Fix DMA offset for non-coherent DMA 2008-10-14 10:35:26 +11:00
math-emu powerpc/math-emu: Use kernel generic math-emu code 2008-10-01 08:40:07 -05:00
mm powerpc: Don't use a 16G page if beyond mem= limits 2008-10-22 15:01:21 +11:00
oprofile powerpc/cell/OProfile: Fix on-stack array size in activate spu profiling function 2008-10-31 16:13:51 +11:00
platforms powerpc: Fix "unused variable" warning in pci_dlpar.c 2008-11-05 19:59:08 +11:00
sysdev Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6 2008-11-02 10:15:52 -08:00
xmon powerpc: Fix compile errors with CONFIG_BUG=n 2008-10-31 21:34:09 +11:00
Kconfig Merge commit 'v2.6.28-rc2' into tracing/urgent 2008-10-27 10:50:54 +01:00
Kconfig.debug powerpc: Split-out common MSI bitmap logic into msi_bitmap.c 2008-08-20 16:34:57 +10:00
Makefile ftrace: rename FTRACE to FUNCTION_TRACER 2008-10-20 18:27:03 +02:00