From: Tom Zanussi <tom.zanussi@linux.intel.com>
To: rostedt@goodmis.org
Cc: masami.hiramatsu.pt@hitachi.com, linux-kernel@vger.kernel.org,
Tom Zanussi <tom.zanussi@linux.intel.com>
Subject: [PATCH v7 10/10] tracing: make register/unregister_ftrace_command __init
Date: Tue, 27 Aug 2013 14:40:22 -0500 [thread overview]
Message-ID: <057e035a2a6553013ab96b7e97bcd6985c50bc64.1377631572.git.tom.zanussi@linux.intel.com> (raw)
In-Reply-To: <cover.1377631572.git.tom.zanussi@linux.intel.com>
In-Reply-To: <cover.1377631572.git.tom.zanussi@linux.intel.com>
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.
Signed-off-by: Tom Zanussi <tom.zanussi@linux.intel.com>
---
include/linux/ftrace.h | 4 ++--
kernel/trace/ftrace.c | 12 ++++++++++--
kernel/trace/trace.c | 4 ++--
3 files changed, 14 insertions(+), 6 deletions(-)
diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 9f15c00..6062491 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -533,11 +533,11 @@ static inline int ftrace_force_update(void) { return 0; }
static inline void ftrace_disable_daemon(void) { }
static inline void ftrace_enable_daemon(void) { }
static inline void ftrace_release_mod(struct module *mod) {}
-static inline int register_ftrace_command(struct ftrace_func_command *cmd)
+static inline __init int register_ftrace_command(struct ftrace_func_command *cmd)
{
return -EINVAL;
}
-static inline int unregister_ftrace_command(char *cmd_name)
+static inline __init int unregister_ftrace_command(char *cmd_name)
{
return -EINVAL;
}
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c
index a6d098c..64f7f39 100644
--- a/kernel/trace/ftrace.c
+++ b/kernel/trace/ftrace.c
@@ -3292,7 +3292,11 @@ void unregister_ftrace_function_probe_all(char *glob)
static LIST_HEAD(ftrace_commands);
static DEFINE_MUTEX(ftrace_cmd_mutex);
-int register_ftrace_command(struct ftrace_func_command *cmd)
+/*
+ * Currently we only register ftrace commands from __init, so mark this
+ * __init too.
+ */
+__init int register_ftrace_command(struct ftrace_func_command *cmd)
{
struct ftrace_func_command *p;
int ret = 0;
@@ -3311,7 +3315,11 @@ int register_ftrace_command(struct ftrace_func_command *cmd)
return ret;
}
-int unregister_ftrace_command(struct ftrace_func_command *cmd)
+/*
+ * Currently we only unregister ftrace commands from __init, so mark
+ * this __init too.
+ */
+__init int unregister_ftrace_command(struct ftrace_func_command *cmd)
{
struct ftrace_func_command *p, *n;
int ret = -ENODEV;
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
index 2aabd34..4222c6a 100644
--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5458,12 +5458,12 @@ static struct ftrace_func_command ftrace_snapshot_cmd = {
.func = ftrace_trace_snapshot_callback,
};
-static int register_snapshot_cmd(void)
+static __init int register_snapshot_cmd(void)
{
return register_ftrace_command(&ftrace_snapshot_cmd);
}
#else
-static inline int register_snapshot_cmd(void) { return 0; }
+static inline __init int register_snapshot_cmd(void) { return 0; }
#endif /* defined(CONFIG_TRACER_SNAPSHOT) && defined(CONFIG_DYNAMIC_FTRACE) */
struct dentry *tracing_init_dentry_tr(struct trace_array *tr)
--
1.7.11.4
next prev parent reply other threads:[~2013-08-27 19:40 UTC|newest]
Thread overview: 26+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-27 19:40 [PATCH v7 00/10] tracing: trace event triggers (repost) Tom Zanussi
2013-08-27 19:40 ` [PATCH v7 01/10] tracing: Add support for SOFT_DISABLE to syscall events Tom Zanussi
2013-08-27 20:01 ` Steven Rostedt
2013-08-27 23:29 ` Tom Zanussi
2013-08-27 23:41 ` Steven Rostedt
2013-08-27 20:08 ` Steven Rostedt
2013-08-27 23:32 ` Tom Zanussi
2013-08-27 19:40 ` [PATCH v7 02/10] tracing: add basic event trigger framework Tom Zanussi
2013-08-27 20:15 ` Steven Rostedt
2013-08-27 23:38 ` Tom Zanussi
2013-08-27 20:17 ` Steven Rostedt
2013-08-27 19:40 ` [PATCH v7 03/10] tracing: add 'traceon' and 'traceoff' event trigger commands Tom Zanussi
2013-08-27 19:40 ` [PATCH v7 04/10] tracing: add 'snapshot' event trigger command Tom Zanussi
2013-08-27 19:40 ` [PATCH v7 05/10] tracing: add 'stacktrace' " Tom Zanussi
2013-08-27 19:40 ` [PATCH v7 06/10] tracing: add 'enable_event' and 'disable_event' event trigger commands Tom Zanussi
2013-08-27 19:40 ` [PATCH v7 07/10] tracing: add and use generic set_trigger_filter() implementation Tom Zanussi
2013-08-28 16:38 ` Steven Rostedt
2013-08-29 2:52 ` Tom Zanussi
2013-08-27 19:40 ` [PATCH v7 08/10] tracing: update event filters for multibuffer Tom Zanussi
2013-08-28 18:00 ` Steven Rostedt
2013-08-27 19:40 ` [PATCH v7 09/10] tracing: add documentation for trace event triggers Tom Zanussi
2013-08-27 19:40 ` Tom Zanussi [this message]
2013-08-28 1:28 ` [PATCH v7 00/10] tracing: trace event triggers (repost) Masami Hiramatsu
2013-08-28 19:51 ` Steven Rostedt
2013-08-29 2:54 ` Tom Zanussi
-- strict thread matches above, loose matches on Subject: below --
2013-08-27 3:55 [PATCH v7 00/10] tracing: trace event triggers Tom Zanussi
2013-08-27 3:56 ` [PATCH v7 10/10] tracing: make register/unregister_ftrace_command __init Tom Zanussi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=057e035a2a6553013ab96b7e97bcd6985c50bc64.1377631572.git.tom.zanussi@linux.intel.com \
--to=tom.zanussi@linux.intel.com \
--cc=linux-kernel@vger.kernel.org \
--cc=masami.hiramatsu.pt@hitachi.com \
--cc=rostedt@goodmis.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®