aboutsummaryrefslogtreecommitdiffstats
path: root/config/zfs-build.m4
diff options
context:
space:
mode:
authorBrian Behlendorf <behlendorf1@llnl.gov>2012-03-20 16:00:17 -0700
committerBrian Behlendorf <behlendorf1@llnl.gov>2012-03-23 12:25:17 -0700
commit1c5de20ae2511124613926e4f780572634818218 (patch)
tree66e14fa7c95491068117fa977b7c3fd38dd4c315 /config/zfs-build.m4
parent99ea23c583b272470a21e0ac7caa1f485f6b1125 (diff)
Add --enable-debug-dmu-tx configure option
Allow rigorous (and expensive) tx validation to be enabled/disabled indepentantly from the standard zfs debugging. When enabled these checks ensure that all txs are constructed properly and that a dbuf is never dirtied without taking the correct tx hold. This checking is particularly helpful when adding new dmu consumers like Lustre. However, for established consumers such as the zpl with no known outstanding tx construction problems this is just overhead. --enable-debug-dmu-tx - Enable/disable validation of each tx as --disable-debug-dmu-tx it is constructed. By default validation is disabled due to performance concerns. Signed-off-by: Brian Behlendorf <behlendorf1@llnl.gov>
Diffstat (limited to 'config/zfs-build.m4')
-rw-r--r--config/zfs-build.m423
1 files changed, 23 insertions, 0 deletions
diff --git a/config/zfs-build.m4 b/config/zfs-build.m4
index c5983d3c3..6bfea5195 100644
--- a/config/zfs-build.m4
+++ b/config/zfs-build.m4
@@ -37,6 +37,29 @@ AC_DEFUN([ZFS_AC_DEBUG], [
AC_MSG_RESULT([$enable_debug])
])
+AC_DEFUN([ZFS_AC_DEBUG_DMU_TX], [
+ AC_ARG_ENABLE([debug-dmu-tx],
+ [AS_HELP_STRING([--enable-debug-dmu-tx],
+ [Enable dmu tx validation @<:@default=no@:>@])],
+ [],
+ [enable_debug_dmu_tx=no])
+
+ AS_IF([test "x$enable_debug_dmu_tx" = xyes],
+ [
+ KERNELCPPFLAGS="${KERNELCPPFLAGS} -DDEBUG_DMU_TX"
+ DEBUG_DMU_TX="_with_debug_dmu_tx"
+ AC_DEFINE([DEBUG_DMU_TX], [1],
+ [Define to 1 to enabled dmu tx validation])
+ ],
+ [
+ DEBUG_DMU_TX="_without_debug_dmu_tx"
+ ])
+
+ AC_SUBST(DEBUG_DMU_TX)
+ AC_MSG_CHECKING([whether dmu tx validation is enabled])
+ AC_MSG_RESULT([$enable_debug_dmu_tx])
+])
+
AC_DEFUN([ZFS_AC_CONFIG_ALWAYS], [
ZFS_AC_CONFIG_ALWAYS_NO_UNUSED_BUT_SET_VARIABLE
])