Skip to content

Commit

Permalink
tracing/stacktrace: Show entire trace if passed in function not found
Browse files Browse the repository at this point in the history
When a max stack trace is discovered, the stack dump is saved. In order to
not record the overhead of the stack tracer, the ip of the traced function
is looked for within the dump. The trace is started from the location of
that function. But if for some reason the ip is not found, the entire stack
trace is then truncated. That's not very useful. Instead, print everything
if the ip of the traced function is not found within the trace.

This issue showed up on s390.

Link: http://lkml.kernel.org/r/20160129102241.1b3c9c04@gandalf.local.home

Fixes: 72ac426 ("tracing: Clean up stack tracing and fix fentry updates")
Cc: stable@vger.kernel.org # v4.3+
Reported-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Tested-by: Heiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
  • Loading branch information
Steven Rostedt committed Jan 29, 2016
1 parent 92e963f commit 6ccd837
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions kernel/trace/trace_stack.c
Original file line number Diff line number Diff line change
Expand Up @@ -125,6 +125,13 @@ check_stack(unsigned long ip, unsigned long *stack)
break;
}

/*
* Some archs may not have the passed in ip in the dump.
* If that happens, we need to show everything.
*/
if (i == stack_trace_max.nr_entries)
i = 0;

/*
* Now find where in the stack these are.
*/
Expand Down

0 comments on commit 6ccd837

Please sign in to comment.