Skip to content

Commit

Permalink
tracing/trace_stack: fix the number of entries in the header
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
walimis authored and Steven Rostedt committed Jun 3, 2009
1 parent ea05b57 commit 083a63b
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion kernel/trace/trace_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 083a63b

Please sign in to comment.