s390/ftrace: optimize mcount code
authorHeiko Carstens <heiko.carstens@de.ibm.com>
Wed, 3 Sep 2014 11:26:23 +0000 (13:26 +0200)
committerMartin Schwidefsky <schwidefsky@de.ibm.com>
Tue, 9 Sep 2014 06:53:30 +0000 (08:53 +0200)
commit3d1e220d08c6a00ffa83d39030b8162f66665b2b
tree4529f0d568ef53d296476a640d26ae0128bcbacf
parentea2f47699082b971769be8b8f38c08b49219f471
s390/ftrace: optimize mcount code

Reduce the number of executed instructions within the mcount block if
function tracing is enabled. We achieve that by using a non-standard
C function call ABI. Since the called function is also written in
assembler this is not a problem.
This also allows to replace the unconditional store at the beginning
of the mcount block with a larl instruction, which doesn't touch
memory.

In theory we could also patch the first instruction of the mcount block
to enable and disable function tracing. However this would break kprobes.
This could be fixed with implementing the "kprobes_on_ftrace" feature;
however keeping the odd jprobes working seems not to be possible without
a lot of code churn. Therefore keep the code easy and simply accept one
wasted 1-cycle "larl" instruction per function prologue.

Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
arch/s390/include/asm/ftrace.h
arch/s390/kernel/ftrace.c
arch/s390/kernel/mcount64.S
This page took 0.026827 seconds and 5 git commands to generate.