From 53cfe8a1c2b1f76ac3043946c8fd85339dffeb7a Mon Sep 17 00:00:00 2001 From: Christopher Clark Date: Sun, 6 Jan 2019 21:05:41 -0800 Subject: [PATCH] argo: define argo_dprintk for subsystem debugging MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit A convenience for working on development of the argo subsystem: setting a #define variable enables additional debug messages. Signed-off-by: Christopher Clark Acked-by: Jan Beulich Reviewed-by: Roger Pau Monné === Jan's further remark given with the Ack: "This would better be an inline function, such that arguments passed in actually get evaluated. Otherwise you risk overlooking variables used for such logging only, and in particular the compiler then issuing warnings (breaking the build due to -Werror)." v3 added Roger's Reviewed-by v3 added Jan's Ack v2 #03 feedback, Jan: fix ifdef/define confusion error v1 #04 feedback, Jan: fix dprintk implementation --- xen/common/argo.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/xen/common/argo.c b/xen/common/argo.c index d69ad7c736cf..6f782f7e1f90 100644 --- a/xen/common/argo.c +++ b/xen/common/argo.c @@ -19,6 +19,15 @@ #include #include +/* 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 + long do_argo_op(unsigned int cmd, XEN_GUEST_HANDLE_PARAM(void) arg1, XEN_GUEST_HANDLE_PARAM(void) arg2, unsigned long arg3,