aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMathieu Desnoyers <mathieu.desnoyers@efficios.com>2014-04-09 09:24:43 -0400
committerSteven Rostedt <rostedt@goodmis.org>2014-04-09 10:12:11 -0400
commitb725dfea24b89de672c055b34b22398283a3f4bc (patch)
tree98ddf19dc7d4cb4acf91c53dc4db7753e32ec331
parenteb7d035c59431bb12e1aa6e69ddd3940352faddb (diff)
tracepoint: Fix sparse warnings in tracepoint.c
Fix the following sparse warnings: CHECK kernel/tracepoint.c kernel/tracepoint.c:184:18: warning: incorrect type in assignment (different address spaces) kernel/tracepoint.c:184:18: expected struct tracepoint_func *tp_funcs kernel/tracepoint.c:184:18: got struct tracepoint_func [noderef] <asn:4>*funcs kernel/tracepoint.c:216:18: warning: incorrect type in assignment (different address spaces) kernel/tracepoint.c:216:18: expected struct tracepoint_func *tp_funcs kernel/tracepoint.c:216:18: got struct tracepoint_func [noderef] <asn:4>*funcs kernel/tracepoint.c:392:24: error: return expression in void function CC kernel/tracepoint.o kernel/tracepoint.c: In function tracepoint_module_going: kernel/tracepoint.c:491:6: warning: symbol 'syscall_regfunc' was not declared. Should it be static? kernel/tracepoint.c:508:6: warning: symbol 'syscall_unregfunc' was not declared. Should it be static? Link: http://lkml.kernel.org/r/1397049883-28692-1-git-send-email-mathieu.desnoyers@efficios.com Signed-off-by: Mathieu Desnoyers <mathieu.desnoyers@efficios.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--include/linux/tracepoint.h5
-rw-r--r--include/trace/events/syscalls.h3
-rw-r--r--kernel/tracepoint.c6
3 files changed, 9 insertions, 5 deletions
diff --git a/include/linux/tracepoint.h b/include/linux/tracepoint.h
index 69a298b07357..9d30ee469c2a 100644
--- a/include/linux/tracepoint.h
+++ b/include/linux/tracepoint.h
@@ -80,6 +80,11 @@ static inline void tracepoint_synchronize_unregister(void)
80 synchronize_sched(); 80 synchronize_sched();
81} 81}
82 82
83#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
84extern void syscall_regfunc(void);
85extern void syscall_unregfunc(void);
86#endif /* CONFIG_HAVE_SYSCALL_TRACEPOINTS */
87
83#define PARAMS(args...) args 88#define PARAMS(args...) args
84 89
85#endif /* _LINUX_TRACEPOINT_H */ 90#endif /* _LINUX_TRACEPOINT_H */
diff --git a/include/trace/events/syscalls.h b/include/trace/events/syscalls.h
index 5a4c04a75b3d..14e49c798135 100644
--- a/include/trace/events/syscalls.h
+++ b/include/trace/events/syscalls.h
@@ -13,9 +13,6 @@
13 13
14#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS 14#ifdef CONFIG_HAVE_SYSCALL_TRACEPOINTS
15 15
16extern void syscall_regfunc(void);
17extern void syscall_unregfunc(void);
18
19TRACE_EVENT_FN(sys_enter, 16TRACE_EVENT_FN(sys_enter,
20 17
21 TP_PROTO(struct pt_regs *regs, long id), 18 TP_PROTO(struct pt_regs *regs, long id),
diff --git a/kernel/tracepoint.c b/kernel/tracepoint.c
index 162be198a247..ca2cfe21bb8e 100644
--- a/kernel/tracepoint.c
+++ b/kernel/tracepoint.c
@@ -181,7 +181,8 @@ static int tracepoint_add_func(struct tracepoint *tp,
181 if (tp->regfunc && !static_key_enabled(&tp->key)) 181 if (tp->regfunc && !static_key_enabled(&tp->key))
182 tp->regfunc(); 182 tp->regfunc();
183 183
184 tp_funcs = tp->funcs; 184 tp_funcs = rcu_dereference_protected(tp->funcs,
185 lockdep_is_held(&tracepoints_mutex));
185 old = func_add(&tp_funcs, func); 186 old = func_add(&tp_funcs, func);
186 if (IS_ERR(old)) { 187 if (IS_ERR(old)) {
187 WARN_ON_ONCE(1); 188 WARN_ON_ONCE(1);
@@ -213,7 +214,8 @@ static int tracepoint_remove_func(struct tracepoint *tp,
213{ 214{
214 struct tracepoint_func *old, *tp_funcs; 215 struct tracepoint_func *old, *tp_funcs;
215 216
216 tp_funcs = tp->funcs; 217 tp_funcs = rcu_dereference_protected(tp->funcs,
218 lockdep_is_held(&tracepoints_mutex));
217 old = func_remove(&tp_funcs, func); 219 old = func_remove(&tp_funcs, func);
218 if (IS_ERR(old)) { 220 if (IS_ERR(old)) {
219 WARN_ON_ONCE(1); 221 WARN_ON_ONCE(1);