diff options
author | Umesh Tiwari <umesh.t@samsung.com> | 2015-06-22 07:28:08 -0400 |
---|---|---|
committer | Steven Rostedt <rostedt@goodmis.org> | 2015-07-20 22:30:51 -0400 |
commit | 8e436ca042d904533a1e14fdc85f0facdfca752f (patch) | |
tree | 96448dc17ffb1e919481c69fe7cb2ae01ddab67d /kernel | |
parent | 72ac426a5bb0cec572d26b4456f8c1e14601694e (diff) |
ftrace: add tracing_thresh to function profile
This patch extends tracing_thresh functionality to function profile tracer.
If tracing_thresh is set, print those entries only,
whose average is > tracing thresh.
Link: http://lkml.kernel.org/r/1434972488-8571-1-git-send-email-umesh.t@samsung.com
Signed-off-by: Umesh Tiwari <umesh.t@samsung.com>
[ Removed unnecessary 'moved' comment ]
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Diffstat (limited to 'kernel')
-rw-r--r-- | kernel/trace/ftrace.c | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 02bece4a99ea..f46dbb5cdf76 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c | |||
@@ -613,13 +613,18 @@ static int function_stat_show(struct seq_file *m, void *v) | |||
613 | goto out; | 613 | goto out; |
614 | } | 614 | } |
615 | 615 | ||
616 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | ||
617 | avg = rec->time; | ||
618 | do_div(avg, rec->counter); | ||
619 | if (tracing_thresh && (avg < tracing_thresh)) | ||
620 | goto out; | ||
621 | #endif | ||
622 | |||
616 | kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); | 623 | kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); |
617 | seq_printf(m, " %-30.30s %10lu", str, rec->counter); | 624 | seq_printf(m, " %-30.30s %10lu", str, rec->counter); |
618 | 625 | ||
619 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER | 626 | #ifdef CONFIG_FUNCTION_GRAPH_TRACER |
620 | seq_puts(m, " "); | 627 | seq_puts(m, " "); |
621 | avg = rec->time; | ||
622 | do_div(avg, rec->counter); | ||
623 | 628 | ||
624 | /* Sample standard deviation (s^2) */ | 629 | /* Sample standard deviation (s^2) */ |
625 | if (rec->counter <= 1) | 630 | if (rec->counter <= 1) |