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

[PATCH] argo: Fixes to argo_dprintk()


  • To: Xen-devel <xen-devel@xxxxxxxxxxxxxxxxxxxx>
  • From: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
  • Date: Fri, 14 Oct 2022 15:02:21 +0100
  • Authentication-results: esa3.hc3370-68.iphmx.com; dkim=none (message not signed) header.i=none
  • Cc: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>, Jason Andryuk <jandryuk@xxxxxxxxx>, Christopher Clark <christopher.w.clark@xxxxxxxxx>
  • Delivery-date: Fri, 14 Oct 2022 14:03:13 +0000
  • Ironport-data: A9a23:Jo/s06K6QYRDr6m/FE+R9ZUlxSXFcZb7ZxGr2PjKsXjdYENS1WZTz 2MYWTuDM/yONzP8KdEnb9y18RwFvMeBx9YyGQVlqX01Q3x08seUXt7xwmUcnc+xBpaaEB84t ZV2hv3odp1coqr0/0/1WlTZhSAgk/vOHtIQMcacUghpXwhoVSw9vhxqnu89k+ZAjMOwRgiAo rsemeWGULOe82MyYz98B56r8ks15q2q4W9A5DTSWNgQ1LPgvyhNZH4gDfnZw0vQGuF8AuO8T uDf+7C1lkuxE8AFU47Nfh7TKyXmc5aKVeS8oiM+t5uK23CukhcawKcjXMfwXG8M49m/c3Kd/ /0W3XC4YV9B0qQhA43xWTEAe811FfUuFLMqvRFTGCFcpqHLWyKE/hlgMK05FbMp6OtyI01lz vM/BAIMRR+ut9mp/IvuH4GAhux7RCXqFIYWu3UmxjDFF/c2B5vERs0m5/cBgm123JoXW6+DO YxJMlKDbzyZC/FLEn4RBIgzg6GDgX7nficDgFmUubA28y7YywkZPL3FYICKIYHSHJo9ckCw+ Wb48k/8EhgmKcWU8hSJ0mOivtbSpHauMG4VPOLhraM76LGJ/UQYCAcXTke8ufm0kAihHdlbI lYX0iUrpKk2skesS7HVXRS+rGSVox00VN9ZEul84waIooLE7gDcCmUaQzppbN09qNRwVTEsz kWOnd7iGXpoqrL9dJ6G3u7K93XoY3FTdDJcI39fJecY3zX9iL8CnB/KbPpIK6GSou/0Mj7d8 wuVkBFr0t3/kvU3/6m8+FnGhRelqZ7IUhM5623rY4610u9qTNX7PtL1sDA3+d4Fdd/EFQfZ4 BDojuDEtIgz4YexeDthqQnnNJWg/L67PTLVmjaD9LFxpm32qxZPkW29iQySxXuF0O5eJFcFg 2eJ42u9AaO/21PzNMdKj3qZUZhC8EQZPY2NugroRtRPeINtUwSM4TtjY0Wdt0i0zhZxz/FhZ c7ALJv0ZZr/NUiA5GPsL9rxLJdxnnxurY8tbcqTI+ubPUq2OyfOFOZt3KqmZeEl9qKUyDjoH yJkH5LSkX13CbSmCgGOqN57ELz/BSVibXwAg5cMLbDrz8sPMDxJNsI9Npt4K9A7wfoKzb2Tl px/M2cBoGfCabT8AV3iQhhehHnHBP6TcVpT0fQQAGuV
  • Ironport-hdrordr: A9a23:4YA7bq+6hezIds8hRRpuk+DQI+orL9Y04lQ7vn2YSXRuE/Bw9v re+sjzuiWE6wr5NEtOpTniAtjmfZq/z+8W3WB5B97LN2OK1FdARLsSibcKqAeBJ8SRzIBgPN 9bAs1DNOE=
  • List-id: Xen developer discussion <xen-devel.lists.xenproject.org>

Rewrite argo_dprintk() so printk() format typechecking can always be
performed.  This also fixes the evaluation of parameters.  Emit the messages
at XENLOG_DEBUG.

Signed-off-by: Andrew Cooper <andrew.cooper3@xxxxxxxxxx>
---
CC: Jason Andryuk <jandryuk@xxxxxxxxx>
CC: Christopher Clark <christopher.w.clark@xxxxxxxxx>
---
 xen/common/argo.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/xen/common/argo.c b/xen/common/argo.c
index 9ad2ecaa1e42..f29fa720fc48 100644
--- a/xen/common/argo.c
+++ b/xen/common/argo.c
@@ -313,14 +313,12 @@ static DEFINE_RWLOCK(L1_global_argo_rwlock); /* L1 */
     ((LOCKING_Read_L1 && spin_is_locked(&(d)->argo->send_L2_lock)) || \
      LOCKING_Write_L1)
 
-/* Change this to #define ARGO_DEBUG here to enable more debug messages */
-#undef ARGO_DEBUG
-
-#ifdef ARGO_DEBUG
-#define argo_dprintk(format, args...) printk("argo: " format, ## args )
-#else
-#define argo_dprintk(format, ... ) ((void)0)
-#endif
+#define ARGO_DEBUG 0
+#define argo_dprintk(fmt, args...)                      \
+    do {                                                \
+        if ( ARGO_DEBUG )                               \
+            printk(XENLOG_DEBUG "argo: " fmt, ##args);  \
+    } while ( 0 )
 
 /*
  * This hash function is used to distribute rings within the per-domain
-- 
2.11.0




 


Rackspace

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