aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Zanussi <tom.zanussi@linux.intel.com>2013-10-24 09:34:18 -0400
committerSteven Rostedt <rostedt@goodmis.org>2013-11-05 17:43:40 -0500
commit38de93abec8d8acd8d6dbbe9b0d92d6d5cdb3090 (patch)
tree4b7ea21748121502c7d4d8625512134651d1eb9d
parentf306cc82a93d6b19f01634b80c580b9755c8b7cc (diff)
tracing: Make register/unregister_ftrace_command __init
register/unregister_ftrace_command() are only ever called from __init functions, so can themselves be made __init. Also make register_snapshot_cmd() __init for the same reason. Link: http://lkml.kernel.org/r/d4042c8cadb7ae6f843ac9a89a24e1c6a3099727.1382620672.git.tom.zanussi@linux.intel.com Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com> Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
-rw-r--r--include/linux/ftrace.h4
-rw-r--r--kernel/trace/ftrace.c12
-rw-r--r--kernel/trace/trace.c4
3 files changed, 14 insertions, 6 deletions
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index ec85d48619e1..31ea4b428360 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -533,11 +533,11 @@ static inline int ftrace_force_update(void) { return 0; }
533static inline void ftrace_disable_daemon(void) { } 533static inline void ftrace_disable_daemon(void) { }
534static inline void ftrace_enable_daemon(void) { } 534static inline void ftrace_enable_daemon(void) { }
535static inline void ftrace_release_mod(struct module *mod) {} 535static inline void ftrace_release_mod(struct module *mod) {}
536static inline int register_ftrace_command(struct ftrace_func_command *cmd) 536static inline __init int register_ftrace_command(struct ftrace_func_command *cmd)
537{ 537{
538 return -EINVAL; 538 return -EINVAL;
539} 539}
540static inline int unregister_ftrace_command(char *cmd_name) 540static inline __init int unregister_ftrace_command(char *cmd_name)
541{ 541{
542 return -EINVAL; 542 return -EINVAL;
543} 543}
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index 080b7d41e17f..22fa55696760 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3307,7 +3307,11 @@ void unregister_ftrace_function_probe_all(char *glob)
3307static LIST_HEAD(ftrace_commands); 3307static LIST_HEAD(ftrace_commands);
3308static DEFINE_MUTEX(ftrace_cmd_mutex); 3308static DEFINE_MUTEX(ftrace_cmd_mutex);
3309 3309
3310int register_ftrace_command(struct ftrace_func_command *cmd) 3310/*
3311 * Currently we only register ftrace commands from __init, so mark this
3312 * __init too.
3313 */
3314__init int register_ftrace_command(struct ftrace_func_command *cmd)
3311{ 3315{
3312 struct ftrace_func_command *p; 3316 struct ftrace_func_command *p;
3313 int ret = 0; 3317 int ret = 0;
@@ -3326,7 +3330,11 @@ int register_ftrace_command(struct ftrace_func_command *cmd)
3326 return ret; 3330 return ret;
3327} 3331}
3328 3332
3329int unregister_ftrace_command(struct ftrace_func_command *cmd) 3333/*
3334 * Currently we only unregister ftrace commands from __init, so mark
3335 * this __init too.
3336 */
3337__init int unregister_ftrace_command(struct ftrace_func_command *cmd)
3330{ 3338{
3331 struct ftrace_func_command *p, *n; 3339 struct ftrace_func_command *p, *n;
3332 int ret = -ENODEV; 3340 int ret = -ENODEV;
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 489da8b19f30..f9fa42b180e3 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5477,12 +5477,12 @@ static struct ftrace_func_command ftrace_snapshot_cmd = {
5477 .func = ftrace_trace_snapshot_callback, 5477 .func = ftrace_trace_snapshot_callback,
5478}; 5478};
5479 5479
5480static int register_snapshot_cmd(void) 5480static __init int register_snapshot_cmd(void)
5481{ 5481{
5482 return register_ftrace_command(&ftrace_snapshot_cmd); 5482 return register_ftrace_command(&ftrace_snapshot_cmd);
5483} 5483}
5484#else 5484#else
5485static inline int register_snapshot_cmd(void) { return 0; } 5485static inline __init int register_snapshot_cmd(void) { return 0; }
5486#endif /* defined(CONFIG_TRACER_SNAPSHOT) && defined(CONFIG_DYNAMIC_FTRACE) */ 5486#endif /* defined(CONFIG_TRACER_SNAPSHOT) && defined(CONFIG_DYNAMIC_FTRACE) */
5487 5487
5488struct dentry *tracing_init_dentry_tr(struct trace_array *tr) 5488struct dentry *tracing_init_dentry_tr(struct trace_array *tr)