aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/ftrace.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/trace/ftrace.c')
-rw-r--r--kernel/trace/ftrace.c18
1 files changed, 11 insertions, 7 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index fa79323331b2..b920358dd8f7 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -33,6 +33,7 @@
33#include <linux/list.h> 33#include <linux/list.h>
34#include <linux/hash.h> 34#include <linux/hash.h>
35#include <linux/rcupdate.h> 35#include <linux/rcupdate.h>
36#include <linux/kprobes.h>
36 37
37#include <trace/events/sched.h> 38#include <trace/events/sched.h>
38 39
@@ -1992,7 +1993,7 @@ static void print_bug_type(void)
1992 * modifying the code. @failed should be one of either: 1993 * modifying the code. @failed should be one of either:
1993 * EFAULT - if the problem happens on reading the @ip address 1994 * EFAULT - if the problem happens on reading the @ip address
1994 * EINVAL - if what is read at @ip is not what was expected 1995 * EINVAL - if what is read at @ip is not what was expected
1995 * EPERM - if the problem happens on writting to the @ip address 1996 * EPERM - if the problem happens on writing to the @ip address
1996 */ 1997 */
1997void ftrace_bug(int failed, struct dyn_ftrace *rec) 1998void ftrace_bug(int failed, struct dyn_ftrace *rec)
1998{ 1999{
@@ -2391,7 +2392,7 @@ __ftrace_replace_code(struct dyn_ftrace *rec, int enable)
2391 return ftrace_modify_call(rec, ftrace_old_addr, ftrace_addr); 2392 return ftrace_modify_call(rec, ftrace_old_addr, ftrace_addr);
2392 } 2393 }
2393 2394
2394 return -1; /* unknow ftrace bug */ 2395 return -1; /* unknown ftrace bug */
2395} 2396}
2396 2397
2397void __weak ftrace_replace_code(int mod_flags) 2398void __weak ftrace_replace_code(int mod_flags)
@@ -3004,7 +3005,7 @@ ftrace_allocate_pages(unsigned long num_to_init)
3004 int cnt; 3005 int cnt;
3005 3006
3006 if (!num_to_init) 3007 if (!num_to_init)
3007 return 0; 3008 return NULL;
3008 3009
3009 start_pg = pg = kzalloc(sizeof(*pg), GFP_KERNEL); 3010 start_pg = pg = kzalloc(sizeof(*pg), GFP_KERNEL);
3010 if (!pg) 3011 if (!pg)
@@ -4755,7 +4756,7 @@ static int
4755ftrace_set_addr(struct ftrace_ops *ops, unsigned long ip, int remove, 4756ftrace_set_addr(struct ftrace_ops *ops, unsigned long ip, int remove,
4756 int reset, int enable) 4757 int reset, int enable)
4757{ 4758{
4758 return ftrace_set_hash(ops, 0, 0, ip, remove, reset, enable); 4759 return ftrace_set_hash(ops, NULL, 0, ip, remove, reset, enable);
4759} 4760}
4760 4761
4761/** 4762/**
@@ -5463,7 +5464,7 @@ void ftrace_create_filter_files(struct ftrace_ops *ops,
5463 5464
5464/* 5465/*
5465 * The name "destroy_filter_files" is really a misnomer. Although 5466 * The name "destroy_filter_files" is really a misnomer. Although
5466 * in the future, it may actualy delete the files, but this is 5467 * in the future, it may actually delete the files, but this is
5467 * really intended to make sure the ops passed in are disabled 5468 * really intended to make sure the ops passed in are disabled
5468 * and that when this function returns, the caller is free to 5469 * and that when this function returns, the caller is free to
5469 * free the ops. 5470 * free the ops.
@@ -5786,7 +5787,7 @@ void ftrace_module_enable(struct module *mod)
5786 /* 5787 /*
5787 * If the tracing is enabled, go ahead and enable the record. 5788 * If the tracing is enabled, go ahead and enable the record.
5788 * 5789 *
5789 * The reason not to enable the record immediatelly is the 5790 * The reason not to enable the record immediately is the
5790 * inherent check of ftrace_make_nop/ftrace_make_call for 5791 * inherent check of ftrace_make_nop/ftrace_make_call for
5791 * correct previous instructions. Making first the NOP 5792 * correct previous instructions. Making first the NOP
5792 * conversion puts the module to the correct state, thus 5793 * conversion puts the module to the correct state, thus
@@ -6246,7 +6247,7 @@ void ftrace_reset_array_ops(struct trace_array *tr)
6246 tr->ops->func = ftrace_stub; 6247 tr->ops->func = ftrace_stub;
6247} 6248}
6248 6249
6249static inline void 6250static nokprobe_inline void
6250__ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip, 6251__ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip,
6251 struct ftrace_ops *ignored, struct pt_regs *regs) 6252 struct ftrace_ops *ignored, struct pt_regs *regs)
6252{ 6253{
@@ -6306,11 +6307,13 @@ static void ftrace_ops_list_func(unsigned long ip, unsigned long parent_ip,
6306{ 6307{
6307 __ftrace_ops_list_func(ip, parent_ip, NULL, regs); 6308 __ftrace_ops_list_func(ip, parent_ip, NULL, regs);
6308} 6309}
6310NOKPROBE_SYMBOL(ftrace_ops_list_func);
6309#else 6311#else
6310static void ftrace_ops_no_ops(unsigned long ip, unsigned long parent_ip) 6312static void ftrace_ops_no_ops(unsigned long ip, unsigned long parent_ip)
6311{ 6313{
6312 __ftrace_ops_list_func(ip, parent_ip, NULL, NULL); 6314 __ftrace_ops_list_func(ip, parent_ip, NULL, NULL);
6313} 6315}
6316NOKPROBE_SYMBOL(ftrace_ops_no_ops);
6314#endif 6317#endif
6315 6318
6316/* 6319/*
@@ -6337,6 +6340,7 @@ static void ftrace_ops_assist_func(unsigned long ip, unsigned long parent_ip,
6337 preempt_enable_notrace(); 6340 preempt_enable_notrace();
6338 trace_clear_recursion(bit); 6341 trace_clear_recursion(bit);
6339} 6342}
6343NOKPROBE_SYMBOL(ftrace_ops_assist_func);
6340 6344
6341/** 6345/**
6342 * ftrace_ops_get_func - get the function a trampoline should call 6346 * ftrace_ops_get_func - get the function a trampoline should call