[CRIU] [RFC PATCHv2 26/32] zdtm: lib: add pr_debug() macro in line with other pr_*

Ivan Shapovalov intelfx at intelfx.name
Sat Mar 12 00:42:25 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 506b2f4..57ebba2 100644
--- a/test/zdtm/lib/zdtmtst.h
+++ b/test/zdtm/lib/zdtmtst.h
@@ -106,6 +106,15 @@ extern int write_pidfile(int pid);
 /* 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.2



More information about the CRIU mailing list