Skip to content

Commit 6ccd837

Browse files
committed
tracing/stacktrace: Show entire trace if passed in function not found
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/[email protected] Fixes: 72ac426 ("tracing: Clean up stack tracing and fix fentry updates") Cc: [email protected] # v4.3+ Reported-by: Heiko Carstens <[email protected]> Tested-by: Heiko Carstens <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 92e963f commit 6ccd837

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

kernel/trace/trace_stack.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,13 @@ check_stack(unsigned long ip, unsigned long *stack)
125125
break;
126126
}
127127

128+
/*
129+
* Some archs may not have the passed in ip in the dump.
130+
* If that happens, we need to show everything.
131+
*/
132+
if (i == stack_trace_max.nr_entries)
133+
i = 0;
134+
128135
/*
129136
* Now find where in the stack these are.
130137
*/

0 commit comments

Comments
 (0)