ftrace: Move the probe function into the tracing directory
authorSteven Rostedt (VMware) <rostedt@goodmis.org>
Fri, 31 Mar 2017 23:01:14 +0000 (19:01 -0400)
committerSteven Rostedt (VMware) <rostedt@goodmis.org>
Tue, 18 Apr 2017 17:49:59 +0000 (13:49 -0400)
As nothing outside the tracing directory uses the function probes 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 probe 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
kernel/trace/trace.h

index 06b2990a35e4845387322b09cdc8df8c092bfe0b..3e790ff1c50142fcc5c9c10fed8383d88446bb21 100644 (file)
@@ -360,30 +360,6 @@ void ftrace_bug(int err, struct dyn_ftrace *rec);
 
 struct seq_file;
 
-struct ftrace_probe_ops {
-       void                    (*func)(unsigned long ip,
-                                       unsigned long parent_ip,
-                                       void **data);
-       int                     (*init)(struct ftrace_probe_ops *ops,
-                                       unsigned long ip, void **data);
-       void                    (*free)(struct ftrace_probe_ops *ops,
-                                       unsigned long ip, void **data);
-       int                     (*print)(struct seq_file *m,
-                                        unsigned long ip,
-                                        struct ftrace_probe_ops *ops,
-                                        void *data);
-};
-
-extern int
-register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
-                             void *data);
-extern void
-unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
-                               void *data);
-extern void
-unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
-extern void unregister_ftrace_function_probe_all(char *glob);
-
 extern int ftrace_text_reserved(const void *start, const void *end);
 
 extern int ftrace_nr_registered_ops(void);
index 31a4997b67c6719c826cbb5be8f2c00bbe48a6d3..2ff6d49fa5ca042b34a6ebf9258c455ef28577e9 100644 (file)
@@ -923,6 +923,31 @@ static inline void ftrace_pid_follow_fork(struct trace_array *tr, bool enable) {
 #endif /* CONFIG_FUNCTION_TRACER */
 
 #if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_DYNAMIC_FTRACE)
+
+struct ftrace_probe_ops {
+       void                    (*func)(unsigned long ip,
+                                       unsigned long parent_ip,
+                                       void **data);
+       int                     (*init)(struct ftrace_probe_ops *ops,
+                                       unsigned long ip, void **data);
+       void                    (*free)(struct ftrace_probe_ops *ops,
+                                       unsigned long ip, void **data);
+       int                     (*print)(struct seq_file *m,
+                                        unsigned long ip,
+                                        struct ftrace_probe_ops *ops,
+                                        void *data);
+};
+
+extern int
+register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
+                             void *data);
+extern void
+unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
+                               void *data);
+extern void
+unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
+extern void unregister_ftrace_function_probe_all(char *glob);
+
 void ftrace_create_filter_files(struct ftrace_ops *ops,
                                struct dentry *parent);
 void ftrace_destroy_filter_files(struct ftrace_ops *ops);