[omniORB] Re: [PATCH] Add --disable-thread-tracing configure switch
Nathaniel Smith
njs@uclink4.berkeley.edu
Sat, 23 Mar 2002 21:15:43 -0800
--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
On Sat, Mar 23, 2002 at 09:13:42PM -0800, Nathaniel Smith wrote:
> I've been trying to keep parallel omniORB build trees, one with thread
> tracing turned on for testing, and one with thread tracing turned off
> for profiling. Modifying tracedthread.h before every build gets old
> fast, so here's a patch to add a --disable-thread-tracing option to
> configure. Basically, I just moved the OMNIORB_ENABLE_LOCK_TRACING
> #define to omniconfig.h, and added a macro to acinclude.m4 to handle
> the command line option. (For the moment it defaults to turning
> thread tracing on, but I've included (commented out) the code to
> make it default off, which should be useful for the release.)
>
> You have to run 'aclocal; autoheader; autoconf' after applying the
> patch to make it take effect.
>
> Tested with automake version 1.50 and autoconf 2.52 on Debian
> unstable.
Err, one more time, this time with the attachment attached...
-- Nathaniel
--
Damn the Solar System. Bad light; planets too distant; pestered with
comets; feeble contrivance; could make a better one myself.
-- Lord Jeffrey
This email may be read aloud.
--Kj7319i9nmIyA2yE
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="omni4-autoconf-thread-tracing.patch"
diff -urN --exclude=CVS omni-clean/acinclude.m4 omni-devel/acinclude.m4
--- omni-clean/acinclude.m4 Mon Feb 18 03:58:50 2002
+++ omni-devel/acinclude.m4 Sat Mar 23 20:42:51 2002
@@ -272,6 +272,26 @@
AC_SUBST(ENABLE_STATIC, $omni_cv_enable_static)
])
+# This defaults to enabled, and is appropriate for development
+# For the release, the obvious chunk below should be replaced with:
+# AC_HELP_STRING([--enable-thread-tracing],
+# [enable thread and mutex tracing (default disable-thread-tracing)]),
+# omni_cv_enable_thread_tracing=$enableval)
+# omni_cv_enable_thread_tracing=no)
+AC_DEFUN([OMNI_DISABLE_THREAD_TRACING],
+[AC_CACHE_CHECK(whether to trace threads and locking,
+omni_cv_enable_thread_tracing,
+[AC_ARG_ENABLE(thread-tracing,
+ AC_HELP_STRING([--disable-thread-tracing],
+ [disable thread and mutex tracing (default enable-thread-tracing)]),
+ omni_cv_enable_thread_tracing=$enableval,
+ omni_cv_enable_thread_tracing=yes)
+])
+if test "$omni_cv_enable_thread_tracing" = "yes"; then
+ AC_DEFINE(OMNIORB_ENABLE_LOCK_TRACES,,[define if you want mutexes to be traced])
+fi
+])
+
dnl
dnl Tests from http://www.gnu.org/software/ac-archive/
diff -urN --exclude=CVS omni-clean/configure.ac omni-devel/configure.ac
--- omni-clean/configure.ac Mon Feb 18 11:00:41 2002
+++ omni-devel/configure.ac Sat Mar 23 20:34:37 2002
@@ -85,6 +85,7 @@
OMNI_CONFIG_FILE
OMNI_OMNINAMES_LOGDIR
OMNI_DISABLE_STATIC
+OMNI_DISABLE_THREAD_TRACING
dnl ** Compiler name
diff -urN --exclude=CVS omni-clean/include/omniORB4/tracedthread.h omni-devel/include/omniORB4/tracedthread.h
--- omni-clean/include/omniORB4/tracedthread.h Mon Dec 3 10:47:39 2001
+++ omni-devel/include/omniORB4/tracedthread.h Sat Mar 23 20:53:33 2002
@@ -54,7 +54,10 @@
#define __OMNI_TRACEDTHREAD_H__
-#define OMNIORB_ENABLE_LOCK_TRACES
+// Lock tracing now controlled by autoconf
+#include <omniconfig.h>
+// Or override it here:
+// #define OMNIORB_ENABLE_LOCK_TRACES
//////////////////////////////////////////////////////////////////////
--Kj7319i9nmIyA2yE--