Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 145981
b: refs/heads/master
c: 34886c8
h: refs/heads/master
i:
  145979: 3fb4e3e
v: v3
  • Loading branch information
Steven Rostedt committed Mar 26, 2009
1 parent 6222228 commit 1c7bbbe
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 8 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 318e0a73c9e41b9a17241829bcd0605a39b87cb9
refs/heads/master: 34886c8bc590f078d4c0b88f50d061326639198d
21 changes: 14 additions & 7 deletions trunk/kernel/trace/ftrace.c
Original file line number Diff line number Diff line change
Expand Up @@ -347,8 +347,10 @@ static int function_stat_cmp(void *p1, void *p2)
static int function_stat_headers(struct seq_file *m)
{
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
seq_printf(m, " Function Hit Time\n"
" -------- --- ----\n");
seq_printf(m, " Function "
"Hit Time Avg\n"
" -------- "
"--- ---- ---\n");
#else
seq_printf(m, " Function Hit\n"
" -------- ---\n");
Expand All @@ -361,19 +363,24 @@ static int function_stat_show(struct seq_file *m, void *v)
struct ftrace_profile *rec = v;
char str[KSYM_SYMBOL_LEN];
#ifdef CONFIG_FUNCTION_GRAPH_TRACER
static struct trace_seq s;
static DEFINE_MUTEX(mutex);

mutex_lock(&mutex);
trace_seq_init(&s);
trace_print_graph_duration(rec->time, &s);
static struct trace_seq s;
unsigned long long avg;
#endif

kallsyms_lookup(rec->ip, NULL, NULL, NULL, str);
seq_printf(m, " %-30.30s %10lu", str, rec->counter);

#ifdef CONFIG_FUNCTION_GRAPH_TRACER
seq_printf(m, " ");
avg = rec->time;
do_div(avg, rec->counter);

mutex_lock(&mutex);
trace_seq_init(&s);
trace_print_graph_duration(rec->time, &s);
trace_seq_puts(&s, " ");
trace_print_graph_duration(avg, &s);
trace_print_seq(m, &s);
mutex_unlock(&mutex);
#endif
Expand Down

0 comments on commit 1c7bbbe

Please sign in to comment.