Skip to content

Commit

Permalink
tracing: stop stack trace on first empty entry
Browse files Browse the repository at this point in the history
The stack tracer stores eight entries in the ring buffer when an event
traces the stack. The output outputs all eight entries regardless of
how many entries were recorded.

This patch breaks out of the loop when a null entry is discovered.

[ Impact: only print the stack that is recorded ]

Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt authored and Steven Rostedt committed May 15, 2009
1 parent 29a6797 commit 1ec7c48
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions kernel/trace/trace_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -898,6 +898,8 @@ static enum print_line_t trace_stack_print(struct trace_iterator *iter,
trace_assign_type(field, iter->ent);

for (i = 0; i < FTRACE_STACK_ENTRIES; i++) {
if (!field->caller[i])
break;
if (i) {
if (!trace_seq_puts(s, " <= "))
goto partial;
Expand Down

0 comments on commit 1ec7c48

Please sign in to comment.