aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/trace/trace_branch.c
diff options
context:
space:
mode:
authorSteven Rostedt <srostedt@redhat.com>2008-11-21 01:51:53 -0500
committerIngo Molnar <mingo@elte.hu>2008-11-23 05:40:21 -0500
commitbac28bfe42ba98ee67503f78984d1d5e1ebbbb78 (patch)
tree4187a43a240651919adbd6c0ad334dc10209ca23 /kernel/trace/trace_branch.c
parent45b797492a0758e64dff74e9db70e1f65e0603a5 (diff)
trace: branch profiling should not print percent without data
Impact: cleanup on output of branch profiler When a branch has not been taken, it does not make sense to show a percentage incorrect or hit. This patch changes the behaviour to print out a 'X' when the branch has not been executed yet. For example: correct incorrect % Function File Line ------- --------- - -------- ---- ---- 2096 0 0 do_arch_prctl process_64.c 832 0 0 X do_arch_prctl process_64.c 804 2604 0 0 IS_ERR err.h 34 130228 5765 4 __switch_to process_64.c 673 0 0 X enable_TSC process_64.c 448 0 0 X disable_TSC process_64.c 431 Signed-off-by: Steven Rostedt <srostedt@redhat.com> Signed-off-by: Ingo Molnar <mingo@elte.hu>
Diffstat (limited to 'kernel/trace/trace_branch.c')
-rw-r--r--kernel/trace/trace_branch.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/kernel/trace/trace_branch.c b/kernel/trace/trace_branch.c
index 21dedc8b50a4..142acb3b4e00 100644
--- a/kernel/trace/trace_branch.c
+++ b/kernel/trace/trace_branch.c
@@ -225,7 +225,7 @@ static int t_show(struct seq_file *m, void *v)
225{ 225{
226 struct ftrace_branch_data *p = v; 226 struct ftrace_branch_data *p = v;
227 const char *f; 227 const char *f;
228 unsigned long percent; 228 long percent;
229 229
230 if (v == (void *)1) { 230 if (v == (void *)1) {
231 seq_printf(m, " correct incorrect %% " 231 seq_printf(m, " correct incorrect %% "
@@ -247,9 +247,13 @@ static int t_show(struct seq_file *m, void *v)
247 percent = p->incorrect * 100; 247 percent = p->incorrect * 100;
248 percent /= p->correct + p->incorrect; 248 percent /= p->correct + p->incorrect;
249 } else 249 } else
250 percent = p->incorrect ? 100 : 0; 250 percent = p->incorrect ? 100 : -1;
251 251
252 seq_printf(m, "%8lu %8lu %3lu ", p->correct, p->incorrect, percent); 252 seq_printf(m, "%8lu %8lu ", p->correct, p->incorrect);
253 if (percent < 0)
254 seq_printf(m, " X ");
255 else
256 seq_printf(m, "%3ld ", percent);
253 seq_printf(m, "%-30.30s %-20.20s %d\n", p->func, f, p->line); 257 seq_printf(m, "%-30.30s %-20.20s %d\n", p->func, f, p->line);
254 return 0; 258 return 0;
255} 259}