diff options
author | David S. Miller <davem@davemloft.net> | 2010-04-13 01:35:24 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-04-13 01:35:24 -0400 |
commit | 63b754957371c23b7515399a977a2e1d361a036c (patch) | |
tree | d1e7cd39f91215970300adfffcdf96b5f7484c43 /arch/sparc/lib | |
parent | 0c25e9e6cbe7b233bb91d14d0e2c258bf8e6ec83 (diff) |
sparc64: Add HAVE_FUNCTION_TRACE_MCOUNT_TEST and tidy up.
Check function_trace_stop at ftrace_caller
Toss mcount_call and dummy call of ftrace_stub, unnecessary.
Document problems we'll have if the final kernel image link
ever turns on relaxation.
Properly size 'ftrace_call' so it looks right when inspecting
instructions under gdb et al.
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc/lib')
-rw-r--r-- | arch/sparc/lib/mcount.S | 22 |
1 files changed, 15 insertions, 7 deletions
diff --git a/arch/sparc/lib/mcount.S b/arch/sparc/lib/mcount.S index 24b8b12deed2..7047997be0eb 100644 --- a/arch/sparc/lib/mcount.S +++ b/arch/sparc/lib/mcount.S | |||
@@ -96,13 +96,12 @@ mcount: | |||
96 | #endif | 96 | #endif |
97 | #ifdef CONFIG_FUNCTION_TRACER | 97 | #ifdef CONFIG_FUNCTION_TRACER |
98 | #ifdef CONFIG_DYNAMIC_FTRACE | 98 | #ifdef CONFIG_DYNAMIC_FTRACE |
99 | mov %o7, %o0 | 99 | /* Do nothing, the retl/nop below is all we need. */ |
100 | .globl mcount_call | ||
101 | mcount_call: | ||
102 | call ftrace_stub | ||
103 | mov %o0, %o7 | ||
104 | #else | 100 | #else |
105 | sethi %hi(ftrace_trace_function), %g1 | 101 | sethi %hi(function_trace_stop), %g1 |
102 | lduw [%g1 + %lo(function_trace_stop)], %g2 | ||
103 | brnz,pn %g2, 1f | ||
104 | sethi %hi(ftrace_trace_function), %g1 | ||
106 | sethi %hi(ftrace_stub), %g2 | 105 | sethi %hi(ftrace_stub), %g2 |
107 | ldx [%g1 + %lo(ftrace_trace_function)], %g1 | 106 | ldx [%g1 + %lo(ftrace_trace_function)], %g1 |
108 | or %g2, %lo(ftrace_stub), %g2 | 107 | or %g2, %lo(ftrace_stub), %g2 |
@@ -131,14 +130,23 @@ ftrace_stub: | |||
131 | .globl ftrace_caller | 130 | .globl ftrace_caller |
132 | .type ftrace_caller,#function | 131 | .type ftrace_caller,#function |
133 | ftrace_caller: | 132 | ftrace_caller: |
133 | sethi %hi(function_trace_stop), %g1 | ||
134 | mov %i7, %o1 | 134 | mov %i7, %o1 |
135 | mov %o7, %o0 | 135 | lduw [%g1 + %lo(function_trace_stop)], %g2 |
136 | brnz,pn %g2, ftrace_stub | ||
137 | mov %o7, %o0 | ||
136 | .globl ftrace_call | 138 | .globl ftrace_call |
137 | ftrace_call: | 139 | ftrace_call: |
140 | /* If the final kernel link ever turns on relaxation, we'll need | ||
141 | * to do something about this tail call. Otherwise the linker | ||
142 | * will rewrite the call into a branch and nop out the move | ||
143 | * instruction. | ||
144 | */ | ||
138 | call ftrace_stub | 145 | call ftrace_stub |
139 | mov %o0, %o7 | 146 | mov %o0, %o7 |
140 | retl | 147 | retl |
141 | nop | 148 | nop |
149 | .size ftrace_call,.-ftrace_call | ||
142 | .size ftrace_caller,.-ftrace_caller | 150 | .size ftrace_caller,.-ftrace_caller |
143 | #endif | 151 | #endif |
144 | #endif | 152 | #endif |