From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752065AbdJLSLG (ORCPT ); Thu, 12 Oct 2017 14:11:06 -0400 Received: from smtprelay0180.hostedemail.com ([216.40.44.180]:36277 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751451AbdJLSLF (ORCPT ); Thu, 12 Oct 2017 14:11:05 -0400 X-Session-Marker: 6A6F6540706572636865732E636F6D X-Spam-Summary: 2,0,0,,d41d8cd98f00b204,joe@perches.com,:::::::::::::::::::,RULES_HIT:41:355:379:541:599:800:960:973:988:989:1260:1277:1311:1313:1314:1345:1359:1373:1437:1515:1516:1518:1534:1542:1593:1594:1605:1711:1730:1747:1777:1792:1981:2194:2199:2393:2553:2559:2562:2691:2693:2736:2828:3138:3139:3140:3141:3142:3622:3865:3866:3867:3868:3870:3871:3872:3873:3874:4184:4250:4321:5007:6119:7903:8531:10004:10400:10450:10455:10848:11026:11232:11658:11783:11914:12043:12050:12262:12294:12295:12296:12438:12555:12663:12679:12700:12737:12740:12895:12986:13095:13439:13618:13894:14180:14181:14659:14721:19904:19999:21060:21080:21094:21323:21365:21433:21451:21611:21627:30012:30029:30036:30051:30054:30090:30091,0,RBL:none,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:,MSBL:0,DNSBL:none,Custom_rules:0:0:0,LFtime:1,LUA_SUMMARY:none X-HE-Tag: plant29_7d789aae37f06 X-Filterd-Recvd-Size: 4150 Message-ID: <1507831860.814.5.camel@perches.com> Subject: Re: [PATCH 1/3] printk: Fix kdb_trap_printk placement From: Joe Perches To: Greg Kroah-Hartman , Peter Zijlstra , Kay Sievers Cc: Petr Mladek , sergey.senozhatsky@gmail.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, mingo@kernel.org, tglx@linutronix.de, Jason Wessel Date: Thu, 12 Oct 2017 11:11:00 -0700 In-Reply-To: <20171012120828.GA10932@kroah.com> References: <20170928121823.430053219@infradead.org> <20170928122513.328354788@infradead.org> <20171012094537.GF15129@pathway.suse.cz> <20171012100304.GD2882@pathway.suse.cz> <20171012113439.3temezwthmrz3pbu@hirez.programming.kicks-ass.net> <20171012115229.GB21916@kroah.com> <20171012120828.GA10932@kroah.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.22.6-1ubuntu1 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 Thu, 2017-10-12 at 14:08 +0200, Greg Kroah-Hartman wrote: > On Thu, Oct 12, 2017 at 01:52:29PM +0200, Greg Kroah-Hartman wrote: > > On Thu, Oct 12, 2017 at 01:34:39PM +0200, Peter Zijlstra wrote: > > > On Thu, Oct 12, 2017 at 12:03:04PM +0200, Petr Mladek wrote: > > > > On Thu 2017-10-12 11:45:37, Petr Mladek wrote: > > > > > Hi, > > > > > > > > > > I thought about this a lot from several angles. And I would prefer > > > > > sligly different placement, see the patch below. > > > > > > > > > > On Thu 2017-09-28 14:18:24, Peter Zijlstra wrote: > > > > > > Some people figured vprintk_emit() makes for a nice API and exported > > > > > > it, bypassing the kdb trap. > > > > > > > > > > Sigh, printk() API is pretty complicated and this export > > > > > made it much worse. Well, there are two things: > > > > > > > > > > First, kdb_trap_printk name is a bit misleading. It is not a > > > > > generic trap of any printk message. Instead it seems to be > > > > > used to redirect only particular messages from some existing > > > > > functions, e.g. show_regs() called from kdb_dumpregs(). > > > > > > > > > > Second, it seems that the only user of the exported vprintk_emit() > > > > > is dev_vprintk_emit(). I believe that code using this wrapper > > > > > is not called in the sections where kdb_trap_printk is incremented. > > > > > > > > Well, I wonder if we should go even further and stop exporting > > > > vprintk_emit(). IMHO, the only reason was dev_print_emit() and > > > > the ability to pass the extra "dict" parameter. > > > > > > You have my blessing there, but the device folks might have an opinion > > > on that; Cc'ed Gregkh. > > > > Hm, we "need" that dict option, otherwise the whole dev_printk() family > > of messages will not work properly, right? > > > > Or am I missing something? If you can figure out a way to still support > > the same thing (we need a prefix at the beginning of the message that > > shows the device/driver/binding/etc that emitted the message), that's > > fine with me, I'm not wed to vprintk_emit() :) > > Nope, this doesn't seem to deal with the prefix, except in some odd way > that is tied to the dynamic debugging logic. I really don't know what > this does anymore. Joe wrote it in 2012 as part of the dynamic debug > code. > > Joe, any thoughts? Man I hate rabbit-holes. I need a few days as I'm otherwise busy. This stuff has been broken for half a decade now. Perhaps it doesn't need fixing? In any case, printk needs a thorough breaking up and refactoring. Pushing around at its edges just makes it worse. vprintk_emit came from Kay Sievers. commit 7ff9554bb578ba02166071d2d487b7fc7d860d62 Author: Kay Sievers Date:   Thu May 3 02:29:13 2012 +0200     printk: convert byte-buffer to variable-length record buffer It seems printk_emit is also exported and unused.