diff options
Diffstat (limited to 'include')
| -rw-r--r-- | include/linux/ftrace.h | 24 |
1 files changed, 22 insertions, 2 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h index 0e9529589151..79fa10cbdcfb 100644 --- a/include/linux/ftrace.h +++ b/include/linux/ftrace.h | |||
| @@ -72,13 +72,33 @@ extern unsigned char *ftrace_nop_replace(void); | |||
| 72 | extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr); | 72 | extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr); |
| 73 | extern int ftrace_dyn_arch_init(void *data); | 73 | extern int ftrace_dyn_arch_init(void *data); |
| 74 | extern int ftrace_mcount_set(unsigned long *data); | 74 | extern int ftrace_mcount_set(unsigned long *data); |
| 75 | extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code, | ||
| 76 | unsigned char *new_code); | ||
| 77 | extern int ftrace_update_ftrace_func(ftrace_func_t func); | 75 | extern int ftrace_update_ftrace_func(ftrace_func_t func); |
| 78 | extern void ftrace_caller(void); | 76 | extern void ftrace_caller(void); |
| 79 | extern void ftrace_call(void); | 77 | extern void ftrace_call(void); |
| 80 | extern void mcount_call(void); | 78 | extern void mcount_call(void); |
| 81 | 79 | ||
| 80 | /** | ||
| 81 | * ftrace_modify_code - modify code segment | ||
| 82 | * @ip: the address of the code segment | ||
| 83 | * @old_code: the contents of what is expected to be there | ||
| 84 | * @new_code: the code to patch in | ||
| 85 | * | ||
| 86 | * This is a very sensitive operation and great care needs | ||
| 87 | * to be taken by the arch. The operation should carefully | ||
| 88 | * read the location, check to see if what is read is indeed | ||
| 89 | * what we expect it to be, and then on success of the compare, | ||
| 90 | * it should write to the location. | ||
| 91 | * | ||
| 92 | * Return must be: | ||
| 93 | * 0 on success | ||
| 94 | * -EFAULT on error reading the location | ||
| 95 | * -EINVAL on a failed compare of the contents | ||
| 96 | * -EPERM on error writing to the location | ||
| 97 | * Any other value will be considered a failure. | ||
| 98 | */ | ||
| 99 | extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code, | ||
| 100 | unsigned char *new_code); | ||
| 101 | |||
| 82 | extern int skip_trace(unsigned long ip); | 102 | extern int skip_trace(unsigned long ip); |
| 83 | 103 | ||
| 84 | extern void ftrace_release(void *start, unsigned long size); | 104 | extern void ftrace_release(void *start, unsigned long size); |
