Received: by 2002:ac0:aa62:0:0:0:0:0 with SMTP id w31-v6csp2291327ima; Thu, 25 Oct 2018 12:40:22 -0700 (PDT) X-Google-Smtp-Source: AJdET5er9gy3CtzQP4NH+maSZqYgpKibQow88a1nkdXCZ+9bvi4RqctCHQKDc/5aDJ9sgm/zVxqE X-Received: by 2002:a62:67c3:: with SMTP id t64-v6mr566196pfj.76.1540496422803; Thu, 25 Oct 2018 12:40:22 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540496422; cv=none; d=google.com; s=arc-20160816; b=AF2vMIpaMGBxLn9ahYNwwWvC5/KmZLZ+zNsAsY5JLBEbKtH7H+hlmFjSCPstejZ8bA 2VYlMztyMDKCItypDfyKYlYCsPrvg9AS6VNuezTEfRzolWIzF/qIN3KSjB5rOSlNytRU /qIG8oGVNk4uP/W97rWGsXhCQe62EyaF+dLIH+NwjYQia3SphLba8b/OgyP3R8WC9q4x BobCGiPwfMuUpeU+xwcM7NrOSwe5f5aWbyNdv7n6aw+rU5NC77eE6cBhSQZrHEqWRZBg qA/yr0NBwGZEaY4VvkHU1KXfdsSh0HwRvpZ19QCcoThfdRCYCO83ZE7XlPNCdOaUPkei BJeA== 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=yAhJZO5H7j3Hkd14PL32akOUnr3/UqwRj1CaDTHb+pYNU6X1Gn7JCCzCyKpnzArls2 BiqJ+a3a/FTS8OZHHQBK0WYm8aM3rCtaLHC2WQic8dsqSIxPrybGQEX+EjJ4zglx1qD8 J0KJUDKla4hfQt/ZbVQS6ZfyZ2uMvJXlPyPE1qA8VZbYcghiHJ7NKUyYJIvvP6KIjB0q s6IcVB08Wgd760D+9i5pS5UN2bi98xaSWTqGn51w0pY5dkQi1eFW6lohaXVVK/FEtTaZ qLQlP/mOpq75pzdArzByXelq4UBWZROaplroWu6NgaurO0esxo0lZuDentLntXETCp5C 3zmA== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=B3aCEXEB; 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 k4-v6si8630988pgg.527.2018.10.25.12.40.06; Thu, 25 Oct 2018 12:40:22 -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=B3aCEXEB; 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 S1726085AbeJZENq (ORCPT + 99 others); Fri, 26 Oct 2018 00:13:46 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:46714 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725784AbeJZENq (ORCPT ); Fri, 26 Oct 2018 00:13:46 -0400 Received: by mail-wr1-f67.google.com with SMTP id i4-v6so10490466wrr.13 for ; Thu, 25 Oct 2018 12:39:39 -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=B3aCEXEBcnTh6hVvbSe8++jfEO58GbUBdhE07mb2CDc9QdD7yQD3g7pr8+xSEfkfkW fOC+pjCrnlmXl3GEyF0i9UYoW0ODouZZA0OnGc4E0gL6HEd6TbHbX+WWaN/NWeFb5okl hlyR5FOqZmirSzmK4FE5U6lDI9hCpINB0XDP3DbR2rhdmiIsG17c9fzRMcMxMG1KCLAE 6F1RmLq3dE+GZRQDHOGs2Seguu5uteqasmK9HXYSGuwq2PDo1dt9Rlioak19ooWfS/sE GiWW71HTuYOVA4H2096WpIpUXnqTr2sIv6K8npreYh+MG24vgjFOeCTfCXEJc9Aaay/4 RTbQ== 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=HEsTlutpUKOOTBu1jDLCWBnAE+ndrVu39l0TfxHXPSEwfsaGQarxlDGXIKCPwE3K/1 dzNPNcT08n9be/Kk5YJ3+GJQTDewiNab970xetp+2pqoomE7i4ViMpcrycf/xRkqj9NU 0THIEEY6RPs4ZDpzY3mCgh7eu7iNeTBKsTeZ5D+L972KpB1WHcITfoI/tM37mlkRuiIL t9k1g9+QEKsFpPtZ7ZjgcaN5rmgDOeLME/5h1VISjiGSfa9uf60SVgRucG+AG3rg58H1 SVfjg4FByh5Xr2Sy4psJuM/m0eVIWE+jut7YDAvgYdf33TfzM7asndbb4RAwdRqf+FnW msaQ== X-Gm-Message-State: AGRZ1gKAk+hzcz6ifUEQABySf8C7+jLaq3AbIGMnJ+vocrGrqpMKZpWg P/Fj+MWbl9dnlg7Z6Ef2G7stY1OxpUA= X-Received: by 2002:adf:8c09:: with SMTP id z9-v6mr440384wra.82.1540496378656; Thu, 25 Oct 2018 12:39:38 -0700 (PDT) Received: from dell.be.48ers.dk ([94.185.135.34]) by smtp.gmail.com with ESMTPSA id j6-v6sm3207547wmd.29.2018.10.25.12.39.37 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Thu, 25 Oct 2018 12:39:37 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.89) (envelope-from ) id 1gFlTk-0006OU-Gv; Thu, 25 Oct 2018 21:39:36 +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: Thu, 25 Oct 2018 21:39:34 +0200 Message-Id: <20181025193934.24534-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