]> git.karo-electronics.de Git - linux-beck.git/commitdiff
tracing/trace_stack: fix the number of entries in the header
authorwalimis <walimisdev@gmail.com>
Wed, 3 Jun 2009 08:01:28 +0000 (16:01 +0800)
committerSteven Rostedt <rostedt@goodmis.org>
Wed, 3 Jun 2009 14:24:44 +0000 (10:24 -0400)
The last entry in the stack_dump_trace is ULONG_MAX, which is not
a valid entry, but max_stack_trace.nr_entries has accounted for it.
So when printing the header, we should decrease it by one.
Before fix, print as following, for example:

Depth    Size   Location    (53 entries) <--- should be 52
-----    ----   --------
  0)     3264     108   update_wall_time+0x4d5/0x9a0
  ...
 51)       80      80   syscall_call+0x7/0xb
 ^^^
   it's correct.

Signed-off-by: walimis <walimisdev@gmail.com>
LKML-Reference: <1244016090-7814-1-git-send-email-walimisdev@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
kernel/trace/trace_stack.c

index 1796f00524e197766d5900761072d7f7c5713768..2d7aebd71dbd4e3489b8bf59fd29585b422be8e9 100644 (file)
@@ -265,7 +265,7 @@ static int t_show(struct seq_file *m, void *v)
                seq_printf(m, "        Depth    Size   Location"
                           "    (%d entries)\n"
                           "        -----    ----   --------\n",
-                          max_stack_trace.nr_entries);
+                          max_stack_trace.nr_entries - 1);
 
                if (!stack_tracer_enabled && !max_stack_size)
                        print_disabled(m);