Skip to content

Commit ec19b85

Browse files
committed
ftrace: Move the probe function into the tracing directory
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>
1 parent a9064f6 commit ec19b85

2 files changed

Lines changed: 25 additions & 24 deletions

File tree

‎include/linux/ftrace.h‎

Lines changed: 0 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -360,30 +360,6 @@ void ftrace_bug(int err, struct dyn_ftrace *rec);
360360

361361
struct seq_file;
362362

363-
struct ftrace_probe_ops {
364-
void (*func)(unsigned long ip,
365-
unsigned long parent_ip,
366-
void **data);
367-
int (*init)(struct ftrace_probe_ops *ops,
368-
unsigned long ip, void **data);
369-
void (*free)(struct ftrace_probe_ops *ops,
370-
unsigned long ip, void **data);
371-
int (*print)(struct seq_file *m,
372-
unsigned long ip,
373-
struct ftrace_probe_ops *ops,
374-
void *data);
375-
};
376-
377-
extern int
378-
register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
379-
void *data);
380-
extern void
381-
unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
382-
void *data);
383-
extern void
384-
unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
385-
extern void unregister_ftrace_function_probe_all(char *glob);
386-
387363
extern int ftrace_text_reserved(const void *start, const void *end);
388364

389365
extern int ftrace_nr_registered_ops(void);

‎kernel/trace/trace.h‎

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -923,6 +923,31 @@ static inline void ftrace_pid_follow_fork(struct trace_array *tr, bool enable) {
923923
#endif /* CONFIG_FUNCTION_TRACER */
924924

925925
#if defined(CONFIG_FUNCTION_TRACER) && defined(CONFIG_DYNAMIC_FTRACE)
926+
927+
struct ftrace_probe_ops {
928+
void (*func)(unsigned long ip,
929+
unsigned long parent_ip,
930+
void **data);
931+
int (*init)(struct ftrace_probe_ops *ops,
932+
unsigned long ip, void **data);
933+
void (*free)(struct ftrace_probe_ops *ops,
934+
unsigned long ip, void **data);
935+
int (*print)(struct seq_file *m,
936+
unsigned long ip,
937+
struct ftrace_probe_ops *ops,
938+
void *data);
939+
};
940+
941+
extern int
942+
register_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
943+
void *data);
944+
extern void
945+
unregister_ftrace_function_probe(char *glob, struct ftrace_probe_ops *ops,
946+
void *data);
947+
extern void
948+
unregister_ftrace_function_probe_func(char *glob, struct ftrace_probe_ops *ops);
949+
extern void unregister_ftrace_function_probe_all(char *glob);
950+
926951
void ftrace_create_filter_files(struct ftrace_ops *ops,
927952
struct dentry *parent);
928953
void ftrace_destroy_filter_files(struct ftrace_ops *ops);

0 commit comments

Comments
 (0)