diff options
author | Heiko Carstens <heiko.carstens@de.ibm.com> | 2013-05-13 08:48:52 -0400 |
---|---|---|
committer | Martin Schwidefsky <schwidefsky@de.ibm.com> | 2013-05-15 07:09:09 -0400 |
commit | aca91209775514b5a335e7ef11f1d636618590c7 (patch) | |
tree | d2bc7248e2a4451e0a68c1680106770ad64874eb /arch/s390/include | |
parent | bb4b42ce0ca36af8c113587ab64b138b3cf5459c (diff) |
s390/ftrace: fix mcount adjustment
Tony Jones reported that the ftrace self tests on s390 do not work:
<6>Testing dynamic ftrace ops #1: (0 0 0 0 0) FAILED!
<6>Testing tracer irqsoff:
<3>failed to start irqsoff tracer
<4>.. no entries found ..FAILED!
<6>Testing tracer wakeup:
<3>failed to start wakeup tracer
<4>.. no entries found ..FAILED!
<6>Testing tracer function_graph:
<4>Failed to init function_graph tracer, init returned -19
<4>FAILED!
This happens because we forgot to adjust the instruction pointer that gets
passed to the ftrace trace function by MCOUNT_INSN_SIZE.
In addition change MCOUNT_INSN_SIZE to the correct value on 31 bit.
It only worked so far because the to be patched instruction was identical.
Reported-by: Tony Jones <tonyj@suse.com>
Signed-off-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Martin Schwidefsky <schwidefsky@de.ibm.com>
Diffstat (limited to 'arch/s390/include')
-rw-r--r-- | arch/s390/include/asm/ftrace.h | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/arch/s390/include/asm/ftrace.h b/arch/s390/include/asm/ftrace.h index b7931faaef6d..bf246dae1367 100644 --- a/arch/s390/include/asm/ftrace.h +++ b/arch/s390/include/asm/ftrace.h | |||
@@ -9,11 +9,6 @@ struct dyn_arch_ftrace { }; | |||
9 | 9 | ||
10 | #define MCOUNT_ADDR ((long)_mcount) | 10 | #define MCOUNT_ADDR ((long)_mcount) |
11 | 11 | ||
12 | #ifdef CONFIG_64BIT | ||
13 | #define MCOUNT_INSN_SIZE 12 | ||
14 | #else | ||
15 | #define MCOUNT_INSN_SIZE 20 | ||
16 | #endif | ||
17 | 12 | ||
18 | static inline unsigned long ftrace_call_adjust(unsigned long addr) | 13 | static inline unsigned long ftrace_call_adjust(unsigned long addr) |
19 | { | 14 | { |
@@ -21,4 +16,11 @@ static inline unsigned long ftrace_call_adjust(unsigned long addr) | |||
21 | } | 16 | } |
22 | 17 | ||
23 | #endif /* __ASSEMBLY__ */ | 18 | #endif /* __ASSEMBLY__ */ |
19 | |||
20 | #ifdef CONFIG_64BIT | ||
21 | #define MCOUNT_INSN_SIZE 12 | ||
22 | #else | ||
23 | #define MCOUNT_INSN_SIZE 22 | ||
24 | #endif | ||
25 | |||
24 | #endif /* _ASM_S390_FTRACE_H */ | 26 | #endif /* _ASM_S390_FTRACE_H */ |