Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1628630

[for-next][PATCH 11/33] ftrace: Move the function commands into the tracing directory

From Steven Rostedt <rostedt@goodmis.org>
Newsgroups linux.kernel
Subject [for-next][PATCH 11/33] ftrace: Move the function commands into the tracing directory
Date 2017-04-21 23:50 +0200
Message-ID <tyOBc-2u9-39@gated-at.bofh.it> (permalink)
References <tyOrv-2qL-3@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


From: "Steven Rostedt (VMware)" <rostedt@goodmis.org>

As nothing outside the tracing directory uses the function command mechanism,
I'm moving the prototypes out of the include/linux/ftrace.h and into the
local kernel/trace/trace.h header. I plan on making them hook to the
trace_array structure which is local to kernel/trace, and I do not want to
expose it to the rest of the kernel. This requires that the command functions
must also be local to tracing. But luckily nothing else uses them.

Signed-off-by: Steven Rostedt (VMware) <rostedt@goodmis.org>
---
 include/linux/ftrace.h | 19 -------------------
 kernel/trace/trace.h   | 20 ++++++++++++++++++++
 2 files changed, 20 insertions(+), 19 deletions(-)

diff --git a/include/linux/ftrace.h b/include/linux/ftrace.h
index 3e790ff1c501..774e7a95c201 100644
--- a/include/linux/ftrace.h
+++ b/include/linux/ftrace.h
@@ -326,14 +326,6 @@ static inline void stack_tracer_disable(void) { }
 static inline void stack_tracer_enable(void) { }
 #endif
 
-struct ftrace_func_command {
-	struct list_head	list;
-	char			*name;
-	int			(*func)(struct ftrace_hash *hash,
-					char *func, char *cmd,
-					char *params, int enable);
-};
-
 #ifdef CONFIG_DYNAMIC_FTRACE
 
 int ftrace_arch_code_modify_prepare(void);
@@ -421,9 +413,6 @@ void ftrace_set_global_notrace(unsigned char *buf, int len, int reset);
 void ftrace_free_filter(struct ftrace_ops *ops);
 void ftrace_ops_set_global_filter(struct ftrace_ops *ops);
 
-int register_ftrace_command(struct ftrace_func_command *cmd);
-int unregister_ftrace_command(struct ftrace_func_command *cmd);
-
 enum {
 	FTRACE_UPDATE_CALLS		= (1 << 0),
 	FTRACE_DISABLE_CALLS		= (1 << 1),
@@ -639,14 +628,6 @@ static inline void ftrace_enable_daemon(void) { }
 static inline void ftrace_module_init(struct module *mod) { }
 static inline void ftrace_module_enable(struct module *mod) { }
 static inline void ftrace_release_mod(struct module *mod) { }
-static inline __init int register_ftrace_command(struct ftrace_func_command *cmd)
-{
-	return -EINVAL;
-}
-static inline __init int unregister_ftrace_command(char *cmd_name)
-{
-	return -EINVAL;
-}
 static inline int ftrace_text_reserved(const void *start, const void *end)
 {
 	return 0;
diff --git a/kernel/trace/trace.h b/kernel/trace/trace.h
index 2ff6d49fa5ca..a63411c53c5e 100644
--- a/kernel/trace/trace.h
+++ b/kernel/trace/trace.h
@@ -880,6 +880,13 @@ print_graph_function_flags(struct trace_iterator *iter, u32 flags)
 extern struct list_head ftrace_pids;
 
 #ifdef CONFIG_FUNCTION_TRACER
+struct ftrace_func_command {
+	struct list_head	list;
+	char			*name;
+	int			(*func)(struct ftrace_hash *hash,
+					char *func, char *cmd,
+					char *params, int enable);
+};
 extern bool ftrace_filter_param __initdata;
 static inline int ftrace_trace_task(struct trace_array *tr)
 {
@@ -948,10 +955,23 @@ extern void
 unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
 extern void unregister_ftrace_function_probe_all(char *glob);
 
+int register_ftrace_command(struct ftrace_func_command *cmd);
+int unregister_ftrace_command(struct ftrace_func_command *cmd);
+
 void ftrace_create_filter_files(struct ftrace_ops *ops,
 				struct dentry *parent);
 void ftrace_destroy_filter_files(struct ftrace_ops *ops);
 #else
+struct ftrace_func_command;
+
+static inline __init int register_ftrace_command(struct ftrace_func_command *cmd)
+{
+	return -EINVAL;
+}
+static inline __init int unregister_ftrace_command(char *cmd_name)
+{
+	return -EINVAL;
+}
 /*
  * The ops parameter passed in is usually undefined.
  * This must be a macro.
-- 
2.10.2

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

[for-next][PATCH 00/33] tracing: More updates for 4.12 Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:40 +0200
  [for-next][PATCH 15/33] tracing: Have the snapshot trigger use the mapping helper functions Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:40 +0200
  [for-next][PATCH 29/33] tracing/ftrace: Add a better way to pass data via the probe functions Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:40 +0200
  [for-next][PATCH 19/33] ftrace: Remove printing of data in showing of a function probe Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:40 +0200
  [for-next][PATCH 08/33] selftests: ftrace: Add a test to test function triggers to start and  stop tracing Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:40 +0200
  [for-next][PATCH 14/33] ftrace: Added ftrace_func_mapper for function probe triggers Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:40 +0200
  [for-next][PATCH 20/33] ftrace: Remove data field from ftrace_func_probe structure Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:40 +0200
  [for-next][PATCH 28/33] ftrace: Dynamically create the probe ftrace_ops for the trace_array Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:40 +0200
  [for-next][PATCH 25/33] ftrace: If the hash for a probe fails to update then free what was  initialized Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:40 +0200
  [for-next][PATCH 16/33] ftrace: Convert the rest of the function trigger over to the mapping  functions Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:40 +0200
  [for-next][PATCH 01/33] ftrace: Fix removing of second function probe Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:50 +0200
  [for-next][PATCH 09/33] selftests: ftrace: Add test to test reading of set_ftrace_file Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:50 +0200
  [for-next][PATCH 13/33] ftrace: Pass probe ops to probe function Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:50 +0200
  [for-next][PATCH 07/33] selftests: ftrace: Add a selftest to test event enable/disable func  trigger Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:50 +0200
  [for-next][PATCH 05/33] selftests: ftrace: Add -l/--logdir option Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:50 +0200
  [for-next][PATCH 02/33] ftrace: Fix indexing of t_hash_start() from t_next() Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:50 +0200
  [for-next][PATCH 11/33] ftrace: Move the function commands into the tracing directory Steven Rostedt <rostedt@goodmis.org> - 2017-04-21 23:50 +0200

csiph-web