Skip to contentSkip to conversation

Add --enable-rcu-debug to configure

PATCH New Jonathan Rajotte 2 participants 2 messages Jan 23, 2017 2 messages not in the archive

lore
Share & tools
lore
#1 lore raw

PATCH v2 1/1 Add --enable-rcu-debug to configure

In reply to a message not in the archive

v2: Added CONFIG_RCU_DEBUG template to urcu/include.h.
Consider CONFIG_RCU_DEbug in urcu/debug.h. Consider CONFIG_RCU_DEBUG in src/urcu-qsbr.h.

------

When used CONFIG_RCU_DEBUG is defined in urcu/config.h ,thus the debugging self-test are used at all time. This allow for a permanent built-in debugging behaviour.

---
 README.md                | 17 ++++++++++++-----
 configure.ac             |  8 ++++++++
 include/urcu/config.h.in |  4 ++++
 include/urcu/debug.h     |  2 +-
 src/urcu-qsbr.h          |  4 ++++
 5 files changed, 29 insertions(+), 6 deletions(-)
README.md +12 -5
index 7ce0edf..4615746 100644
@@ -358,12 +358,19 @@ can be forced by specifying `--disable-compiler-tls` as configure
 argument.
 
 
-### Usage of `DEBUG_RCU`
+### Usage of `DEBUG_RCU` & `--enable-rcu-debug`
 
-`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.
+
+For always-on debugging self-checks:
+	./configure --enable-rcu-debug
+
+For fine grained enabling of debugging self-checks, build
+urserspace-rcu with DEBUG_RCU defined and compile dependent
+applications with DEBUG_RCU defined when necessary.
+
+Warning: Enabling this feature result in a performance penalty.
 
 
 ### Usage of `DEBUG_YIELD`
configure.ac +8 -0
index 8ac0c41..dcbb61f 100644
@@ -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([CONFIG_RCU_DEBUG], [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,13 @@ AC_ARG_ENABLE([smp-support],
 	[def_smp_support="yes"])
 AS_IF([test "x$def_smp_support" = "xyes"], [AC_DEFINE([CONFIG_RCU_SMP], [1])])
 
+# RCU debugging option
+AC_ARG_ENABLE([rcu-debug],
+      AS_HELP_STRING([--enable-rcu-debug], [Enable internal debugging
+		      self-checks. Introduce performance penalty.]))
+AS_IF([test "x$enable_rcu_debug" = "xyes"], [
+       AC_DEFINE([CONFIG_RCU_DEBUG], [1])
+])
 
 # From the sched_setaffinity(2)'s man page:
 # ~~~~
include/urcu/config.h.in +4 -0
index bb128a1..9ed0454 100644
@@ -26,3 +26,7 @@
 /* Require the operating system to support the membarrier system call for
    default and bulletproof flavors. */
 #undef CONFIG_RCU_FORCE_SYS_MEMBARRIER
+
+/* Enable internal debugging self-checks.
+   Introduce performance penalty. */
+#undef CONFIG_RCU_DEBUG
include/urcu/debug.h +1 -1
index 327bd92..14b50b6 100644
@@ -21,7 +21,7 @@
 
 #include <assert.h>
 
-#ifdef DEBUG_RCU
+#if defined(DEBUG_RCU) || defined(CONFIG_RCU_DEBUG)
 #define urcu_assert(...)	assert(__VA_ARGS__)
 #else
 #define urcu_assert(...)
src/urcu-qsbr.h +4 -0
index bf17361..06c7064 100644
@@ -47,6 +47,10 @@ extern "C" {
 #define DEBUG_RCU
 #endif
 
+#ifdef CONFIG_RCU_DEBUG
+#define DEBUG_RCU
+#endif
+
 /*
  * Important !
  *
Signature · 6 lines
2.7.4

_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev
#3 lore raw
In reply to a message not in the archive

Merged into master with small changes to the urcu-qsbr.h modifications.

Thanks,

Mathieu

Quoted 120 lines · ----- On Jan 23, 2017, at 2:26 PM, Jonathan Rajotte…

v2: Added CONFIG_RCU_DEBUG template to urcu/include.h.
Consider CONFIG_RCU_DEbug in urcu/debug.h. Consider CONFIG_RCU_DEBUG in src/urcu-qsbr.h.

------

When used CONFIG_RCU_DEBUG is defined in urcu/config.h ,thus the debugging self-test are used at all time. This allow for a permanent built-in debugging behaviour.

---

README.md                | 17 ++++++++++++-----
configure.ac             |  8 ++++++++
include/urcu/config.h.in |  4 ++++
include/urcu/debug.h     |  2 +-
src/urcu-qsbr.h          |  4 ++++
5 files changed, 29 insertions(+), 6 deletions(-)
README.md +0 -0
index 7ce0edf..4615746 100644
@@ -358,12 +358,19 @@ can be forced by specifying `--disable-compiler-tls` as

configure
argument.

README.md +12 -5
-### Usage of `DEBUG_RCU`
+### Usage of `DEBUG_RCU` & `--enable-rcu-debug`
 
-`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.
+
+For always-on debugging self-checks:
+	./configure --enable-rcu-debug
+
+For fine grained enabling of debugging self-checks, build
+urserspace-rcu with DEBUG_RCU defined and compile dependent
+applications with DEBUG_RCU defined when necessary.
+
+Warning: Enabling this feature result in a performance penalty.

### Usage of DEBUG_YIELD

configure.ac +0 -0
index 8ac0c41..dcbb61f 100644
@@ -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([CONFIG_RCU_DEBUG], [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.
configure.ac +7 -0
@@ -253,6 +254,13 @@ AC_ARG_ENABLE([smp-support],
 	[def_smp_support="yes"])
 AS_IF([test "x$def_smp_support" = "xyes"], [AC_DEFINE([CONFIG_RCU_SMP], [1])])
 
+# RCU debugging option
+AC_ARG_ENABLE([rcu-debug],
+      AS_HELP_STRING([--enable-rcu-debug], [Enable internal debugging
+		      self-checks. Introduce performance penalty.]))
+AS_IF([test "x$enable_rcu_debug" = "xyes"], [
+       AC_DEFINE([CONFIG_RCU_DEBUG], [1])
+])
 
 # From the sched_setaffinity(2)'s man page:
 # ~~~~
include/urcu/config.h.in +4 -0
index bb128a1..9ed0454 100644
@@ -26,3 +26,7 @@
 /* Require the operating system to support the membarrier system call for
   default and bulletproof flavors. */
 #undef CONFIG_RCU_FORCE_SYS_MEMBARRIER
+
+/* Enable internal debugging self-checks.
+   Introduce performance penalty. */
+#undef CONFIG_RCU_DEBUG
include/urcu/debug.h +1 -1
index 327bd92..14b50b6 100644
@@ -21,7 +21,7 @@
 
 #include <assert.h>
 
-#ifdef DEBUG_RCU
+#if defined(DEBUG_RCU) || defined(CONFIG_RCU_DEBUG)
 #define urcu_assert(...)	assert(__VA_ARGS__)
 #else
 #define urcu_assert(...)
src/urcu-qsbr.h +4 -1
index bf17361..06c7064 100644
@@ -47,6 +47,10 @@ extern "C" {
 #define DEBUG_RCU
 #endif
 
+#ifdef CONFIG_RCU_DEBUG
+#define DEBUG_RCU
+#endif
+
 /*
 * Important !
 *
--

2.7.4

Signature · 7 lines
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
[email protected]
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev