From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.3 required=3.0 tests=DKIMWL_WL_HIGH,DKIM_SIGNED, DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 522E8C43331 for ; Mon, 11 Nov 2019 09:13:06 +0000 (UTC) Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2345D2075C for ; Mon, 11 Nov 2019 09:13:06 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="IGyBnyTK" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2345D2075C Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=suse.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References: Message-ID:Subject:To:From:Date:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=SVRRM8lD2ifQ7YrHcdhvqkfa03Ua2aECzabctuPf4qE=; b=IGyBnyTKSPyJR6 gcGRXREz8MjwWtlcANCWXIzOXEKvIf0EOetRaZX3KOXXAaywdDSg2rjefu1d2bKnhW+1298ovSwML Dv7TW92M3kCxNh+C9iHpAOreDQQgpU/zezQecYSmOe6g+0Gatzs4yVXuN2e7RR/ItH5vE/8dP1ahT BKGOQ1lICbJImTERcQWpifUSghpqn6q3rASqplyu93PwiFmZ4zPlMve3xV1eyY22U+PaZwm71KsBh K9ebE6FSfpmEnemg5FrFRn59Yb8Mc8bHnDSa/rdAb+PZ8FrRkPMpDEu/wt7on/LzH6K3gavcazSCM 2XUTELnWAaroN8Mfb6fw==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU5kv-0004KX-5s; Mon, 11 Nov 2019 09:13:05 +0000 Received: from mx2.suse.de ([195.135.220.15] helo=mx1.suse.de) by bombadil.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1iU5ks-0004HZ-2j; Mon, 11 Nov 2019 09:13:03 +0000 X-Virus-Scanned: by amavisd-new at test-mx.suse.de Received: from relay2.suse.de (unknown [195.135.220.254]) by mx1.suse.de (Postfix) with ESMTP id 54EB2ACA3; Mon, 11 Nov 2019 09:12:15 +0000 (UTC) Date: Mon, 11 Nov 2019 10:12:07 +0100 From: Petr Mladek To: Sergey Senozhatsky Subject: Re: [PATCH 00/50] Add log level to show_stack() Message-ID: <20191111091207.u3lrd6cmumnx4czr@pathway.suse.cz> References: <20191106030542.868541-1-dima@arista.com> <20191106083538.z5nlpuf64cigxigh@pathway.suse.cz> <20191108103719.GB175344@google.com> <20191108130447.h3wfgo4efjkto56f@pathway.suse.cz> <20191111012336.GA85185@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20191111012336.GA85185@google.com> User-Agent: NeoMutt/20170912 (1.9.0) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20191111_011302_418857_DDE9ECE6 X-CRM114-Status: GOOD ( 15.89 ) X-BeenThere: linux-riscv@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Juri Lelli , linux-sh@vger.kernel.org, Catalin Marinas , Ben Segall , Guo Ren , Pavel Machek , Vincent Guittot , Paul Burton , Dmitry Safonov , Michael Ellerman , Geert Uytterhoeven , Mel Gorman , Jiri Slaby , Matt Turner , uclinux-h8-devel@lists.sourceforge.jp, Len Brown , linux-pm@vger.kernel.org, Heiko Carstens , linux-um@lists.infradead.org, Thomas Gleixner , Dietmar Eggemann , Richard Henderson , Greg Kroah-Hartman , "Rafael J. Wysocki" , linux-kernel@vger.kernel.org, Ralf Baechle , Paul Mackerras , Andrew Morton , linux-ia64@vger.kernel.org, Tetsuo Handa , James Hogan , "James E.J. Bottomley" , Max Filippov , Vincent Chen , Ingo Molnar , linux-s390@vger.kernel.org, linux-c6x-dev@linux-c6x.org, Yoshinori Sato , linux-hexagon@vger.kernel.org, Helge Deller , linux-xtensa@linux-xtensa.org, Vasily Gorbik , Aurelien Jacquiot , linux-m68k@lists.linux-m68k.org, Stafford Horne , linux-arm-kernel@lists.infradead.org, Chris Zankel , Tony Luck , Douglas Anderson , Benjamin Herrenschmidt , Dmitry Safonov <0x7f454c46@gmail.com>, Will Deacon , Daniel Thompson , Brian Cain , Christian Borntraeger , kgdb-bugreport@lists.sourceforge.net, linux-snps-arc@lists.infradead.org, Fenghua Yu , Borislav Petkov , Jeff Dike , Steven Rostedt , Ivan Kokshaysky , Greentime Hu , Guan Xuetao , linux-parisc@vger.kernel.org, linux-alpha@vger.kernel.org, Ley Foon Tan , "David S. Miller" , Rich Felker , Peter Zijlstra , "H. Peter Anvin" , sparclinux@vger.kernel.org, linux-riscv@lists.infradead.org, Anton Ivanov , Jonas Bonn , Richard Weinberger , x86@kernel.org, Russell King , clang-built-linux@googlegroups.com, Ingo Molnar , Mark Salter , Albert Ou , Stefan Kristiansson , openrisc@lists.librecores.org, Paul Walmsley , Michal Simek , Vineet Gupta , linux-mips@vger.kernel.org, Sergey Senozhatsky , Palmer Dabbelt , Jason Wessel , nios2-dev@lists.rocketboards.org, linuxppc-dev@lists.ozlabs.org Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-riscv" Errors-To: linux-riscv-bounces+infradead-linux-riscv=archiver.kernel.org@lists.infradead.org On Mon 2019-11-11 10:23:36, Sergey Senozhatsky wrote: > On (19/11/08 14:04), Petr Mladek wrote: > [..] > > I agree that it is complicated to pass the loglevel as > > a parameter. It would be better define the default > > log level for a given code section. It might be stored > > in task_struct for the normal context and in per-CPU > > variables for interrupt contexts. > > I do recall that we talked about per-CPU printk state bit which would > start/end "just print it" section. We probably can extend it to "just > log_store" type of functionality. Doesn't look like a very bad idea. The problem with per-CPU printk is that we would need to disable interrupts. It is not always wanted. Also people might not expect this from a printk() API. > "This task/context is in trouble, whatever it printk()-s is important". It might be a minimal loglevel. More important messages would still be printed() with the higher loglevel. But yes, this per-code-section loglevel is problematic. The feedback against the patchset shows that people want it also the other way. I mean to keep pr_debug() as pr_debug(). A solution might be to use the per-code-section loglevel only instead of some special loglevel. > Per-console loglevel also might help sometimes. Slower consoles would > ->write() only critical messages, faster consoles everything. This looks like another problem to me. Anyway, this filtering will work better when the loglevel will be consistent across the related lines. > Passing log_level as part of message payload, which printk machinery > magically hides is not entirely exciting. What we have in the code > now - printk("%s blah\n", lvl) - is not what we see in the logs. > Because the leading '%s' becomes special. And printk()/sprintf() > documentation should reflect that: '%s' prints a string, but sometimes > it doesn't. I personally do not see this as a big problem. The explicitly passed loglevel makes me feel more confident that all needed printk() calls were updated. But it might be a false feeling. I do not really have any strong preference. Best Regards, Petr _______________________________________________ linux-riscv mailing list linux-riscv@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-riscv