From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755596AbcHXUG4 (ORCPT ); Wed, 24 Aug 2016 16:06:56 -0400 Received: from smtprelay0117.hostedemail.com ([216.40.44.117]:60175 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1752791AbcHXUGx (ORCPT ); Wed, 24 Aug 2016 16:06:53 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::::::::::::,RULES_HIT:41:355:379:421:541:599:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2691:2828:3138:3139:3140:3141:3142:3354:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4250:4321:5007:6121:6742:7875:7903:8660:10004:10400:10848:11026:11232:11658:11783:11914:12043:12114:12438:12663:12740:13148:13230:13255:13439:13894:14659:14721:21080:21433:30003:30036:30054:30070:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:5,LUA_SUMMARY:none X-HE-Tag: cream85_5cbfc4e21ed47 X-Filterd-Recvd-Size: 3549 Message-ID: <1472068636.3746.170.camel@perches.com> Subject: Re: [PATCH 3/6] x86/dumpstack: make printk_stack_address() more generally useful From: Joe Perches To: Josh Poimboeuf 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 , Byungchul Park , Nilay Vaish Date: Wed, 24 Aug 2016 12:57:16 -0700 In-Reply-To: <20160824192445.tiftvwceupuixays@treble> References: <9fbe0db05bacf66d337c162edbf61450d0cff1e2.1472057064.git.jpoimboe@redhat.com> <1472059718.3746.154.camel@perches.com> <20160824184327.ta3u3dckjmmc7dkx@treble> <1472065626.3746.164.camel@perches.com> <20160824192445.tiftvwceupuixays@treble> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.18.5.2-0ubuntu3 Mime-Version: 1.0 Content-Transfer-Encoding: 8bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, 2016-08-24 at 14:24 -0500, Josh Poimboeuf wrote: > On Wed, Aug 24, 2016 at 12:07:06PM -0700, Joe Perches wrote: > > On Wed, 2016-08-24 at 13:43 -0500, Josh Poimboeuf wrote: > > > On Wed, Aug 24, 2016 at 10:28:38AM -0700, Joe Perches wrote: > > > > On Wed, 2016-08-24 at 11:50 -0500, Josh Poimboeuf wrote: > > > > > Change printk_stack_address() to be useful when called by an unwinder > > > > > outside the context of dump_trace(). > > > > > > > > > > Specifically: > > > > > > > > > > - printk_stack_address()'s 'data' argument is always used as the log > > > > >   level string.  Make that explicit. > > [] > > > > If this is true, and I'm not sure it is as I believe > > > > there are static strings emitted like EOE and IRQ, > > > > shouldn't this bubble up through the calling tree? > > > [] > > > This function needs to keep its 'void *data' argument because it's a > > > callback for stacktrace_ops, so it has to conform to the callback > > > interface.  'data' is used for passing a pointer to an opaque data > > > structure to the callback. > > > > > > Also this is the only caller of printk_stack_address(), so there's > > > nowhere else to bubble it up to. > > And that shows that print_stack_address(data is not always a log level. > > ie: walk_stack uses it to print a string not a log level. > Hm, can you be more specific?  As far as I can tell, here's the only > possible call path to print_trace_address() and printk_stack_address(): > > show_trace_log_lvl() >   dump_trace() // ops is print_trace_op >     print_context_stack() // ops->walk_stack >       print_trace_address() // ops->address >           printk_stack_address() > > So 'data' is a sneaky way to pass 'log_lvl' from show_trace_log_lvl() to > print_trace_address(), without dump_trace() and print_context_stack() > knowing what it is, because they're used in other places where 'data' > means something else. hmm, perhaps I got lost in a twisting maze of little callbacks. I'll drop some stuff and see where I am next time.