From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 0C2C6C433E0 for ; Wed, 31 Mar 2021 10:00:54 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id D0FFA61981 for ; Wed, 31 Mar 2021 10:00:53 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235048AbhCaKAa (ORCPT ); Wed, 31 Mar 2021 06:00:30 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44030 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234991AbhCaJ7v (ORCPT ); Wed, 31 Mar 2021 05:59:51 -0400 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id EDF9EC061762 for ; Wed, 31 Mar 2021 02:59:50 -0700 (PDT) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:ada2:b4da:6568:5ad5]) by andre.telenet-ops.be with bizsmtp id mxzd240055W9KJv01xzdoY; Wed, 31 Mar 2021 11:59:49 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lRXdQ-00BseR-AW; Wed, 31 Mar 2021 11:59:36 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1lRXBt-001bpk-Cn; Wed, 31 Mar 2021 11:31:09 +0200 From: Geert Uytterhoeven To: Joerg Roedel , Will Deacon , Steven Rostedt , Ingo Molnar , Petr Mladek , Sergey Senozhatsky Cc: Linus Torvalds , Andrew Morton , Andy Shevchenko , Rasmus Villemoes , John Ogness , Gary R Hook , Marco Elver , Randy Dunlap , Vlastimil Babka , iommu@lists.linux-foundation.org, linux-kernel@vger.kernel.org, linux-embedded@vger.kernel.org, Geert Uytterhoeven Subject: [PATCH 2/3] tracing: Use pr_crit() instead of long fancy messages Date: Wed, 31 Mar 2021 11:31:03 +0200 Message-Id: <20210331093104.383705-3-geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210331093104.383705-1-geert+renesas@glider.be> References: <20210331093104.383705-1-geert+renesas@glider.be> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org While long fancy messages have a higher probability of being seen than small messages, they may scroll of the screen fast, if visible at all, and may still be missed. In addition, they increase boot time and kernel size. The correct mechanism to increase importance of a kernel message is not to draw fancy boxes with more text, but to shout louder, i.e. increase the message's reporting level. Making sure the administrator of the system is aware of such a message is a system policy, and is the responsability of a user-space log daemon. Fix this by increasing the reporting level from KERN_WARNING to KERN_CRIT, and removing irrelevant text and graphics. This reduces kernel size by ca. 0.5 KiB. Fixes: 2184db46e425c2b8 ("tracing: Print nasty banner when trace_printk() is in use") Signed-off-by: Geert Uytterhoeven --- kernel/trace/trace.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index eccb4e1187cc788e..b3a93aff01045923 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -3175,20 +3175,9 @@ void trace_printk_init_buffers(void) /* trace_printk() is for debug use only. Don't use it in production. */ - pr_warn("\n"); - pr_warn("**********************************************************\n"); - pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n"); - pr_warn("** **\n"); - pr_warn("** trace_printk() being used. Allocating extra memory. **\n"); - pr_warn("** **\n"); - pr_warn("** This means that this is a DEBUG kernel and it is **\n"); - pr_warn("** unsafe for production use. **\n"); - pr_warn("** **\n"); - pr_warn("** If you see this message and you are not debugging **\n"); - pr_warn("** the kernel, report this immediately to your vendor! **\n"); - pr_warn("** **\n"); - pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n"); - pr_warn("**********************************************************\n"); + pr_crit("trace_printk() being used. Allocating extra memory.\n"); + pr_crit("This means that this is a DEBUG kernel and it is\n"); + pr_crit("unsafe for production use.\n"); /* Expand the buffers to set size */ tracing_update_buffers(); -- 2.25.1 From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.8 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id AFFE3C433E0 for ; Wed, 31 Mar 2021 10:04:58 +0000 (UTC) Received: from smtp3.osuosl.org (smtp3.osuosl.org [140.211.166.136]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 3285161962 for ; Wed, 31 Mar 2021 10:04:58 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 3285161962 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=glider.be Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=iommu-bounces@lists.linux-foundation.org Received: from localhost (localhost [127.0.0.1]) by smtp3.osuosl.org (Postfix) with ESMTP id BFF3860ABA; Wed, 31 Mar 2021 10:04:57 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp3.osuosl.org ([127.0.0.1]) by localhost (smtp3.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id UGL4f26lQqfU; Wed, 31 Mar 2021 10:04:56 +0000 (UTC) Received: from lists.linuxfoundation.org (lf-lists.osuosl.org [140.211.9.56]) by smtp3.osuosl.org (Postfix) with ESMTP id 95A1560AA9; Wed, 31 Mar 2021 10:04:56 +0000 (UTC) Received: from lf-lists.osuosl.org (localhost [127.0.0.1]) by lists.linuxfoundation.org (Postfix) with ESMTP id CA7EBC0019; Wed, 31 Mar 2021 10:04:55 +0000 (UTC) Received: from smtp1.osuosl.org (smtp1.osuosl.org [IPv6:2605:bc80:3010::138]) by lists.linuxfoundation.org (Postfix) with ESMTP id E640CC000A for ; Wed, 31 Mar 2021 10:04:53 +0000 (UTC) Received: from localhost (localhost [127.0.0.1]) by smtp1.osuosl.org (Postfix) with ESMTP id C55238481B for ; Wed, 31 Mar 2021 10:04:53 +0000 (UTC) X-Virus-Scanned: amavisd-new at osuosl.org Received: from smtp1.osuosl.org ([127.0.0.1]) by localhost (smtp1.osuosl.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id wL-rHxAD7NVE for ; Wed, 31 Mar 2021 10:04:53 +0000 (UTC) X-Greylist: delayed 00:05:01 by SQLgrey-1.8.0 Received: from andre.telenet-ops.be (andre.telenet-ops.be [IPv6:2a02:1800:120:4::f00:15]) by smtp1.osuosl.org (Postfix) with ESMTPS id B6B0584812 for ; Wed, 31 Mar 2021 10:04:52 +0000 (UTC) Received: from ramsan.of.borg ([IPv6:2a02:1810:ac12:ed20:ada2:b4da:6568:5ad5]) by andre.telenet-ops.be with bizsmtp id mxzd240055W9KJv01xzdoY; Wed, 31 Mar 2021 11:59:49 +0200 Received: from rox.of.borg ([192.168.97.57]) by ramsan.of.borg with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1lRXdQ-00BseR-AW; Wed, 31 Mar 2021 11:59:36 +0200 Received: from geert by rox.of.borg with local (Exim 4.93) (envelope-from ) id 1lRXBt-001bpk-Cn; Wed, 31 Mar 2021 11:31:09 +0200 From: Geert Uytterhoeven To: Joerg Roedel , Will Deacon , Steven Rostedt , Ingo Molnar , Petr Mladek , Sergey Senozhatsky Subject: [PATCH 2/3] tracing: Use pr_crit() instead of long fancy messages Date: Wed, 31 Mar 2021 11:31:03 +0200 Message-Id: <20210331093104.383705-3-geert+renesas@glider.be> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20210331093104.383705-1-geert+renesas@glider.be> References: <20210331093104.383705-1-geert+renesas@glider.be> MIME-Version: 1.0 Cc: Marco Elver , linux-embedded@vger.kernel.org, John Ogness , Gary R Hook , Randy Dunlap , Rasmus Villemoes , linux-kernel@vger.kernel.org, iommu@lists.linux-foundation.org, Geert Uytterhoeven , Andrew Morton , Andy Shevchenko , Linus Torvalds , Vlastimil Babka X-BeenThere: iommu@lists.linux-foundation.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: Development issues for Linux IOMMU support List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: iommu-bounces@lists.linux-foundation.org Sender: "iommu" While long fancy messages have a higher probability of being seen than small messages, they may scroll of the screen fast, if visible at all, and may still be missed. In addition, they increase boot time and kernel size. The correct mechanism to increase importance of a kernel message is not to draw fancy boxes with more text, but to shout louder, i.e. increase the message's reporting level. Making sure the administrator of the system is aware of such a message is a system policy, and is the responsability of a user-space log daemon. Fix this by increasing the reporting level from KERN_WARNING to KERN_CRIT, and removing irrelevant text and graphics. This reduces kernel size by ca. 0.5 KiB. Fixes: 2184db46e425c2b8 ("tracing: Print nasty banner when trace_printk() is in use") Signed-off-by: Geert Uytterhoeven --- kernel/trace/trace.c | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index eccb4e1187cc788e..b3a93aff01045923 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c @@ -3175,20 +3175,9 @@ void trace_printk_init_buffers(void) /* trace_printk() is for debug use only. Don't use it in production. */ - pr_warn("\n"); - pr_warn("**********************************************************\n"); - pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n"); - pr_warn("** **\n"); - pr_warn("** trace_printk() being used. Allocating extra memory. **\n"); - pr_warn("** **\n"); - pr_warn("** This means that this is a DEBUG kernel and it is **\n"); - pr_warn("** unsafe for production use. **\n"); - pr_warn("** **\n"); - pr_warn("** If you see this message and you are not debugging **\n"); - pr_warn("** the kernel, report this immediately to your vendor! **\n"); - pr_warn("** **\n"); - pr_warn("** NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE NOTICE **\n"); - pr_warn("**********************************************************\n"); + pr_crit("trace_printk() being used. Allocating extra memory.\n"); + pr_crit("This means that this is a DEBUG kernel and it is\n"); + pr_crit("unsafe for production use.\n"); /* Expand the buffers to set size */ tracing_update_buffers(); -- 2.25.1 _______________________________________________ iommu mailing list iommu@lists.linux-foundation.org https://lists.linuxfoundation.org/mailman/listinfo/iommu