diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2009-06-12 04:26:45 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2009-06-12 04:27:38 -0400 |
commit | 8b4488f85d619253c9e631ec723368f400106771 (patch) | |
tree | d522f3f62d6c3f4788f6456591d439db05b34ee4 /arch/s390 | |
parent | dfd9f7abc0fb67b5781f340d982384cea53b2884 (diff) |
[S390] ftrace: add function trace mcount test support
Add support for early test if the function tracer is enabled or
disabled. Saves some extra function calls.
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/Kconfig | 1 | ||||
-rw-r--r-- | arch/s390/kernel/mcount.S | 38 |
2 files changed, 27 insertions, 12 deletions
diff --git a/arch/s390/Kconfig b/arch/s390/Kconfig index b674e79044a0..480590f21570 100644 --- a/arch/s390/Kconfig +++ b/arch/s390/Kconfig | |||
@@ -82,6 +82,7 @@ config S390 | |||
82 | select USE_GENERIC_SMP_HELPERS if SMP | 82 | select USE_GENERIC_SMP_HELPERS if SMP |
83 | select HAVE_SYSCALL_WRAPPERS | 83 | select HAVE_SYSCALL_WRAPPERS |
84 | select HAVE_FUNCTION_TRACER | 84 | select HAVE_FUNCTION_TRACER |
85 | select HAVE_FUNCTION_TRACE_MCOUNT_TEST | ||
85 | select HAVE_FTRACE_MCOUNT_RECORD | 86 | select HAVE_FTRACE_MCOUNT_RECORD |
86 | select HAVE_DYNAMIC_FTRACE | 87 | select HAVE_DYNAMIC_FTRACE |
87 | select HAVE_DEFAULT_NO_SPIN_MUTEXES | 88 | select HAVE_DEFAULT_NO_SPIN_MUTEXES |
diff --git a/arch/s390/kernel/mcount.S b/arch/s390/kernel/mcount.S index de274996f640..0aa85ec94d08 100644 --- a/arch/s390/kernel/mcount.S +++ b/arch/s390/kernel/mcount.S | |||
@@ -21,6 +21,9 @@ _mcount: | |||
21 | 21 | ||
22 | .globl ftrace_caller | 22 | .globl ftrace_caller |
23 | ftrace_caller: | 23 | ftrace_caller: |
24 | larl %r1,function_trace_stop | ||
25 | icm %r1,0xf,0(%r1) | ||
26 | bnzr %r14 | ||
24 | stmg %r2,%r5,32(%r15) | 27 | stmg %r2,%r5,32(%r15) |
25 | stg %r14,112(%r15) | 28 | stg %r14,112(%r15) |
26 | lgr %r1,%r15 | 29 | lgr %r1,%r15 |
@@ -46,6 +49,9 @@ ftrace_dyn_func: | |||
46 | 49 | ||
47 | .globl _mcount | 50 | .globl _mcount |
48 | _mcount: | 51 | _mcount: |
52 | larl %r1,function_trace_stop | ||
53 | icm %r1,0xf,0(%r1) | ||
54 | bnzr %r14 | ||
49 | stmg %r2,%r5,32(%r15) | 55 | stmg %r2,%r5,32(%r15) |
50 | stg %r14,112(%r15) | 56 | stg %r14,112(%r15) |
51 | lgr %r1,%r15 | 57 | lgr %r1,%r15 |
@@ -74,21 +80,25 @@ _mcount: | |||
74 | .globl ftrace_caller | 80 | .globl ftrace_caller |
75 | ftrace_caller: | 81 | ftrace_caller: |
76 | stm %r2,%r5,16(%r15) | 82 | stm %r2,%r5,16(%r15) |
83 | bras %r1,2f | ||
84 | 0: .long ftrace_trace_function | ||
85 | 1: .long function_trace_stop | ||
86 | 2: l %r2,1b-0b(%r1) | ||
87 | icm %r2,0xf,0(%r2) | ||
88 | jnz 3f | ||
77 | st %r14,56(%r15) | 89 | st %r14,56(%r15) |
78 | lr %r1,%r15 | 90 | lr %r0,%r15 |
79 | ahi %r15,-96 | 91 | ahi %r15,-96 |
80 | l %r3,100(%r15) | 92 | l %r3,100(%r15) |
81 | la %r2,0(%r14) | 93 | la %r2,0(%r14) |
82 | st %r1,__SF_BACKCHAIN(%r15) | 94 | st %r0,__SF_BACKCHAIN(%r15) |
83 | la %r3,0(%r3) | 95 | la %r3,0(%r3) |
84 | bras %r14,0f | 96 | l %r14,0b-0b(%r1) |
85 | .long ftrace_dyn_func | ||
86 | 0: l %r14,0(%r14) | ||
87 | l %r14,0(%r14) | 97 | l %r14,0(%r14) |
88 | basr %r14,%r14 | 98 | basr %r14,%r14 |
89 | ahi %r15,96 | 99 | ahi %r15,96 |
90 | lm %r2,%r5,16(%r15) | ||
91 | l %r14,56(%r15) | 100 | l %r14,56(%r15) |
101 | 3: lm %r2,%r5,16(%r15) | ||
92 | br %r14 | 102 | br %r14 |
93 | 103 | ||
94 | .data | 104 | .data |
@@ -102,21 +112,25 @@ ftrace_dyn_func: | |||
102 | .globl _mcount | 112 | .globl _mcount |
103 | _mcount: | 113 | _mcount: |
104 | stm %r2,%r5,16(%r15) | 114 | stm %r2,%r5,16(%r15) |
115 | bras %r1,2f | ||
116 | 0: .long ftrace_trace_function | ||
117 | 1: .long function_trace_stop | ||
118 | 2: l %r2,1b-0b(%r1) | ||
119 | icm %r2,0xf,0(%r2) | ||
120 | jnz 3f | ||
105 | st %r14,56(%r15) | 121 | st %r14,56(%r15) |
106 | lr %r1,%r15 | 122 | lr %r0,%r15 |
107 | ahi %r15,-96 | 123 | ahi %r15,-96 |
108 | l %r3,100(%r15) | 124 | l %r3,100(%r15) |
109 | la %r2,0(%r14) | 125 | la %r2,0(%r14) |
110 | st %r1,__SF_BACKCHAIN(%r15) | 126 | st %r0,__SF_BACKCHAIN(%r15) |
111 | la %r3,0(%r3) | 127 | la %r3,0(%r3) |
112 | bras %r14,0f | 128 | l %r14,0b-0b(%r1) |
113 | .long ftrace_trace_function | ||
114 | 0: l %r14,0(%r14) | ||
115 | l %r14,0(%r14) | 129 | l %r14,0(%r14) |
116 | basr %r14,%r14 | 130 | basr %r14,%r14 |
117 | ahi %r15,96 | 131 | ahi %r15,96 |
118 | lm %r2,%r5,16(%r15) | ||
119 | l %r14,56(%r15) | 132 | l %r14,56(%r15) |
133 | 3: lm %r2,%r5,16(%r15) | ||
120 | br %r14 | 134 | br %r14 |
121 | 135 | ||
122 | #endif /* CONFIG_DYNAMIC_FTRACE */ | 136 | #endif /* CONFIG_DYNAMIC_FTRACE */ |