Received: by 2002:ac0:a5a6:0:0:0:0:0 with SMTP id m35-v6csp1491518imm; Fri, 7 Sep 2018 00:52:18 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYk5LDIyrtB3qg3YNCZ18nkGMSj0Xxm6ffRZ+hec3S6AZxteduSyWQ7RcwllJMV0BYcOAfl X-Received: by 2002:a62:8d16:: with SMTP id z22-v6mr7198059pfd.181.1536306738338; Fri, 07 Sep 2018 00:52:18 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536306738; cv=none; d=google.com; s=arc-20160816; b=FmSfzXddq4kggP61ygT2GsAPAIlNCYci6LKfdn9xu4ZgY+txszVs9YugrtwUPZctuP zo+vbdDKJpqf1l2zF90jWfNfI1mJPcQJpmZzNkTQrR9YMlbGc8kLIwQeekVQDnMCyIsB AaTsZX4WEpMzGg+OvTFt6nayc0XM28xPMw9XC/SgCOUfuSNqK6HGbcREV0VGfcpWoCAN bebVZoN6ZZgyag0Vc4FibQFylsmiOc2Cn5rfSYZkNoshBrJoDaixw0a3jkz0WYXJETWT B7+8NfXpmg910kVe/o1ARE0L6ocMj9HKc/EZmWJ0/IqASvWrzYdb7zPGGKzbAgYbZKXs RFeg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=rJi+GQRrL6Vi3lArdcK16IGEIVG9+K1joB7p0BmQqt4=; b=1GfUt7wDp/UdV0PrbjiUxdGETGOuLi7+8yT38ynYX34jaSbVnnSg0ON+Rf9B2hCvH0 QUmGS0LjLHMFvNzJIALLR0vS0CqX0O1nG1QXht0mbCcm3AZ6EBv+tNGTBtx3H62rYHS6 L4mAN/MzA1McUx3nb2V5UNMTF1mZnFGuPdKQdBDxchiJ5U4rBIWTMuo8YLYlecNFWSQ2 1jf0iuQZa9laBg/O+M5fzuhnbJGr+eX6m+zhGSwW/uG2uA91DQIIXlvVcEfqvaQGmCgU tiizALm4dd7MorUHVVBlk19Plqq46BzQDoz01TIhxm8fzUozHDT3By3QTQHMtRcDWJoa lpWg== 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 i12-v6si7931597pgr.267.2018.09.07.00.52.02; Fri, 07 Sep 2018 00:52:18 -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 S1727870AbeIGMaC (ORCPT + 99 others); Fri, 7 Sep 2018 08:30:02 -0400 Received: from mail-lf1-f66.google.com ([209.85.167.66]:43197 "EHLO mail-lf1-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727821AbeIGMaB (ORCPT ); Fri, 7 Sep 2018 08:30:01 -0400 Received: by mail-lf1-f66.google.com with SMTP id h64-v6so11279394lfi.10 for ; Fri, 07 Sep 2018 00:50:19 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to; bh=rJi+GQRrL6Vi3lArdcK16IGEIVG9+K1joB7p0BmQqt4=; b=LojKezxmm5cCxUKaGg5WjnljSCeXTKKaMsna/ZVgxmllBZdNsEeUx/8gCvn9qW31wt A5hC5uwA74cqfpSaCzdwMMEFTvvLE+IcFNHyH6VByAkpPQyoOGbLSAVod3mHog14mLaK Ev2OmJ8Q2M/7TVTNIxNxA9o1u8su3gbvDBEETAlUk3X9NyIO/BsJTACCKy5ClV6xmgmX R47jnW/tbAZLqXo7P6MBu5lDIJ7hcMvy47M4FPmBn1S7US764DQF8PiCWa0lUiLQ67y6 kkTHRkNcbb2dFVslTTj/ASuEcY5Falry4nrRBrPemQ+ixu927f1xnbdfpj7UeBJ187gg 0gew== X-Gm-Message-State: APzg51AelPM4E0fzC8XclYS/NNe7ZV873w/ECxOQdPbkLVSVPB0lz/3f vi0TCEw+pFfO7+6ziMUpUmM/lWen6slaUMp5E5s= X-Received: by 2002:a19:73c5:: with SMTP id h66-v6mr4105215lfk.22.1536306618062; Fri, 07 Sep 2018 00:50:18 -0700 (PDT) MIME-Version: 1.0 References: <20180821172822.30975-1-peter@korsgaard.com> In-Reply-To: <20180821172822.30975-1-peter@korsgaard.com> From: Peter Korsgaard Date: Fri, 7 Sep 2018 09:50:06 +0200 Message-ID: Subject: Re: [PATCH] ttyprintk: make the printk log level configurable To: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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? > 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]" > + > 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); > tpk_curr = 0; > } > } > -- > 2.11.0 > -- Bye, Peter Korsgaard