Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 809dcf29 authored by Steven Rostedt's avatar Steven Rostedt
Browse files

ftrace: add pretty print to selected fuction traces



This patch adds a call back for the tracers that have hooks to
selected functions. This allows the tracer to show better output
in the set_ftrace_filter file.

Signed-off-by: default avatarSteven Rostedt <srostedt@redhat.com>
parent 8fc0c701
Loading
Loading
Loading
Loading
+6 −0
Original line number Original line Diff line number Diff line
@@ -106,12 +106,18 @@ struct ftrace_func_command {
/* asm/ftrace.h must be defined for archs supporting dynamic ftrace */
/* asm/ftrace.h must be defined for archs supporting dynamic ftrace */
#include <asm/ftrace.h>
#include <asm/ftrace.h>


struct seq_file;

struct ftrace_hook_ops {
struct ftrace_hook_ops {
	void			(*func)(unsigned long ip,
	void			(*func)(unsigned long ip,
					unsigned long parent_ip,
					unsigned long parent_ip,
					void **data);
					void **data);
	int			(*callback)(unsigned long ip, void **data);
	int			(*callback)(unsigned long ip, void **data);
	void			(*free)(void **data);
	void			(*free)(void **data);
	int			(*print)(struct seq_file *m,
					 unsigned long ip,
					 struct ftrace_hook_ops *ops,
					 void *data);
};
};


extern int
extern int
+3 −0
Original line number Original line Diff line number Diff line
@@ -834,6 +834,9 @@ static int t_hash_show(struct seq_file *m, void *v)


	rec = hlist_entry(hnd, struct ftrace_func_hook, node);
	rec = hlist_entry(hnd, struct ftrace_func_hook, node);


	if (rec->ops->print)
		return rec->ops->print(m, rec->ip, rec->ops, rec->data);

	kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
	kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
	seq_printf(m, "%s:", str);
	seq_printf(m, "%s:", str);