All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] x86/dumpstack: Walk frames when built with frame pointers
@ 2014-04-26 18:10 Richard Yao
  2014-04-27 12:08 ` Ingo Molnar
  0 siblings, 1 reply; 15+ messages in thread
From: Richard Yao @ 2014-04-26 18:10 UTC (permalink / raw)
  To: Thomas Gleixner
  Cc: Ingo Molnar, H. Peter Anvin, x86, Andrew Morton, Tejun Heo,
	Vineet Gupta, Jesper Nilsson, Jiri Slaby, linux-kernel, kernel,
	Brian Behlendorf, Richard Yao

Stack traces are generated by scanning the stack and interpeting
anything that looks like it could be a pointer to something. We do not
need to do this when we have frame pointers, but we do it anyway, with
the distinction that we use the return pointers to mark actual frames by
the absence of a question mark.

The additional verbosity of stack scanning tends to bombard us with
walls of text for no gain in practice, so lets switch to printing only
stack frames when frame pointers are available. That we can spend less
time reading stack traces and more time looking at code.

Signed-off-by: Richard Yao <ryao@gentoo.org>
---
 arch/x86/kernel/dumpstack.c | 4 ++++
 1 file changed, 4 insertions(+)

diff --git a/arch/x86/kernel/dumpstack.c b/arch/x86/kernel/dumpstack.c
index d9c12d3..94ffe06 100644
--- a/arch/x86/kernel/dumpstack.c
+++ b/arch/x86/kernel/dumpstack.c
@@ -162,7 +162,11 @@ static void print_trace_address(void *data, unsigned long addr, int reliable)
 static const struct stacktrace_ops print_trace_ops = {
 	.stack			= print_trace_stack,
 	.address		= print_trace_address,
+#ifdef CONFIG_FRAME_POINTER
+	.walk_stack		= print_context_stack_bp,
+#else
 	.walk_stack		= print_context_stack,
+#endif
 };
 
 void
-- 
1.8.3.2


^ permalink raw reply related	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2014-06-07  3:10 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2014-04-26 18:10 [PATCH] x86/dumpstack: Walk frames when built with frame pointers Richard Yao
2014-04-27 12:08 ` Ingo Molnar
2014-04-27 19:42   ` Peter Zijlstra
2014-04-27 19:51   ` Richard Yao
2014-04-27 20:08   ` Linus Torvalds
2014-04-27 20:36     ` Richard Yao
2014-05-07 17:18     ` Ingo Molnar
2014-05-07 17:37       ` Peter Zijlstra
2014-04-30 21:56   ` Frederic Weisbecker
2014-05-07 16:40     ` Ingo Molnar
2014-06-06  8:17       ` Peter Zijlstra
2014-06-06  8:24         ` Borislav Petkov
2014-06-06  9:35           ` Peter Zijlstra
2014-06-07  3:08             ` H. Peter Anvin
2014-06-07  3:09           ` H. Peter Anvin

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.