[Libsysio-commit] HEAD: libsysio/include sysio-cmn.h
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2009-09-10 20:38:50
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv9553/include Modified Files: sysio-cmn.h Log Message: The biglock symbol was not being exported unless SYSIO_TRACING was defined. Moved it out of the dependent block and pulled SYSIO_{ENTER,LEAVE} out as well. Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 --- sysio-cmn.h 4 Feb 2009 20:07:23 -0000 1.21 +++ sysio-cmn.h 10 Sep 2009 20:38:39 -0000 1.22 @@ -271,12 +271,9 @@ extern void _sysio_run_trace_q(void *q, const char *fmt, ...); -extern mutex_t _sysio_biglock; - -/* Interface enter/leave hook functions */ -#define SYSIO_ENTER(tag, fmt, ...) \ +/* Trace enter/leave hook functions */ +#define _SYSIO_TRACE_ENTER(tag, fmt, ...) \ do { \ - mutex_lock(&_sysio_biglock); \ _sysio_run_trace_q(_sysio_entry_trace_q, \ __FILE__, __func__, __LINE__, \ SYSIO_TTAG(tag), \ @@ -284,23 +281,36 @@ extern mutex_t _sysio_biglock; __VA_ARGS__); \ } while (0) -#define SYSIO_LEAVE(tag, fmt, ...) \ +#define _SYSIO_TRACE_LEAVE(tag, fmt, ...) \ do { \ _sysio_run_trace_q(_sysio_exit_trace_q, \ __FILE__, __func__, __LINE__, \ SYSIO_TTAG(tag), \ (fmt), \ __VA_ARGS__); \ - mutex_unlock(&_sysio_biglock); \ } while (0) #else /* !defined(SYSIO_TRACING) */ -#define SYSIO_ENTER(tag, fmt, ...) \ +#define _SYSIO_TRACE_ENTER(tag, fmt, ...) \ do { } while (0) -#define SYSIO_LEAVE(tag, fmt, ...) \ +#define _SYSIO_TRACE_LEAVE(tag, fmt, ...) \ do { } while (0) #endif /* !defined(SYSIO_TRACING) */ +extern mutex_t _sysio_biglock; + +/* Interface enter/leave hook functions */ +#define SYSIO_ENTER(tag, fmt, ...) \ + do { \ + mutex_lock(&_sysio_biglock); \ + _SYSIO_TRACE_ENTER(tag, fmt, __VA_ARGS__); \ + } while (0) +#define SYSIO_LEAVE(tag, fmt, ...) \ + do { \ + _SYSIO_TRACE_LEAVE(tag, fmt, __VA_ARGS__); \ + mutex_unlock(&_sysio_biglock); \ + } while (0) + /* Accounting for IO stats; Read and write character count. */ #if defined(REDSTORM) #define _SYSIO_UPDACCT(w, cc) \ |