Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1509085imm; Fri, 7 Sep 2018 01:14:31 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYmEH5gCHDgweLkeacxLDi1+NH9bisKheGyMgghxYAp0Ypo2pmdAVKYwQE2TTUrKKIlPCq5 X-Received: by 2002:a63:1644:: with SMTP id 4-v6mr6946954pgw.103.1536308071690; Fri, 07 Sep 2018 01:14:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536308071; cv=none; d=google.com; s=arc-20160816; b=QyCqd6+XXVmfN51QEhP5b8ZrpEBLq9AjGnmVtxlYhWppjW9s/clHu/DLLqyjyZdKsy pQutm/vbRWt7B9457FScuRf4RTbqZDbvot92a+vaXC06it7+h/FvQw+Pu0SuPIFE55pU P8J0hR3tWf8fdk+TZjE1Dg1jZFaSrb2vSpdPq8O73IKCwYTaGCy9mhr6g+PsEa62zDLV MvEYd96UW06rKFJJDBflQJLbDAPZGYszMovR2cXOnm28nrSLFN0+PA0yqo4qMcVHJz8l buV6d34mQ56t2XYbHBmVz6u9RLz+00aaxYNZ5nFrJZN4YyhBa+U8C7a1rR/A4Fk/4ivX ZNyw== 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:dkim-signature; bh=GgNwtJo1vPC7U/PtvAGAwPdDMSa7hPG7vco+1yqUmCg=; b=Ni3vy6a7RA/RtqMXfyHxIy3PF92Y4Jn8zqTo44/464SL1eKcvDFKNBA8DF62dKVIBJ liQT+Jfea/QsxUmnyliR6DtxQYvGxdKPHqZfTAbfMpYUS2lHLx7Zy2TNoJPgcArn3U5Z 2GNikCk77kvb8X8GXFgUZ4n0C1LRS+0oTIByC+reEAfuKocfjj5Rrf2R50415iNN00y4 veh1uzI7IdBoVdeZAPk3Zpl88oL3HQK2WqIAvRK3i0tZDmXm9/KLMtP81ACvlG6/+pB4 Jga1IsBQZW5VM30FzCBwQyIOf6q1I43ltmuNlWmcLal2w8tCe6u23OVpshiyiNwfjvNx i4WQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=fICs13b+; 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 b35-v6si7381903plh.308.2018.09.07.01.14.16; Fri, 07 Sep 2018 01:14:31 -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; dkim=fail header.i=@gmail.com header.s=20161025 header.b=fICs13b+; 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 S1728095AbeIGMvR (ORCPT + 99 others); Fri, 7 Sep 2018 08:51:17 -0400 Received: from mail-ed1-f66.google.com ([209.85.208.66]:42713 "EHLO mail-ed1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726334AbeIGMvR (ORCPT ); Fri, 7 Sep 2018 08:51:17 -0400 Received: by mail-ed1-f66.google.com with SMTP id l5so10898860edw.9 for ; Fri, 07 Sep 2018 01:11:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:references:date:in-reply-to:message-id :user-agent:mime-version; bh=GgNwtJo1vPC7U/PtvAGAwPdDMSa7hPG7vco+1yqUmCg=; b=fICs13b+/YAM+gKqXwS6mCw3gdV5+Wkq5HuHdPs9gnqLQGbinkXylWqJr2e3NjdVQ2 CR9jjlHRVVVUMlNQ/IX0QakbNbUu+gAQ4opq2qdBAUilak/VmrjxGC40V6hqd4QjiLEs GvC0lDD5me+R7j3PjAkPJNYYdbTuYfCx0yDB+xJvOjxmqhtLQJdY0A8E/02jfnvW4cHZ CumgtFIhVztGk1fMQDULXkIKFMvd2sdAA79N+xMdHLopPEA72BSqRz5xgKNFDWQVhgPK jPrNg+hLGFk9Jq3TxeWm7bXC3kW5ZyV8pPrLroUCOzMq18zpSjh4+4TIWHnDrLWW8c2q ouyw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:references:date :in-reply-to:message-id:user-agent:mime-version; bh=GgNwtJo1vPC7U/PtvAGAwPdDMSa7hPG7vco+1yqUmCg=; b=UEl7jz/vnukJ3DBjvkk5aXE42i7IXVFP5kQYs1dE42W8yN5QqvMod0hQrxOpUfOyKg 6FOVSz5rDYKDvxi7It1aW9QkxXp5M9a02/+j9mOes+v4pXl2w+jxDL78EyNlTw3+kXPL xK4cC1UC/RusrZKpAo6Rmc01gfnbIRIY95KlMQpcQGScHkUFike7PhGbogSZ2hRav5NW gaoG8Zs5h4uBUHWMUrMrRmGmfXgAwRHjHJuAX5V7rqoupiEDNlBwUG0HwcCDp2RNPB43 pyFO3tzEanf0vdHjJap1E9iaQLVfzSqpTqD1mCAtU/s/185UpI2pU66mYeKJegESbnxw wveg== X-Gm-Message-State: APzg51CUvKnHZZdlt4r7MKcYA+cLigJ2lEJ8B4r0YGJUK7/PMg5nHzJP iqfabZhxBxcH5aMoicDaVWW++95d X-Received: by 2002:aa7:d4d5:: with SMTP id t21-v6mr7705701edr.292.1536307888608; Fri, 07 Sep 2018 01:11:28 -0700 (PDT) Received: from dell.be.48ers.dk (d51A5BC31.access.telenet.be. [81.165.188.49]) by smtp.gmail.com with ESMTPSA id g4-v6sm4380010eda.86.2018.09.07.01.11.27 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 07 Sep 2018 01:11:27 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.89) (envelope-from ) id 1fyBrO-0004bi-2J; Fri, 07 Sep 2018 10:11:22 +0200 From: Peter Korsgaard To: Joe Perches Cc: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Subject: Re: [PATCH] ttyprintk: make the printk log level configurable References: <20180821172822.30975-1-peter@korsgaard.com> Date: Fri, 07 Sep 2018 10:11:22 +0200 In-Reply-To: (Joe Perches's message of "Fri, 07 Sep 2018 01:03:12 -0700") Message-ID: <87zhwt682d.fsf@dell.be.48ers.dk> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.5 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org >>>>> "Joe" == Joe Perches writes: > On Fri, 2018-09-07 at 09:50 +0200, Peter Korsgaard wrote: >> On Tue, Aug 21, 2018 at 7:28 PM Peter Korsgaard wrote: >> > >> > For some use cases it is handy to use a different printk log level than the >> > default (info) for the messages written to ttyprintk, so add a Kconfig >> > option similar to what we have for default console loglevel. >> >> Ping? Feedback, comments? > I think it is moving "[U]" into TPK_LEVEL is an > unnecessary and a tad obfuscating change. It is arguably part of the prefix, but OK - I have no problem leaving it in the printk line. > This also adds a leading space for unknown reasons > after the KERN_SOH . True. I'll fix that and send a v2 - Thanks. >> > diff --git a/drivers/char/Kconfig b/drivers/char/Kconfig >> > index ce277ee0a28a..14a7f023f20b 100644 >> > --- a/drivers/char/Kconfig >> > +++ b/drivers/char/Kconfig >> > @@ -66,6 +66,14 @@ config TTY_PRINTK >> > >> > If unsure, say N. >> > >> > +config TTY_PRINTK_LEVEL >> > + depends on TTY_PRINTK >> > + int "ttyprintk log level (1-7)" >> > + range 1 7 >> > + default "6" >> > + help >> > + Printk log level to use for ttyprintk messages. >> > + >> > config PRINTER >> > tristate "Parallel printer support" >> > depends on PARPORT >> > diff --git a/drivers/char/ttyprintk.c b/drivers/char/ttyprintk.c >> > index 67549ce88cc9..22fbd483b5dc 100644 >> > --- a/drivers/char/ttyprintk.c >> > +++ b/drivers/char/ttyprintk.c >> > @@ -37,6 +37,8 @@ static struct ttyprintk_port tpk_port; >> > */ >> > #define TPK_STR_SIZE 508 /* should be bigger then max expected line length */ >> > #define TPK_MAX_ROOM 4096 /* we could assume 4K for instance */ >> > +#define TPK_PREFIX KERN_SOH __stringify(CONFIG_TTY_PRINTK_LEVEL) " [U]" > I think this should be > #define TPK_PREFIX KERN_SOH __stringify(CONFIG_TTY_PRINTK_LEVEL) >> > + >> > static int tpk_curr; >> > >> > static char tpk_buffer[TPK_STR_SIZE + 4]; >> > @@ -45,7 +47,7 @@ static void tpk_flush(void) >> > { >> > if (tpk_curr > 0) { >> > tpk_buffer[tpk_curr] = '\0'; >> > - pr_info("[U] %s\n", tpk_buffer); >> > + printk(TPK_PREFIX " %s\n", tpk_buffer); > and this > printk(TPK_PREFIX "[U] %s\n", tpk_buffer); >> > tpk_curr = 0; >> > } >> > } >> > -- >> > 2.11.0 >> > >> >> -- Bye, Peter Korsgaard