[PATCH] ftrace-update-tracing_thresh-info
This patch updates the tracing_thresh information in ftrace documentation file(ftrace.txt). Signed-off-by: Umesh Tiwari --- Documentation/trace/ftrace.txt |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/Documentation/trace/ftrace.txt b/Documentation/trace/ftrace.txt index 572ca92..c9b9a7f 100644 --- a/Documentation/trace/ftrace.txt +++ b/Documentation/trace/ftrace.txt @@ -137,8 +137,13 @@ of ftrace. Here is a list of some of the key files: tracing_thresh: - Some latency tracers will record a trace whenever the - latency is greater than the number in this file. + Function graph,Function profile and some latency tracers + will record a trace whenever the latency is greater than + the number in this file. + + In case of Function profile entries whose average value is + greater than the number in this file will be recorded. + Only active when the file contains a number greater than 0. (in microseconds) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH v2] 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. Signed-off-by: Umesh Tiwari --- kernel/trace/ftrace.c |9 +++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 4f22802..1353441 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -600,13 +600,18 @@ static int function_stat_show(struct seq_file *m, void *v) goto out; } +#ifdef CONFIG_FUNCTION_GRAPH_TRACER + avg = rec->time; + do_div(avg, rec->counter); + if (tracing_thresh && (avg < tracing_thresh)) + goto out; +#endif + kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); seq_printf(m, " %-30.30s %10lu", str, rec->counter); #ifdef CONFIG_FUNCTION_GRAPH_TRACER seq_puts(m, ""); - avg = rec->time; - do_div(avg, rec->counter); /* Sample standard deviation (s^2) */ if (rec->counter <= 1) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majord...@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ftrace: add tracing_thresh to function profile
From: Himanshu Maithani This patch extends tracing_thresh functionality to function profile tracer. If tracing_thresh is set, print those entries only, whose average is > tracing thresh. Signed-off-by: Umesh Tiwari --- kernel/trace/ftrace.c | 10 -- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 4f22802..7a48a67 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -600,13 +600,19 @@ static int function_stat_show(struct seq_file *m, void *v) goto out; } + /* moved above to avoid printing values < thresh */ +#ifdef CONFIG_FUNCTION_GRAPH_TRACER + avg = rec->time; + do_div(avg, rec->counter); + if (tracing_thresh && (avg < tracing_thresh)) + goto out; +#endif + kallsyms_lookup(rec->ip, NULL, NULL, NULL, str); seq_printf(m, " %-30.30s %10lu", str, rec->counter); #ifdef CONFIG_FUNCTION_GRAPH_TRACER seq_puts(m, ""); - avg = rec->time; - do_div(avg, rec->counter); /* Sample standard deviation (s^2) */ if (rec->counter <= 1) -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/
[PATCH] ftrace: correct the counter increment for trace_buffer data
In ftrace_dump, for disabling buffer, iter.tr->trace_buffer.data is used. But for enabling, iter.trace_buffer->data is used. Even though, both point to same buffer, for readability, same convention should be used. Signed-off-by: Umesh Tiwari --- kernel/trace/trace.c |2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 62c6506..e6dc9c3 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -6698,7 +6698,7 @@ void ftrace_dump(enum ftrace_dump_mode oops_dump_mode) trace_init_global_iter(&iter); for_each_tracing_cpu(cpu) { - atomic_inc(&per_cpu_ptr(iter.tr->trace_buffer.data, cpu)->disabled); + atomic_inc(&per_cpu_ptr(iter.trace_buffer->data, cpu)->disabled); } old_userobj = trace_flags & TRACE_ITER_SYM_USEROBJ; -- 1.7.9.5 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in Please read the FAQ at http://www.tux.org/lkml/