[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[PATCH v2 7/7] xen/console: simplify printouts in do_printk_ratelimit()


  • To: xen-devel@xxxxxxxxxxxxxxxxxxxx
  • From: dmukhin@xxxxxxxx
  • Date: Fri, 6 Feb 2026 12:24:24 -0800
  • Arc-authentication-results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 205.220.161.53) smtp.rcpttodomain=lists.xenproject.org smtp.mailfrom=ford.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=ford.com; dkim=pass (signature was verified) header.d=saarlouis.ford.com; dkim=pass (signature was verified) header.d=ford.com; arc=none (0)
  • Arc-message-signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=CR4hrbY+VQlJ/rgqLlCY9Cvf6nyLAYSOtoaaucI88Xs=; b=nNUQgZX7i2TrAGvFl1aJ6C4SLzHfdAxytpZflTIECymYc0IXX4ORtP5OyxX6Er8vLvQ0+oYuttAPMhHLx+NCburbFq13J7QqNis9OWRETgbBQJ6JKyty3Pp+02sbOU9hu8pSy0tW0Nva/04XBOP1knlnfM8VJZ6R1sFek2Kdsadz4SLcMieAwA6RXkBG42YyiNHn/ydm7a6XOxKwEXcc7pH5+R9AhFT3k7eSslMMbY4xkh4T57pmpQnbJR/Zf3+53AUpu1sVMqdSlawCQvhlqSrw+aMSntfn+3EU1ZU6lgG6GI1OsiB0REh2qCUr50Vj7w4uYA9gZgCnZpXQweiA+g==
  • Arc-seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=tM+TFsP3atkBMdZe8/c2ydtb7Hu4WXRQbNIyi+OZzBbiDOemy7VYel4jcX4INPCy+vzDLeYeVzH9QNZiDvd4b7fuA6KyQs9UHCWLuSml3NVX6whgGi0iS6Vk9rrsKWYGJLBMzZIin/smaEyw8KzQNcMRMcwIcWR7KEqJ+e6tYIY7P/GlkmOTGXHj7DQOq1Y7qy/6wSjB/islLQQXuQUX1Kj3ROGtti0qFjP359as2C1akrT5Om6xnSe4A8F7eD7xXv/a/vGJ9sSEgCYVWH2B/wyI4QFmQ5E6BEDLwb4p3vaM+LFH1wHOJPvhwvtwK3awHJyFiNOMki1T06wVIfrVGA==
  • Cc: andrew.cooper3@xxxxxxxxxx, anthony.perard@xxxxxxxxxx, jbeulich@xxxxxxxx, julien@xxxxxxx, michal.orzel@xxxxxxx, roger.pau@xxxxxxxxxx, sstabellini@xxxxxxxxxx, dmukhin@xxxxxxxx
  • Delivery-date: Fri, 06 Feb 2026 20:24:59 +0000
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>
  • Pser-m365-app: SER-APP

From: Denis Mukhin <dmukhin@xxxxxxxx> 

Simplify the code around notification of how many messages have been
rate-limited.

Not a functional change.

Signed-off-by: Denis Mukhin <dmukhin@xxxxxxxx>
---
Changes since v1:
- new patch
---
 xen/drivers/char/console.c | 10 +++++-----
 1 file changed, 5 insertions(+), 5 deletions(-)

diff --git a/xen/drivers/char/console.c b/xen/drivers/char/console.c
index 536b883d5dcf..a60a7c213555 100644
--- a/xen/drivers/char/console.c
+++ b/xen/drivers/char/console.c
@@ -1318,15 +1318,15 @@ static bool do_printk_ratelimit(unsigned int 
ratelimit_ms,
         spin_unlock(&ratelimit_lock);
         if ( lost )
         {
-            char lost_str[10];
+            char msg[40];
+
+            snprintf(msg, sizeof(msg),
+                     "printk: %u messages suppressed\n", lost);
 
-            snprintf(lost_str, sizeof(lost_str), "%u", lost);
             /* console_lock may already be acquired by printk(). */
             rspin_lock(&console_lock);
             printk_start_of_line(CONSOLE_PREFIX);
-            __putstr("printk: ");
-            __putstr(lost_str);
-            __putstr(" messages suppressed.\n");
+            __putstr(msg);
             rspin_unlock(&console_lock);
         }
         local_irq_restore(flags);
-- 
2.52.0




 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.