summaryrefslogtreecommitdiff
path: root/configure.ac
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-12-12 17:57:22 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-12-13 00:46:16 +0100
commitfad5a6c66e73d3df20846906121d52159e1f6bf4 (patch)
tree205cd89c4ee6a9185cbff630afe1dd3238056940 /configure.ac
parentfc86aa0ed204922dcafa85353cb10e1aa7d91a76 (diff)
journal: add debug mode for mmap-cache (--enable-debug=mmap-cache)
This is useful for exposing unsafe access to mmapped objects after the context that they were mapped in was already moved. For example: journal_file_move_to_object(f1, OBJECT_DATA, p1, &o1); journal_file_move_to_object(f2, OBJECT_DATA, p2, &o2); t = o1->object.type; /* this usually works, but is unsafe */
Diffstat (limited to 'configure.ac')
-rw-r--r--configure.ac10
1 files changed, 8 insertions, 2 deletions
diff --git a/configure.ac b/configure.ac
index ea74fcd16a..e14f3cfe68 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1328,9 +1328,9 @@ AC_ARG_ENABLE(tests,
AM_CONDITIONAL(ENABLE_TESTS, [test x$enable_tests = xyes])
AC_ARG_ENABLE(debug,
- [AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (hashmap)])],
+ [AC_HELP_STRING([--enable-debug@<:@=LIST@:>@], [enable extra debugging (hashmap,mmap-cache)])],
[if test "x$enableval" = "xyes"; then
- enableval="hashmap"
+ enableval="hashmap,mmap-cache"
fi
saved_ifs="$IFS"
IFS="$IFS$PATH_SEPARATOR,"
@@ -1339,6 +1339,9 @@ AC_ARG_ENABLE(debug,
hashmap)
enable_debug_hashmap=yes
;;
+ mmap-cache)
+ enable_debug_mmap_cache=yes
+ ;;
esac
done
IFS="$saved_ifs"],[])
@@ -1348,6 +1351,9 @@ AS_IF([test x$enable_debug_hashmap = xyes], [
AC_DEFINE(ENABLE_DEBUG_HASHMAP, 1, [Define if hashmap debugging is to be enabled])
enable_debug="hashmap $enable_debug"
])
+AS_IF([test x$enable_debug_mmap_cache = xyes], [
+ AC_DEFINE(ENABLE_DEBUG_MMAP_CACHE, 1, [Define if mmap cache debugging is to be enabled])
+ enable_debug="mmap-cache $enable_debug"
])
test -z "$enable_debug" && enable_debug="none"