aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/ftrace.h
diff options
context:
space:
mode:
Diffstat (limited to 'include/linux/ftrace.h')
-rw-r--r--include/linux/ftrace.h24
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);
72extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr); 72extern unsigned char *ftrace_call_replace(unsigned long ip, unsigned long addr);
73extern int ftrace_dyn_arch_init(void *data); 73extern int ftrace_dyn_arch_init(void *data);
74extern int ftrace_mcount_set(unsigned long *data); 74extern int ftrace_mcount_set(unsigned long *data);
75extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code,
76 unsigned char *new_code);
77extern int ftrace_update_ftrace_func(ftrace_func_t func); 75extern int ftrace_update_ftrace_func(ftrace_func_t func);
78extern void ftrace_caller(void); 76extern void ftrace_caller(void);
79extern void ftrace_call(void); 77extern void ftrace_call(void);
80extern void mcount_call(void); 78extern 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 */
99extern int ftrace_modify_code(unsigned long ip, unsigned char *old_code,
100 unsigned char *new_code);
101
82extern int skip_trace(unsigned long ip); 102extern int skip_trace(unsigned long ip);
83 103
84extern void ftrace_release(void *start, unsigned long size); 104extern void ftrace_release(void *start, unsigned long size);