Received: by 2002:a25:e7d8:0:0:0:0:0 with SMTP id e207csp782153ybh; Wed, 18 Mar 2020 09:02:30 -0700 (PDT) X-Google-Smtp-Source: ADFU+vt0QvN7jAUqBTebF8mGPSo11LZqQNVoW74HmgM8BFrujWjxUCezh+YAi3nEzZuhCMzjiS8H X-Received: by 2002:a9d:12cc:: with SMTP id g70mr4217855otg.115.1584547350116; Wed, 18 Mar 2020 09:02:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1584547350; cv=none; d=google.com; s=arc-20160816; b=OjVjUfEflqkYVdVYdML6nAAyEgprr+ggG4VZIDbbQjAy2HiEECU5OACqH5zFXkbO1y OEMqWlWF+vhrKpLW0cVoLR64YGfRQ+CHeMBGUJSJo6m1GgIeVSpm3ywG+HKuOT2H0DE7 OcfhXoe6VPBOsIHUZWC7bop3tP6GRhZJEsyl0yfkANbefEQmykXFwgMGjPW+dP/tgOmw 2HAeLOgzr1qBRAaX1vEniUjNgBtYOkacjV2HdD3IngUdPzQvAIJJy7up7hmt3/ORNTmn RQcHcR4t5Y5+dMVx2kxMTGCtMIUWrhB26FPLp+jkRkQ5/OCXS68+W4Z0c9iO4TgdrWeb 9t+A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:user-agent:message-id :in-reply-to:date:references:subject:cc:to:from; bh=Oc4kjOJrwtHLCI5fqLguXcx9/LBSd7ToBbR6ZjBMsTU=; b=gUGtnZVPm48pDfXGe9kuSzRTIDrQMw7UXYnEUdfGureGgTV/oafJn+bW4co7rYrKeD en06nEknazDMFzICC6RQLyBhzAX9kTvbyiYVLUPw4l3NkTIaxpClJuio3cgo42VsfGNR LQb0DFA6DGPT/d6gslkW5mppyOi8muxy2SZg4Jn5fVgnmMh+hpifY2p7t1mGXMhiDZeU 0/XRO91/dS4ZZc8GFLsqH/w0xG3KqMvFxNRFs2W79tlTzMcz2azVm+pPD+Medo4v6h0k EtytMC/D5RhzBdh5I8pig3gNcmvQNrZ/nv5vQpL0df/JgYZzpiLp2MdywCOstX3o6C/a G9aA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w7si3549424otj.281.2020.03.18.09.02.16; Wed, 18 Mar 2020 09:02:30 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727099AbgCRQAs (ORCPT + 99 others); Wed, 18 Mar 2020 12:00:48 -0400 Received: from Galois.linutronix.de ([193.142.43.55]:57744 "EHLO Galois.linutronix.de" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726765AbgCRQAs (ORCPT ); Wed, 18 Mar 2020 12:00:48 -0400 Received: from localhost ([127.0.0.1] helo=vostro.local) by Galois.linutronix.de with esmtp (Exim 4.80) (envelope-from ) id 1jEb7G-0007Tj-3p; Wed, 18 Mar 2020 17:00:22 +0100 From: John Ogness To: Eugeniu Rosca Cc: linux-kernel@vger.kernel.org, Petr Mladek , Sergey Senozhatsky , Steven Rostedt , Ingo Molnar , Thomas Gleixner , Peter Zijlstra , Jisheng Zhang , Valdis Kletnieks , Sebastian Andrzej Siewior , Andrew Gabbasov , Dirk Behme , Eugeniu Rosca Subject: Re: [RFC PATCH 2/3] printk: add console_verbose_{start,end} References: <20200315170903.17393-1-erosca@de.adit-jv.com> <20200315170903.17393-3-erosca@de.adit-jv.com> Date: Wed, 18 Mar 2020 17:00:20 +0100 In-Reply-To: <20200315170903.17393-3-erosca@de.adit-jv.com> (Eugeniu Rosca's message of "Sun, 15 Mar 2020 18:09:02 +0100") Message-ID: <87o8stmz57.fsf@linutronix.de> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.4 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 2020-03-15, Eugeniu Rosca wrote: > diff --git a/include/linux/printk.h b/include/linux/printk.h > index 1e6108b8d15f..14755ef7b017 100644 > --- a/include/linux/printk.h > +++ b/include/linux/printk.h > @@ -3,6 +3,7 @@ > #define __KERNEL_PRINTK__ > > #include > +#include > #include > #include > #include > @@ -77,6 +78,15 @@ static inline void console_verbose(void) > console_loglevel = CONSOLE_LOGLEVEL_MOTORMOUTH; > } > > +#ifdef CONFIG_PRINTK > +extern atomic_t ignore_loglevel; > +static inline void console_verbose_start(void) { atomic_inc(&ignore_loglevel); } > +static inline void console_verbose_end(void) { atomic_dec(&ignore_loglevel); } To be compatible with console_verbose() semantics, this should also respect console_loglevel=0. Perhaps by updating suppress_message_printing() to be something like: static bool suppress_message_printing(int level) { return (!console_loglevel || (level >= console_loglevel && !ignore_loglevel)); } John Ogness