summaryrefslogtreecommitdiffstats
path: root/pcilib/debug.h
diff options
context:
space:
mode:
Diffstat (limited to 'pcilib/debug.h')
-rw-r--r--pcilib/debug.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/pcilib/debug.h b/pcilib/debug.h
index bc68e1c..3ac0828 100644
--- a/pcilib/debug.h
+++ b/pcilib/debug.h
@@ -3,12 +3,14 @@
#include <stdarg.h>
#include <pcilib/env.h>
+#include <pcilib/error.h>
#define PCILIB_DEBUG
#ifdef PCILIB_DEBUG
# define PCILIB_DEBUG_DMA
# define PCILIB_DEBUG_MISSING_EVENTS
+# define PCILIB_DEBUG_VIEWS
#endif /* PCILIB_DEBUG */
@@ -28,6 +30,14 @@
# define PCILIB_DEBUG_MISSING_EVENTS_BUFFER(function, ...)
#endif /* PCILIB_DEBUG_MISSING_EVENTS */
+#ifdef PCILIB_DEBUG_VIEWS
+# define PCILIB_DEBUG_VIEWS_MESSAGE(function, ...) if (pcilib_getenv(function##_ENV, #function)) { pcilib_debug_message (#function, __FILE__, __LINE__, __VA_ARGS__); }
+# define PCILIB_DEBUG_VIEWS_BUFFER(function, ...) if (pcilib_getenv(function##_ENV #function)) { pcilib_debug_data_buffer (#function, __VA_ARGS__); }
+#else /* PCILIB_DEBUG_VIEWS */
+# define PCILIB_DEBUG_VIEWS_MESSAGE(function, ...)
+# define PCILIB_DEBUG_VIEWS_BUFFER(function, ...)
+#endif /* PCILIB_DEBUG_VIEWS */
+
#define pcilib_debug(function, ...) \
PCILIB_DEBUG_##function##_MESSAGE(PCILIB_DEBUG_##function, PCILIB_LOG_DEFAULT, __VA_ARGS__)