summaryrefslogtreecommitdiffstats
path: root/include/debug.h
diff options
context:
space:
mode:
authorKarel Zak2014-03-21 12:04:12 +0100
committerKarel Zak2014-03-21 12:04:12 +0100
commite7b49879ad6ddb6a03f122916e5bcf7a1833deb2 (patch)
tree6a409c83c28f885cefdd13a536be4fbee985fe0e /include/debug.h
parentinclude/debug: fix coding style (diff)
downloadkernel-qcow2-util-linux-e7b49879ad6ddb6a03f122916e5bcf7a1833deb2.tar.gz
kernel-qcow2-util-linux-e7b49879ad6ddb6a03f122916e5bcf7a1833deb2.tar.xz
kernel-qcow2-util-linux-e7b49879ad6ddb6a03f122916e5bcf7a1833deb2.zip
include/debug: add another debug macros
Signed-off-by: Karel Zak <kzak@redhat.com>
Diffstat (limited to 'include/debug.h')
-rw-r--r--include/debug.h18
1 files changed, 17 insertions, 1 deletions
diff --git a/include/debug.h b/include/debug.h
index 069447967..2eb9d4421 100644
--- a/include/debug.h
+++ b/include/debug.h
@@ -16,7 +16,7 @@
#define UL_DEBUG_DEFINE_FLAG(p, m) p ## m
/* l - library name, p - flag prefix, m - flag postfix, x - function */
-# define __UL_DBG(l, p, m, x) \
+#define __UL_DBG(l, p, m, x) \
do { \
if ((p ## m) & l ## _debug_mask) { \
fprintf(stderr, "%d: %s: %8s: ", getpid(), # l, # m); \
@@ -24,6 +24,22 @@
} \
} while (0)
+#define __UL_DBG_CALL(l, p, m, x) \
+ do { \
+ if ((p ## m) & l ## _debug_mask) { \
+ x; \
+ } \
+ } while (0)
+
+#define __UL_DBG_FLUSH(l, p) \
+ do { \
+ if (l ## _debug_mask && \
+ l ## _debug_mask != p ## INIT) { \
+ fflush(stderr); \
+ } \
+ } while (0)
+
+
#define __UL_INIT_DEBUG(lib, pref, mask, env) \
do { \
if (lib ## _debug_mask & pref ## INIT) \