[CRIU] [RFC PATCH 14/21] zdtm: add pr_debug() macro in line with other pr_*

Ivan Shapovalov intelfx at intelfx.name
Fri Feb 19 06:50:37 PST 2016


Signed-off-by: Ivan Shapovalov <intelfx at intelfx.name>
---
 test/zdtm/lib/zdtmtst.h | 9 +++++++++
 1 file changed, 9 insertions(+)

diff --git a/test/zdtm/lib/zdtmtst.h b/test/zdtm/lib/zdtmtst.h
index 5ca1f31..37bc0e9 100644
--- a/test/zdtm/lib/zdtmtst.h
+++ b/test/zdtm/lib/zdtmtst.h
@@ -104,6 +104,15 @@ extern int parse_opt_string(char *param, void *arg);
 /* message helpers */
 extern int test_log_init(const char *outfile, const char *suffix);
 extern int zdtm_seccomp;
+
+#ifdef DEBUG
+#define pr_debug(format, arg...) \
+	test_msg("DBG: %s:%d: " format "\n", __FILE__, __LINE__, ## arg)
+#else
+#define pr_debug(format, arg...) \
+	do { } while (0)
+#endif
+
 #define pr_err(format, arg...) \
 	test_msg("ERR: %s:%d: " format, __FILE__, __LINE__, ## arg)
 #define pr_perror(format, arg...)	\
-- 
2.7.1



More information about the CRIU mailing list