sh: ftrace support.

This adds support for ftrace to SH. This only includes CONFIG_FTRACE,
and does not handle dynamic ftrace presently.

Signed-off-by: Paul Mundt <lethal@linux-sh.org>
This commit is contained in:
Paul Mundt
2008-09-21 16:43:45 +09:00
parent 3d58695edb
commit 9d2b1f81dd
4 changed files with 54 additions and 0 deletions

View File

@@ -371,3 +371,47 @@ syscall_exit:
#endif
7: .long do_syscall_trace_enter
8: .long do_syscall_trace_leave
#ifdef CONFIG_FTRACE
.align 2
.globl _mcount
.type _mcount,@function
.globl mcount
.type mcount,@function
_mcount:
mcount:
mov.l r4, @-r15
mov.l r5, @-r15
mov.l r6, @-r15
mov.l r7, @-r15
sts.l pr, @-r15
mov.l @(20,r15),r4
sts pr, r5
mov.l 1f, r6
mov.l ftrace_stub, r7
cmp/eq r6, r7
bt skip_trace
mov.l @r6, r6
jsr @r6
nop
skip_trace:
lds.l @r15+, pr
mov.l @r15+, r7
mov.l @r15+, r6
mov.l @r15+, r5
rts
mov.l @r15+, r4
.align 2
1: .long ftrace_trace_function
.globl ftrace_stub
ftrace_stub:
rts
nop
#endif /* CONFIG_FTRACE */