Add --enable-rcu-debug to configure
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH v2 1/1 Add --enable-rcu-debug to configure
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
@@ -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
@@ -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
@@ -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
@@ -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
@@ -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
A message that is not in the archive (sent off-list or not yet received): 1485199619-2506-1-git-send-email-jonathan.rajotte-julien@efficios.com
Mathieu Desnoyers
AppliedMerged 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_DEBUGtemplate tourcu/include.h.
ConsiderCONFIG_RCU_DEbuginurcu/debug.h. ConsiderCONFIG_RCU_DEBUGinsrc/urcu-qsbr.h.------
When used
CONFIG_RCU_DEBUGis defined inurcu/config.h,thus the debugging self-test are used at all time. This allow for a permanent built-in debugging behaviour.Signed-off-by Jonathan Rajotte <[email protected]>---
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@@ -358,12 +358,19 @@ can be forced by specifying `--disable-compiler-tls` asconfigure
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_YIELDconfigure.ac +0
-0@@ -26,6 +26,7 @@ AH_TEMPLATE([CONFIG_RCU_ARM_HAVE_DMB], [Use the dmbinstruction 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@@ -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_DEBUGinclude/urcu/debug.h +1
-1@@ -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@@ -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