Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1501033imm; Fri, 7 Sep 2018 01:04:39 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYHtP/aPpMJtC3Yj2fzTPEHBzHhgflMwxJEE6zTAs7QdOa9V06AbTaoiySj7tkwD0q5GOKu X-Received: by 2002:a63:1064:: with SMTP id 36-v6mr6935050pgq.254.1536307479652; Fri, 07 Sep 2018 01:04:39 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536307479; cv=none; d=google.com; s=arc-20160816; b=zqXTOt3VFV75r4AJJAQmVYBzXiwVR57f0Qh2ReybKkUSJ4TlaBvdN0yAdVS00Hap6y 6GuvsU6JfNULaGxMqhDNoUCDAMiaexzix9Zh0rJEPj2CUaMNBBPJ8TQoNCawLR4AvqbW CgQde7Fe+1kYzGswXUcrdIn3f1RyW6pJ7y3cuJRwFQiIIXksirAaXO9PKua89fUjmXS2 DN1vuq8H8y+Lb2OKJqr157efW9FCAu8uL1s/dhR+z7IrCscCk0c8x0XP/fMOasMgOp6B I99FJ7VfJtnF2j3hcUA3sifIsySNpzFvCTQ03qPHABm1TB57t7OhyDPbwP23hrzOM4EI 5J9w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:to:from:subject:message-id; bh=eFDO+vCIxKbcA6+6RtvAuObfyK8xexXsiK03Bg96Zeo=; b=r8PSJWOsAN6v0IZQOOnWuYqVWnKxY1mw63h7draCzKCYoyMlvQPiflVkaObDWn1oSN 8hobdkCR/J4Mw55QfmnRBbmBKP3j3IKyuZsE2lLo66Sdif3kNuFHMZHXJNh72C+/758H hm3VrZTY0UB7Aowb5lgw8rrxZVMU2FnCVEnJ5X7QT/KJNf4NKHJXfuM5VFBd3j4PCInO /nQRxrHSb/5txDC1mAe0z5kmxNbUyuaqqMaGP9g6tdmhxb0Xoy2AYcCXc5seoZ67cxKo 8sURecPyNUYJn5JdWagu8qfrslzKR1osH5VsVwLuOHyqU3tZSpYyCJWcykbSaRL/pgO/ EjDA== 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 l17-v6si8264997pgu.79.2018.09.07.01.04.24; Fri, 07 Sep 2018 01:04:39 -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 S1728004AbeIGMnB (ORCPT + 99 others); Fri, 7 Sep 2018 08:43:01 -0400 Received: from smtprelay0172.hostedemail.com ([216.40.44.172]:53151 "EHLO smtprelay.hostedemail.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1727093AbeIGMnB (ORCPT ); Fri, 7 Sep 2018 08:43:01 -0400 Received: from filter.hostedemail.com (clb03-v110.bra.tucows.net [216.40.38.60]) by smtprelay03.hostedemail.com (Postfix) with ESMTP id 3767E837F243; Fri, 7 Sep 2018 08:03:15 +0000 (UTC) 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:1381:1437:1515:1516:1518:1534:1542:1593:1594:1711:1730:1747:1777:1792:2393:2553:2559:2562:2828:3138:3139:3140:3141:3142:3354:3622:3865:3867:3868:3871:3872:4321:4605:5007:10004:10400:10848:11026:11232:11473:11658:11914:12043:12048:12296:12438:12555:12740:12760:12895:13439:14093:14097:14181:14659:14721:21080:21433:21451:21627:30054:30070:30075:30090:30091,0,RBL:47.151.153.53:@perches.com:.lbl8.mailshell.net-62.8.0.100 64.201.201.201,CacheIP:none,Bayesian:0.5,0.5,0.5,Netcheck:none,DomainCache:0,MSF:not bulk,SPF:fn,MSBL:0,DNSBL:neutral,Custom_rules:0:0:0,LFtime:33,LUA_SUMMARY:none X-HE-Tag: bed26_395bbcbd78805 X-Filterd-Recvd-Size: 3186 Received: from XPS-9350.home (unknown [47.151.153.53]) (Authenticated sender: joe@perches.com) by omf01.hostedemail.com (Postfix) with ESMTPA; Fri, 7 Sep 2018 08:03:14 +0000 (UTC) Message-ID: Subject: Re: [PATCH] ttyprintk: make the printk log level configurable From: Joe Perches To: Peter Korsgaard , Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Date: Fri, 07 Sep 2018 01:03:12 -0700 In-Reply-To: References: <20180821172822.30975-1-peter@korsgaard.com> Content-Type: text/plain; charset="ISO-8859-1" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. This also adds a leading space for unknown reasons after the KERN_SOH . > > 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 > > > >