All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH userspace-rcu] Add --enable-debug-rcu to configure
@ 2017-01-20 23:10 Jonathan Rajotte
  0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Rajotte @ 2017-01-20 23:10 UTC (permalink / raw)
  To: lttng-dev

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

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@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

_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH userspace-rcu] Add --enable-debug-rcu to configure
       [not found] <1484953852-9597-1-git-send-email-jonathan.rajotte-julien@efficios.com>
@ 2017-01-21  2:44 ` Mathieu Desnoyers
  0 siblings, 0 replies; 2+ messages in thread
From: Mathieu Desnoyers @ 2017-01-21  2:44 UTC (permalink / raw)
  To: Jonathan Rajotte; +Cc: lttng-dev

----- On Jan 20, 2017, at 6:10 PM, Jonathan Rajotte jonathan.rajotte-julien@efficios.com wrote:

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

Does it add the define to the installed config.h urcu header ?

Applications still have to explicitly define DEBUG_RCU AFAIU.

It would be nice to put this into urcu/config.h system-wide, so
applications building against this generated header have the
debug behavior.

Thanks,

Mathieu

> 
> Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@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

-- 
Mathieu Desnoyers
EfficiOS Inc.
http://www.efficios.com
_______________________________________________
lttng-dev mailing list
lttng-dev@lists.lttng.org
https://lists.lttng.org/cgi-bin/mailman/listinfo/lttng-dev

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2017-01-21  2:45 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-01-20 23:10 [PATCH userspace-rcu] Add --enable-debug-rcu to configure Jonathan Rajotte
     [not found] <1484953852-9597-1-git-send-email-jonathan.rajotte-julien@efficios.com>
2017-01-21  2:44 ` Mathieu Desnoyers

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.