Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp270393pxf; Wed, 31 Mar 2021 03:02:50 -0700 (PDT) X-Google-Smtp-Source: ABdhPJy6AmEYNUQ5kTPLXCYHPmkfSsY5VoyE11KyTvsryz1nMnXjPp6ghKO+sF09MxXurqyao7gI X-Received: by 2002:a5d:6048:: with SMTP id j8mr2790112wrt.115.1617184970764; Wed, 31 Mar 2021 03:02:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1617184970; cv=none; d=google.com; s=arc-20160816; b=ZnAI0aNOg4cGKAaoIK3RxAZf9fDPUeoA81qbtjlAfEV9qZ4NYXZDB9dnvarrYIUVy/ I+v3cCgFtLeNkPHo3xtbar1jP4zEnsLrwUMAgqkxwPqiamaU8axNJ3d0q33CxGYOyO5w M0GIvzVYfugB1x1ZrOXSO2vYZtKHMtQqqhvCDq/Z7xPvCC2knhnFaPbwzCNUJSbI+GdH Ga62QaEYSgZ42Oqh4Tfzps9AVKuMPu0IVcrZ4s3A4F/OTY5jre8wBT68N3fYIeiEPYM8 wN0tPOxHfwOoNj4r5atmnrSXUZDQZCA1G/9qGcNgvFdI/vfwWKLIL8OSvBXRXmXJUOTa RLqw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from; bh=AAKAEEN9ckJ3xjzEsGFE1xAwOQLWuWcK6yE7OoGVodU=; b=GkdFt901fWJY8MsO8FEkMYMSbelB6xRf2iScsdgYcSocoGCeB0IhRUTuzXH7rfUm5k ZafQGHrSpSGTox2aRk3bDqCIBur+p9Bv4cP4MlmflWPI6TF1OOLlAr7TkUa3iVAUWjTf dwZ/SrV5ZG554GNxWQiUwVM0VUWbWErSk7E88gG+Fbzlbwwgm1Ijgg/hxQSzp9DOO0Vd hhvCQYKRY0VgxQccP0nmz12GO16yyt4boD+UVj5Yt1Y85Pl1aYjJTD+Tm4yuyI1yOppE YH0QFCkDIKMa8R6ispgcOqpL5G1JjPGFoVCIi35eXz9lPz4H2daDt68LcSXKkx+wm32L 48hA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-embedded-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-embedded-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id lr3si1444410ejb.215.2021.03.31.03.02.30; Wed, 31 Mar 2021 03:02:50 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-embedded-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-embedded-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-embedded-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235035AbhCaKA2 (ORCPT + 89 others); Wed, 31 Mar 2021 06:00:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:44040 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234982AbhCaJ7v (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 DF6DDC061574 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-embedded@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