From: Steven Rostedt Date: Fri, 15 May 2009 03:40:06 +0000 (-0400) Subject: tracing: stop stack trace on first empty entry X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=1ec7c4849c214fc78b023230264399836ea3b245;p=GitHub%2FLineageOS%2Fandroid_kernel_samsung_universal7580.git tracing: stop stack trace on first empty entry 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 --- diff --git a/kernel/trace/trace_output.c b/kernel/trace/trace_output.c index 8bd9a2c1a46..489c0e8ada0 100644 --- a/kernel/trace/trace_output.c +++ b/kernel/trace/trace_output.c @@ -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;