[lttng-dev] [PATCH userspace-rcu] Add --enable-debug-rcu to configure

Jonathan Rajotte jonathan.rajotte-julien at efficios.com
Fri Jan 20 23:10:52 UTC 2017


When used DEBUG_RCU is defined thus the debugging self-test are
included.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien at efficios.com>
---
 README.md    | 13 ++++++++-----
 configure.ac |  7 +++++++
 2 files changed, 15 insertions(+), 5 deletions(-)

diff --git a/README.md b/README.md
index 7ce0edf..a84d072 100644
--- a/README.md
+++ b/README.md
@@ -358,12 +358,15 @@ can be forced by specifying `--disable-compiler-tls` as configure
 argument.
 
 
-### Usage of `DEBUG_RCU`
+### `DEBUG_RCU`
 
-`DEBUG_RCU` is used to add internal debugging self-checks to the
-RCU library. This define adds a performance penalty when enabled.
-Can be enabled by uncommenting the corresponding line in
-`Makefile.build.inc`.
+By default the library is configured with internal debugging
+self-checks disabled. To enable them either, build with DEBUG_RCU
+or enable the option at configure time with:
+
+    ./configure --enable-debug-rcu
+
+Warning: Enabling this features result in a performance penalty.
 
 
 ### Usage of `DEBUG_YIELD`
diff --git a/configure.ac b/configure.ac
index 8ac0c41..6e75d5c 100644
--- a/configure.ac
+++ b/configure.ac
@@ -26,6 +26,7 @@ AH_TEMPLATE([CONFIG_RCU_ARM_HAVE_DMB], [Use the dmb instruction if available for
 AH_TEMPLATE([CONFIG_RCU_TLS], [TLS provided by the compiler.])
 AH_TEMPLATE([CONFIG_RCU_HAVE_CLOCK_GETTIME], [clock_gettime() is detected.])
 AH_TEMPLATE([CONFIG_RCU_FORCE_SYS_MEMBARRIER], [Require the operating system to support the membarrier system call for default and bulletproof flavors.])
+AH_TEMPLATE([DEBUG_RCU], [Enable internal debugging self-checks. Introduce performance penalty.])
 
 # Allow requiring the operating system to support the membarrier system
 # call. Applies to default and bulletproof flavors.
@@ -253,6 +254,12 @@ AC_ARG_ENABLE([smp-support],
 	[def_smp_support="yes"])
 AS_IF([test "x$def_smp_support" = "xyes"], [AC_DEFINE([CONFIG_RCU_SMP], [1])])
 
+AC_ARG_ENABLE([debug-rcu],
+      AS_HELP_STRING([--enable-debug-rcu], [Enable internal debugging
+		      self-checks. Introduce performance penalty.]))
+AS_IF([test "x$enable_debug_rcu" = "xyes"], [
+       AC_DEFINE([DEBUG_RCU], [1])
+])
 
 # From the sched_setaffinity(2)'s man page:
 # ~~~~
-- 
2.7.4



More information about the lttng-dev mailing list