diff options
Diffstat (limited to 'arch/powerpc/kernel/ftrace.c')
| -rw-r--r-- | arch/powerpc/kernel/ftrace.c | 27 |
1 files changed, 5 insertions, 22 deletions
diff --git a/arch/powerpc/kernel/ftrace.c b/arch/powerpc/kernel/ftrace.c index 3855ceb937b0..f4b006ed0ab1 100644 --- a/arch/powerpc/kernel/ftrace.c +++ b/arch/powerpc/kernel/ftrace.c | |||
| @@ -28,17 +28,17 @@ static unsigned int ftrace_nop = 0x60000000; | |||
| 28 | #endif | 28 | #endif |
| 29 | 29 | ||
| 30 | 30 | ||
| 31 | static unsigned int notrace ftrace_calc_offset(long ip, long addr) | 31 | static unsigned int ftrace_calc_offset(long ip, long addr) |
| 32 | { | 32 | { |
| 33 | return (int)(addr - ip); | 33 | return (int)(addr - ip); |
| 34 | } | 34 | } |
| 35 | 35 | ||
| 36 | notrace unsigned char *ftrace_nop_replace(void) | 36 | unsigned char *ftrace_nop_replace(void) |
| 37 | { | 37 | { |
| 38 | return (char *)&ftrace_nop; | 38 | return (char *)&ftrace_nop; |
| 39 | } | 39 | } |
| 40 | 40 | ||
| 41 | notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | 41 | unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) |
| 42 | { | 42 | { |
| 43 | static unsigned int op; | 43 | static unsigned int op; |
| 44 | 44 | ||
| @@ -68,7 +68,7 @@ notrace unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr) | |||
| 68 | # define _ASM_PTR " .long " | 68 | # define _ASM_PTR " .long " |
| 69 | #endif | 69 | #endif |
| 70 | 70 | ||
| 71 | notrace int | 71 | int |
| 72 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, | 72 | ftrace_modify_code(unsigned long ip, unsigned char *old_code, |
| 73 | unsigned char *new_code) | 73 | unsigned char *new_code) |
| 74 | { | 74 | { |
| @@ -113,7 +113,7 @@ ftrace_modify_code(unsigned long ip, unsigned char *old_code, | |||
| 113 | return faulted; | 113 | return faulted; |
| 114 | } | 114 | } |
| 115 | 115 | ||
| 116 | notrace int ftrace_update_ftrace_func(ftrace_func_t func) | 116 | int ftrace_update_ftrace_func(ftrace_func_t func) |
| 117 | { | 117 | { |
| 118 | unsigned long ip = (unsigned long)(&ftrace_call); | 118 | unsigned long ip = (unsigned long)(&ftrace_call); |
| 119 | unsigned char old[MCOUNT_INSN_SIZE], *new; | 119 | unsigned char old[MCOUNT_INSN_SIZE], *new; |
| @@ -126,23 +126,6 @@ notrace int ftrace_update_ftrace_func(ftrace_func_t func) | |||
| 126 | return ret; | 126 | return ret; |
| 127 | } | 127 | } |
| 128 | 128 | ||
| 129 | notrace int ftrace_mcount_set(unsigned long *data) | ||
| 130 | { | ||
| 131 | unsigned long ip = (long)(&mcount_call); | ||
| 132 | unsigned long *addr = data; | ||
| 133 | unsigned char old[MCOUNT_INSN_SIZE], *new; | ||
| 134 | |||
| 135 | /* | ||
| 136 | * Replace the mcount stub with a pointer to the | ||
| 137 | * ip recorder function. | ||
| 138 | */ | ||
| 139 | memcpy(old, &mcount_call, MCOUNT_INSN_SIZE); | ||
| 140 | new = ftrace_call_replace(ip, *addr); | ||
| 141 | *addr = ftrace_modify_code(ip, old, new); | ||
| 142 | |||
| 143 | return 0; | ||
| 144 | } | ||
| 145 | |||
| 146 | int __init ftrace_dyn_arch_init(void *data) | 129 | int __init ftrace_dyn_arch_init(void *data) |
| 147 | { | 130 | { |
| 148 | /* This is running in kstop_machine */ | 131 | /* This is running in kstop_machine */ |
