Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp1273131imm; Wed, 10 Oct 2018 11:50:05 -0700 (PDT) X-Google-Smtp-Source: ACcGV62jraskNsLdvs151/AwXkVe5plKTVybWAXJfoU8zVOr21SBAkc0vK/ZIXbR4PRfVyx6ncLY X-Received: by 2002:a62:8a4f:: with SMTP id y76-v6mr36335219pfd.142.1539197405350; Wed, 10 Oct 2018 11:50:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539197405; cv=none; d=google.com; s=arc-20160816; b=CA5HkRbTltcJq+Q4cAKLF0/d3gmdaIbGkwsv8w+n0UzwQQqAtOkurfrd2Ns83CrJ7D jT4QFh89KDH2KWkHnuPcYcK5o4ZR1jcZr8WocMq6k2VNJ8teHYGS1vfW2hcAuAoOTNSP +n7PIITO+UbSZw/6Wb/FMxEnmriaSLt3kHdyn3fqTOuUONW4sjkvqW4A6PcWXiJf4QbY 0OLdJoLFK/P8k03VpUTIx8xIpPyjkg2bed+KV3y04yhBtZd0ponexC57gST2R9oQfr87 RW73NLP+eDTwWaLQ7sjUIlTNBCOGSSeKWx9WVHhiY78YdXNxipzzRikU6ZGtKEeTiQTL /hlw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature; bh=N2nxlAPwxCY787lzi2fWINFuw6kMiTtSA+BaIRlVVdE=; b=SLivd1rhyi8K8iumY/RTs4ScMLAFSGE6yowxoqy8EFjFyOc5dHq/CPS5SbQrgIy2mK fFvoc8C30ndliEC/K+bhmzh9Ah4kUrfTnn5UHjxQ1rtQHxCg5WAJ9Seib6xtdeINL0fi NwOmNFg3n0Tpt+xFvGh0mXxtp/PHyAs0IOP/lHBvYbq2E/4P/jnso0JgtM4HYmsk2Ij5 X3Csd/Xj7KsLlka/J0FIIhlomW/LF5Xbrl+U7Dz4LMaf+VDh/WIk9GXJAdMvvUH8NZlu 6LJ14yNlQKVGfbUJ8qCyJlW//TUg4fk+Bwm2PubAQ/Lev1v15V1YHVyooDs3uPtj2cdh z6cg== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=MN7PZquk; 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 cb15-v6si4279284plb.104.2018.10.10.11.49.49; Wed, 10 Oct 2018 11:50:05 -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=MN7PZquk; 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 S1726982AbeJKCMx (ORCPT + 99 others); Wed, 10 Oct 2018 22:12:53 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:37049 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726734AbeJKCMx (ORCPT ); Wed, 10 Oct 2018 22:12:53 -0400 Received: by mail-ed1-f67.google.com with SMTP id c22-v6so5907922edc.4 for ; Wed, 10 Oct 2018 11:49:26 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id; bh=N2nxlAPwxCY787lzi2fWINFuw6kMiTtSA+BaIRlVVdE=; b=MN7PZqukqNTvxHUMortt05cwxkZm9AKwieQjBjZGS7Crms5Gvi+BCZZCMgHinAv9XE Jq1Qni/QFnOhwY8LS68nc8QzQ1ZkFHvCG3dy1bAuQkm8pWyydx9LQWBJT5/gJzuoVMdy a95be9Pz6hX9Jp2y0Pba0RpHj0RcYBJag5lu7unit2jlp9/isaAkmv6pTAfcPgPrx9Pt LUF1mexehbUpEGZItT8ussDihMek4nV4FN4ETJnnbM/mf4I0uhWXM/yhu3F6gWiTMjJL ERV9oQE353QxwPDYyB7tZCCpg7yRu0nzpSNJ9QR45e6KqS2bOyShn4IXruxfrDUmbdhc fmEw== 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:date:message-id; bh=N2nxlAPwxCY787lzi2fWINFuw6kMiTtSA+BaIRlVVdE=; b=Grx022fcYjDsB+LRBTPXXHH4831OY8l8+fWSbMk0IXFaJKbebMqE07NbM/tbPqSAQu eJI9NLeuCJUVT4p+QQC4LdVZJa7ZFrf+NtxKNSAxI7cUt3lj62VrAZ5tRhACuNZg4ZId 9XGjkfVrE1UYLLCfEe9kLQMqSKvIbwWoxod7OsekS9zUQSlPDx3Na8yOEoklrx7FVj/C RohnseUtNrmPRvTsb4+xCjRLghDNPJYp1XL9ZnWeYj4NvvWZzL2brJ/Q9m0YVjUg33Hk HIULe+W2tzcvDudZlTp2rbzTYWxOUwubaLDDTc+6h39+dsa+xlbb4rGJjvqiEGMhAn0V Linw== X-Gm-Message-State: ABuFfohUN8jT/cnRhPbw4efbFNJV8q9N4Iu0Dn7Q2zehSp+lKxjKAvlD x9AkYI5bLhemrtg8d7dVveM= X-Received: by 2002:a17:906:f186:: with SMTP id gs6-v6mr34697868ejb.212.1539197365853; Wed, 10 Oct 2018 11:49:25 -0700 (PDT) Received: from dell.be.48ers.dk (d51a5bc31.access.telenet.be. [81.165.188.49]) by smtp.gmail.com with ESMTPSA id w10-v6sm2619332ejn.65.2018.10.10.11.49.24 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 10 Oct 2018 11:49:24 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.89) (envelope-from ) id 1gAJXq-0007O1-P1; Wed, 10 Oct 2018 20:49:18 +0200 From: Peter Korsgaard To: Arnd Bergmann , Greg Kroah-Hartman , Joe Perches , linux-kernel@vger.kernel.org Cc: Peter Korsgaard Subject: [RESEND PATCH v2] ttyprintk: make the printk log level configurable Date: Wed, 10 Oct 2018 20:49:10 +0200 Message-Id: <20181010184910.28353-1-peter@korsgaard.com> X-Mailer: git-send-email 2.11.0 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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. Signed-off-by: Peter Korsgaard --- Changes since v1: - Leave [U] prefix in printk invocation and drop space before it as suggested by Joe Perces. drivers/char/Kconfig | 8 ++++++++ drivers/char/ttyprintk.c | 4 +++- 2 files changed, 11 insertions(+), 1 deletion(-) 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..88808dbba486 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) + 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 "[U] %s\n", tpk_buffer); tpk_curr = 0; } } -- 2.11.0