Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp5403355imm; Tue, 21 Aug 2018 11:05:59 -0700 (PDT) X-Google-Smtp-Source: AA+uWPzx6gC+34nejA6zl5WKv3Zca4SBNa+pbQHB/yeDSzM+s3BLcxtEKnmO6n2wyWaJ/VBgndQU X-Received: by 2002:a17:902:a613:: with SMTP id u19-v6mr50826193plq.234.1534874759022; Tue, 21 Aug 2018 11:05:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1534874758; cv=none; d=google.com; s=arc-20160816; b=W9ReWbwTmSS6fJfU/lUYfAbhx/gm4DynsppAjHT9iJP2DFvspO91yu999PPexaUZUu gl3JL43A77MaHXeVj8yQBgpHRTXJ4MzRvH7oW1yQx96ghVr6uPUfzrw+eYJOjcYxGaMy RXPFEHhU6lv94ZvLr80/OpnHquCbQ8m+PFZRVZvxa8tyFhSP19Ao/1z6GHmfbdsL24+A z/h+/nqx6RbH+HaRoGyP+1V3WXRoIj4+au6im4+ckjmcuK8btwTZSAaOrGVi5w0V77+8 SPHEz2B1pKG+2Q9q58ntbUQBTQDPVBcFNj40pyQmChfxZxW12LnDb1OIeyJVLCmEli4I 6bMw== 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:arc-authentication-results; bh=V7JcX9TJkFRIeYghVVBHAuxKIL9Ien7WkapaghyRol8=; b=IZXhD8QUCW3ea29BR/X1RoLmivZs/eQIX6nfnEBUqDP/JWkM2FPrpHdgzP2P9tzUkc Zb5Q3KWyGlvxquALpLwmbA33plCNWjgQy4oGzXWoElhUEMjP9/47SNoqbP7iN0SEwgZf CcoLCUE0iFiumi0WwsM3LQlPm9NNIkoVuSx7zkY91FtjpN0exBs5JduBO7c/vFdIuvEr uFWh6vBMOjkTv/nTFRUGao7mDMS+zUnEoQ+R8tjambxKBZteFgptSWTXZhPthOMZrdM7 HBa5QeQDautmh47MihUIFUKhH4qIvs/McnFis3HaoM52m59/nZw35Jx0ls5UfKBlZe0B 0h2w== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=EV2s1dCY; 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 q74-v6si14110502pfq.32.2018.08.21.11.05.13; Tue, 21 Aug 2018 11:05:58 -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=EV2s1dCY; 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 S1726978AbeHUUts (ORCPT + 99 others); Tue, 21 Aug 2018 16:49:48 -0400 Received: from mail-ed1-f67.google.com ([209.85.208.67]:32876 "EHLO mail-ed1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726615AbeHUUts (ORCPT ); Tue, 21 Aug 2018 16:49:48 -0400 Received: by mail-ed1-f67.google.com with SMTP id h9-v6so3715373edr.0 for ; Tue, 21 Aug 2018 10:28:44 -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=V7JcX9TJkFRIeYghVVBHAuxKIL9Ien7WkapaghyRol8=; b=EV2s1dCY8uxfwzItB+GtPndUPuX6eSWlQBl3OkZGP/ZDRfYqJiQNmM/3VBv9xF6/CE T2lTY++pfySV3cPcPWjwm+wAXNf9BPxM64O2oxLpqfLN9SeoD9FRTp2tTxO8Uk8R+FvH TryF3Mc7oEGYEaM+c3qV/UQ14kHTX+dcchsrDgk52UWNAnig3/QpPxykIfBwvXkCcBeI aHxv4RimZoOG8vUzLc7FkUho12GaB80BIItYhgxVzLPNvZ6DAa/TnBfHN6984k5KrNYB aY7lCp5H5hQx46Z4CPbkxra9k8lLPYftAVJGKESnvz7Jm4WrF3OY2ZrfQIWJwdy5QHNl SMVA== 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=V7JcX9TJkFRIeYghVVBHAuxKIL9Ien7WkapaghyRol8=; b=rNnTBTh1mtN2XmYMSFti+XMGUC6dR+JsRp3D7XxCGi6RAye/5jUcw61hFelr/cAt9+ 1VTKLCnCtz+Vx7tgnzprm05RQx49AnoCWXRZaQzRZTX/YFcLfGTXhBoEXxWnNVZCPyOw pMECMukusSHHU7u3zahBZQPmDhYqrVafyifQxB3hcpBx/4TAaYDTbloo2ZX2xF0RXTZe pYEyIu2KQUC7XQeUOAjmDv9hN2EuN7YOAhUhoCSSjPAfzV4wRzfbfiK+zoI/sApRRld7 Wnq+xAVPzjlCl13LaSKNPcHluV9Kp4TX2YC9UbgE+gwKCF0+EAvM04Q4Y4NBE1KG4R6n ljDQ== X-Gm-Message-State: AOUpUlELveFe03HKykTsBdYvGbrM3JWGuVJ4VJqWezJAB+okvXxKWjH8 K+3sUxVh3Wc09j8TcHXcTHU= X-Received: by 2002:a50:dd4b:: with SMTP id u11-v6mr63586699edk.298.1534872523522; Tue, 21 Aug 2018 10:28:43 -0700 (PDT) Received: from dell.be.48ers.dk (d51a5bc31.access.telenet.be. [81.165.188.49]) by smtp.gmail.com with ESMTPSA id w1-v6sm9599668eda.63.2018.08.21.10.28.42 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Tue, 21 Aug 2018 10:28:42 -0700 (PDT) Received: from peko by dell.be.48ers.dk with local (Exim 4.89) (envelope-from ) id 1fsASP-00087E-Gf; Tue, 21 Aug 2018 19:28:41 +0200 From: Peter Korsgaard To: Arnd Bergmann , Greg Kroah-Hartman , linux-kernel@vger.kernel.org Cc: Peter Korsgaard Subject: [PATCH] ttyprintk: make the printk log level configurable Date: Tue, 21 Aug 2018 19:28:22 +0200 Message-Id: <20180821172822.30975-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 --- 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..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