Skip to content

Commit

Permalink
argo: define argo_dprintk for subsystem debugging
Browse files Browse the repository at this point in the history
A convenience for working on development of the argo subsystem:
setting a #define variable enables additional debug messages.

Signed-off-by: Christopher Clark <[email protected]>
Acked-by: Jan Beulich <[email protected]>
Reviewed-by: Roger Pau Monné <[email protected]>

===
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 xen-project#3 feedback, Jan: fix ifdef/define confusion error
v1 xen-project#4 feedback, Jan: fix dprintk implementation
  • Loading branch information
dozylynx authored and andyhhp committed Jan 15, 2019
1 parent 0a17259 commit 53cfe8a
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions xen/common/argo.c
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,15 @@
#include <xen/errno.h>
#include <xen/guest_access.h>

/* 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,
Expand Down

0 comments on commit 53cfe8a

Please sign in to comment.