From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753353AbcGVBin (ORCPT ); Thu, 21 Jul 2016 21:38:43 -0400 Received: from mx1.redhat.com ([209.132.183.28]:32804 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751259AbcGVBik (ORCPT ); Thu, 21 Jul 2016 21:38:40 -0400 Date: Thu, 21 Jul 2016 20:38:36 -0500 From: Josh Poimboeuf To: Byungchul Park Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , x86@kernel.org, linux-kernel@vger.kernel.org, Andy Lutomirski , Linus Torvalds , Steven Rostedt , Brian Gerst , Kees Cook , Peter Zijlstra , Frederic Weisbecker Subject: Re: [PATCH 15/19] x86/dumpstack: convert show_trace_log_lvl() to the new unwinder Message-ID: <20160722013836.2fkqu4wk5hix2wqn@treble> References: <20160721214901.GT2279@X58A-UD3R> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <20160721214901.GT2279@X58A-UD3R> User-Agent: Mutt/1.6.0.1 (2016-04-01) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 22 Jul 2016 01:38:40 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jul 22, 2016 at 06:49:01AM +0900, Byungchul Park wrote: > On Thu, Jul 21, 2016 at 04:21:52PM -0500, Josh Poimboeuf wrote: > > Convert show_trace_log_lvl() to the new unwinder. dump_trace() has been > > deprecated. > > > > show_trace_log_lvl() is special compared to other users of the unwinder. > > It's the only place where both reliable *and* unreliable addresses are > > needed. With frame pointers enabled, most stack walking code doesn't > > want to know about unreliable addresses. But in this case, when we're > > dumping the stack to the console because something presumably went > > wrong, the unreliable addresses are useful: > > > > - They show stale data on the stack which can provide useful clues. > > > > - If something goes wrong with the unwinder, or if frame pointers are > > corrupt or missing, all the stack addresses still get shown. > > > > So in order to show all addresses on the stack, and at the same time > > figure out which addresses are reliable, we have to do the scanning and > > the unwinding in parallel. > > > > The scanning is done with the help of get_stack_info() to traverse the > > stacks. The unwinding is done separately by the new unwinder. > > > > In theory we could simplify show_trace_log_lvl() by instead pushing some > > of this logic into the unwind code. But then we would need some kind of > > "fake" frame logic in the unwinder which would add a lot of complexity > > and wouldn't be worth it in order to support only one user. > > > > Another benefit of this approach is that once we have a DWARF unwinder, > > we should be able to just plug it in with minimal impact to this code. > > > > Another change here is that callers of show_trace_log_lvl() don't need > > to provide the 'bp' argument. The unwinder already finds the relevant > > frame pointer by unwinding until it reaches the first frame after the > > provided stack pointer. > > Hello, > > You seem to have changed a lot of code with which I dealt in another patch. > I might be supposed to wait until yours will be done. I need to check yours > at first anyway. Yeah, that's why I added you to cc :-) I think this obsoletes your patches. -- Josh