From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752813AbdJLKDI (ORCPT ); Thu, 12 Oct 2017 06:03:08 -0400 Received: from mx2.suse.de ([195.135.220.15]:48384 "EHLO mx2.suse.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751140AbdJLKDH (ORCPT ); Thu, 12 Oct 2017 06:03:07 -0400 Date: Thu, 12 Oct 2017 12:03:04 +0200 From: Petr Mladek To: Peter Zijlstra Cc: sergey.senozhatsky@gmail.com, linux-kernel@vger.kernel.org, rostedt@goodmis.org, mingo@kernel.org, tglx@linutronix.de, Jason Wessel Subject: Re: [PATCH 1/3] printk: Fix kdb_trap_printk placement Message-ID: <20171012100304.GD2882@pathway.suse.cz> References: <20170928121823.430053219@infradead.org> <20170928122513.328354788@infradead.org> <20171012094537.GF15129@pathway.suse.cz> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20171012094537.GF15129@pathway.suse.cz> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. My aim is to redirect all the exported interfaces into vprintk_func (need another name?) where the right implementation will be chosen by the context (NMI, printk_safe, kdb, deferred?, printk_early, normal). In each case, I would like to have all these re-directions on a single place to make the printk() code better readable. IMHO, it would make sense to do this clean up first before this patchset adds more twists. But I am afraid that we will meet some problems and it make take longer. I am open for opinions. Best Regards, Petr