Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752004AbaDZSKk (ORCPT ); Sat, 26 Apr 2014 14:10:40 -0400 Received: from smtp.gentoo.org ([140.211.166.183]:50869 "EHLO smtp.gentoo.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751661AbaDZSKi (ORCPT ); Sat, 26 Apr 2014 14:10:38 -0400 From: Richard Yao To: Thomas Gleixner Cc: Ingo Molnar , "H. Peter Anvin" , x86@kernel.org, Andrew Morton , Tejun Heo , Vineet Gupta , Jesper Nilsson , Jiri Slaby , linux-kernel@vger.kernel.org, kernel@gentoo.org, Brian Behlendorf , Richard Yao Subject: [PATCH] x86/dumpstack: Walk frames when built with frame pointers Date: Sat, 26 Apr 2014 14:10:18 -0400 Message-Id: <1398535818-14217-1-git-send-email-ryao@gentoo.org> X-Mailer: git-send-email 1.8.3.2 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 --- 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 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/