Skip to content

Commit

Permalink
ftrace: add pretty print to selected fuction traces
Browse files Browse the repository at this point in the history
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: Steven Rostedt <srostedt@redhat.com>
  • Loading branch information
Steven Rostedt committed Feb 17, 2009
1 parent 8fc0c70 commit 809dcf2
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/linux/ftrace.h
Original file line number Diff line number Diff line change
Expand Up @@ -106,12 +106,18 @@ struct ftrace_func_command {
/* asm/ftrace.h must be defined for archs supporting dynamic ftrace */
#include <asm/ftrace.h>

struct seq_file;

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

extern int
Expand Down
3 changes: 3 additions & 0 deletions kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -834,6 +834,9 @@ static int t_hash_show(struct seq_file *m, void *v)

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);
seq_printf(m, "%s:", str);

Expand Down

0 comments on commit 809dcf2

Please sign in to comment.