Skip to contentSkip to conversation

tracing/stacktrace: Show entire trace if passed in function not found

GIT PULL Steven Rostedt 1 participant 1 message Feb 1, 2016 Tracing

lore
Share & tools
lore

Steven Rostedt

author maintainer
#0 lore raw

Linus,

A cleanup to the stack tracer broke stack tracing on s390. Here's a simple fix to correct that issue.

Please pull the latest trace-v4.5-rc1-2 tree, which can be found at:

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
trace-v4.5-rc1-2

Tag SHA1: a452e1d1572d2ea305c8fe7b85365a1c5a1de40d Head SHA1: 6ccd83714a009ee301b50c15f6c3a5dc1f30164c

Steven Rostedt (1):
tracing/stacktrace: Show entire trace if passed in function not found

----

 kernel/trace/trace_stack.c | 7 +++++++
 1 file changed, 7 insertions(+)
---------------------------
commit 6ccd83714a009ee301b50c15f6c3a5dc1f30164c
Author: Steven Rostedt <[email protected]>
Date:   Fri Jan 29 10:22:41 2016 -0500

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.

Fixes 72ac426a5bb0 ("tracing: Clean up stack tracing and fix fentry updates")
kernel/trace/trace_stack.c +7 -0
index dda9e6742950..202df6cffcca 100644
@@ -126,6 +126,13 @@ check_stack(unsigned long ip, unsigned long *stack)
 	}
 
 	/*
+	 * 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.
 	 */
 	x = 0;