sparc64: Give a stack frame to the ftrace call sites.
It's the only way we'll be able to implement the function graph tracer properly. A positive is that we no longer have to worry about the linker over-optimizing the tail call, since we don't use a tail call any more. Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
daecbf58a5
commit
a71d1d6bb1
|
@ -33,9 +33,13 @@ mcount:
|
||||||
or %g2, %lo(ftrace_stub), %g2
|
or %g2, %lo(ftrace_stub), %g2
|
||||||
cmp %g1, %g2
|
cmp %g1, %g2
|
||||||
be,pn %icc, 1f
|
be,pn %icc, 1f
|
||||||
mov %i7, %o1
|
mov %i7, %g2
|
||||||
jmpl %g1, %g0
|
save %sp, -128, %sp
|
||||||
mov %o7, %o0
|
mov %g2, %o1
|
||||||
|
jmpl %g1, %o7
|
||||||
|
mov %i7, %o0
|
||||||
|
ret
|
||||||
|
restore
|
||||||
/* not reached */
|
/* not reached */
|
||||||
1:
|
1:
|
||||||
#endif
|
#endif
|
||||||
|
@ -57,21 +61,18 @@ ftrace_stub:
|
||||||
.type ftrace_caller,#function
|
.type ftrace_caller,#function
|
||||||
ftrace_caller:
|
ftrace_caller:
|
||||||
sethi %hi(function_trace_stop), %g1
|
sethi %hi(function_trace_stop), %g1
|
||||||
mov %i7, %o1
|
mov %i7, %g2
|
||||||
lduw [%g1 + %lo(function_trace_stop)], %g2
|
lduw [%g1 + %lo(function_trace_stop)], %g3
|
||||||
brnz,pn %g2, ftrace_stub
|
brnz,pn %g3, ftrace_stub
|
||||||
mov %o7, %o0
|
nop
|
||||||
|
save %sp, -128, %sp
|
||||||
|
mov %g2, %o1
|
||||||
.globl ftrace_call
|
.globl ftrace_call
|
||||||
ftrace_call:
|
ftrace_call:
|
||||||
/* If the final kernel link ever turns on relaxation, we'll need
|
|
||||||
* to do something about this tail call. Otherwise the linker
|
|
||||||
* will rewrite the call into a branch and nop out the move
|
|
||||||
* instruction.
|
|
||||||
*/
|
|
||||||
call ftrace_stub
|
call ftrace_stub
|
||||||
mov %o0, %o7
|
mov %i7, %o0
|
||||||
retl
|
ret
|
||||||
nop
|
restore
|
||||||
.size ftrace_call,.-ftrace_call
|
.size ftrace_call,.-ftrace_call
|
||||||
.size ftrace_caller,.-ftrace_caller
|
.size ftrace_caller,.-ftrace_caller
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Reference in New Issue