Thread: [Libsysio-commit] HEAD: libsysio/include sysio-cmn.h
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2005-01-24 20:03:58
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29919 Modified Files: sysio-cmn.h Log Message: Wrapped SYSIO_LABEL_NAMES with an ifndef so that it can be overridden at compile time. Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- sysio-cmn.h 19 Nov 2004 17:49:53 -0000 1.3 +++ sysio-cmn.h 24 Jan 2005 20:03:27 -0000 1.4 @@ -94,7 +94,9 @@ struct iovec; */ #define XPREPEND(p,x) p ## x #define PREPEND(p,x) XPREPEND(p,x) +#ifndef SYSIO_LABEL_NAMES #define SYSIO_LABEL_NAMES 0 +#endif #if SYSIO_LABEL_NAMES #define SYSIO_INTERFACE_NAME(x) PREPEND(sysio__, x) #else |
From: Lee W. <lw...@us...> - 2005-09-15 21:31:47
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv19135/include Modified Files: sysio-cmn.h Log Message: Support user-defined entry/exit callbacks and switch existing trace-print support to the new mechanism. Introduces: _sysio_entry_trace_q and _sysio_exit_trace_q; pointers to the 2 callback queues. _sysio_register_trace; To register a callback _sysio_remove_trace; To remove a previously registered callback _sysio_run_trace_q; To execute the callbacks in a trace queue. Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.5 retrieving revision 1.6 diff -u -w -b -B -p -r1.5 -r1.6 --- sysio-cmn.h 25 Jan 2005 00:37:07 -0000 1.5 +++ sysio-cmn.h 15 Sep 2005 21:31:38 -0000 1.6 @@ -9,7 +9,7 @@ * terms of the GNU Lesser General Public License * (see cit/LGPL or http://www.gnu.org/licenses/lgpl.html) * - * Cplant(TM) Copyright 1998-2004 Sandia Corporation. + * Cplant(TM) Copyright 1998-2005 Sandia Corporation. * Under the terms of Contract DE-AC04-94AL85000, there is a non-exclusive * license for use of this work by or on behalf of the US Government. * Export of this program may require a license from the United States @@ -152,15 +152,35 @@ struct iovec; #if SYSIO_TRACING extern int _sysio_tracing; +extern void *_sysio_entry_trace_q; +extern void *_sysio_exit_trace_q; + +extern void *_sysio_register_trace(void *q, + void (*)(const char *file, + const char *func, + int line)); +extern void _sysio_remove_trace(void *q, void *p); +extern void _sysio_run_trace_q(void *q, + const char *file, + const char *func, + int line); #define SYSIO_ENTER \ - if (_sysio_tracing) _sysio_cprintf("+ENTER+ %s\n", __func__) + do { \ + _sysio_run_trace_q(_sysio_entry_trace_q, \ + __FILE__, __func__, __LINE__); \ + } while (0) + #define SYSIO_LEAVE \ - if (_sysio_tracing) _sysio_cprintf("+LEAVE+ %s\n", __func__) + do { \ + _sysio_run_trace_q(_sysio_exit_trace_q, \ + __FILE__, __func__, __LINE__); \ + } while (0) #else -#define SYSIO_ENTER -#define SYSIO_LEAVE - +#define SYSIO_ENTER \ + do { } while (0) +#define SYSIO_LEAVE \ + do { } while (0) #endif /* accounting for IO stats read and write char count */ |
From: Lee W. <lw...@us...> - 2005-09-15 21:46:32
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23070/include Modified Files: sysio-cmn.h Log Message: Oops. forgot to remove the old _sysio_tracing global declaration. Fixed. Added a bunch of comments. Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.6 retrieving revision 1.7 diff -u -w -b -B -p -r1.6 -r1.7 --- sysio-cmn.h 15 Sep 2005 21:31:38 -0000 1.6 +++ sysio-cmn.h 15 Sep 2005 21:46:23 -0000 1.7 @@ -150,8 +150,6 @@ struct iovec; /* Interface enter/leave hook functions */ #if SYSIO_TRACING -extern int _sysio_tracing; - extern void *_sysio_entry_trace_q; extern void *_sysio_exit_trace_q; |
From: Lee W. <lw...@us...> - 2005-10-19 19:31:07
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3658/include Modified Files: sysio-cmn.h Log Message: Merge in with-alternate-symbols modifications from LLNL_HPSS branch. This allows prepending public symbols with something other than "sysio_". However, the changes are backward compatible. I.e., the default is still to use "sysio_". Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -w -b -B -p -r1.7 -r1.8 --- sysio-cmn.h 15 Sep 2005 21:46:23 -0000 1.7 +++ sysio-cmn.h 19 Oct 2005 19:30:56 -0000 1.8 @@ -92,13 +92,13 @@ struct iovec; /* * SYSIO name label macros */ -#define XPREPEND(p,x) p ## x -#define PREPEND(p,x) XPREPEND(p,x) -#ifndef SYSIO_LABEL_NAMES -#define SYSIO_LABEL_NAMES 0 -#endif -#if SYSIO_LABEL_NAMES -#define SYSIO_INTERFACE_NAME(x) PREPEND(sysio_, x) +#ifdef SYSIO_LABEL_NAMES +#define _PREPEND_HELPER(p, x) \ + p ## x +#define PREPEND(p, x) \ + _PREPEND_HELPER(p, x) +#define SYSIO_INTERFACE_NAME(x) \ + PREPEND(SYSIO_LABEL_NAMES, x) #else #define SYSIO_INTERFACE_NAME(x) x #endif |
From: Lee W. <lw...@us...> - 2006-01-05 15:27:38
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12551 Modified Files: sysio-cmn.h Log Message: The PREPEND macro needs to be defined always in order to support compilation without alternate-symbols set. From Oleg Drokin at Cluster FS. Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- sysio-cmn.h 19 Oct 2005 19:30:56 -0000 1.8 +++ sysio-cmn.h 5 Jan 2006 15:27:31 -0000 1.9 @@ -90,13 +90,17 @@ struct intnl_xtvec; struct iovec; /* - * SYSIO name label macros + * Symbol composition. */ -#ifdef SYSIO_LABEL_NAMES #define _PREPEND_HELPER(p, x) \ p ## x #define PREPEND(p, x) \ _PREPEND_HELPER(p, x) + +/* + * SYSIO name label macros + */ +#ifdef SYSIO_LABEL_NAMES #define SYSIO_INTERFACE_NAME(x) \ PREPEND(SYSIO_LABEL_NAMES, x) #else |
From: Lee W. <lw...@us...> - 2006-02-27 17:26:58
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21374/include Modified Files: sysio-cmn.h Log Message: Tracing now can reference user-supplied data. The callbacks are supplied the data pointer originally given at registration. A destructor, given at registration, is called with a copy of the user-supplied data pointer when the the trace remove function is invoked if it wasn't NULL. Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- sysio-cmn.h 5 Jan 2006 15:27:31 -0000 1.9 +++ sysio-cmn.h 27 Feb 2006 17:26:55 -0000 1.10 @@ -160,7 +160,10 @@ extern void *_sysio_exit_trace_q; extern void *_sysio_register_trace(void *q, void (*)(const char *file, const char *func, - int line)); + int line, + void *data), + void *data, + void (*destructor)(void *data)); extern void _sysio_remove_trace(void *q, void *p); extern void _sysio_run_trace_q(void *q, const char *file, |
From: Lee W. <lw...@us...> - 2007-02-14 18:50:24
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv22001 Modified Files: sysio-cmn.h Log Message: Bug fix from "Miles" at Cray; Reversed the test to order the read and write bytes transferred arguments to _add_iostats(). Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.11 retrieving revision 1.12 diff -u -w -b -B -p -r1.11 -r1.12 --- sysio-cmn.h 3 May 2006 22:34:46 -0000 1.11 +++ sysio-cmn.h 14 Feb 2007 18:50:17 -0000 1.12 @@ -188,13 +188,13 @@ extern void _sysio_run_trace_q(void *q, do { } while (0) #endif -/* accounting for IO stats read and write char count */ +/* Accounting for IO stats; Read and write character count. */ #if defined(REDSTORM) #define _SYSIO_UPDACCT(w, cc) \ do { \ if ((cc) < 0) \ break; \ - if (!w) \ + if (w) \ _add_iostats(0, (size_t )(cc)); \ else \ _add_iostats((size_t )(cc), 0); \ |
From: Lee W. <lw...@us...> - 2007-07-02 18:58:48
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18012/include Modified Files: sysio-cmn.h Log Message: Altered tracing support to include a format now. Re-introducing _HAVE_STATVFS6 for binary compatibility. Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- sysio-cmn.h 9 May 2007 23:16:20 -0000 1.16 +++ sysio-cmn.h 2 Jul 2007 18:58:15 -0000 1.17 @@ -133,78 +133,81 @@ struct iovec; */ #define SYSIO_INTERFACE_DISPLAY_BLOCK \ int _saved_errno; -#define SYSIO_INTERFACE_ENTER(tag, ...) \ +#define SYSIO_INTERFACE_ENTER(tag, fmt, ...) \ do { \ _saved_errno = errno; \ - SYSIO_ENTER(tag, __VA_ARGS__); \ + SYSIO_ENTER(tag, (fmt), __VA_ARGS__); \ } while (0) -#define SYSIO_INTERFACE_RETURN(rtn, err, tag, ...) \ +#define SYSIO_INTERFACE_RETURN(rtn, err, tag, fmt, ...) \ do { \ - SYSIO_LEAVE(tag, (rtn), (err), __VA_ARGS__); \ + SYSIO_LEAVE(tag, (fmt), (err), (rtn), __VA_ARGS__); \ errno = (err) ? -(err) : _saved_errno; \ return (rtn); \ } while(0) -/* Interface enter/leave hook functions */ #ifdef SYSIO_TRACING -#define _SYSIO_TTAG(name) \ +#define SYSIO_TTAG(name) \ PREPEND(_SYSIO_TRACING_, name) /* * Supported tracing tags. */ typedef enum { - _SYSIO_TTAG(unsupported) = -1, - _SYSIO_TTAG(access), - _SYSIO_TTAG(chdir), - _SYSIO_TTAG(getcwd), - _SYSIO_TTAG(chmod), - _SYSIO_TTAG(fchmod), - _SYSIO_TTAG(chown), - _SYSIO_TTAG(fchown), - _SYSIO_TTAG(dup2), - _SYSIO_TTAG(dup), - _SYSIO_TTAG(vfcntl), - _SYSIO_TTAG(fsync), - _SYSIO_TTAG(fdatasync), - _SYSIO_TTAG(getdirentries64), - _SYSIO_TTAG(getdirentries), - _SYSIO_TTAG(ioctl), - _SYSIO_TTAG(iodone), - _SYSIO_TTAG(iowait), - _SYSIO_TTAG(link), - _SYSIO_TTAG(lseek64), - _SYSIO_TTAG(lseek), - _SYSIO_TTAG(llseek), - _SYSIO_TTAG(mkdir), - _SYSIO_TTAG(xmknod), - _SYSIO_TTAG(mount), - _SYSIO_TTAG(umount), - _SYSIO_TTAG(open), - _SYSIO_TTAG(close), - _SYSIO_TTAG(ireadx), - _SYSIO_TTAG(iwritex), - _SYSIO_TTAG(ireadv), - _SYSIO_TTAG(iwritev), - _SYSIO_TTAG(rename), - _SYSIO_TTAG(rmdir), - _SYSIO_TTAG(xstatnd), - _SYSIO_TTAG(fxstat), -#ifdef _HAVE_STATVFS - _SYSIO_TTAG(statvfs64), - _SYSIO_TTAG(fstatvfs64), - _SYSIO_TTAG(statvfs), - _SYSIO_TTAG(fstatvfs), + SYSIO_TTAG(unsupported) = -1, + SYSIO_TTAG(access), + SYSIO_TTAG(chdir), + SYSIO_TTAG(getcwd), + SYSIO_TTAG(chmod), + SYSIO_TTAG(fchmod), + SYSIO_TTAG(chown), + SYSIO_TTAG(fchown), + SYSIO_TTAG(dup2), + SYSIO_TTAG(dup), + SYSIO_TTAG(vfcntl), + SYSIO_TTAG(fsync), + SYSIO_TTAG(fdatasync), + SYSIO_TTAG(getdirentries), +#ifdef _LARGEFILE64_SOURCE + SYSIO_TTAG(getdirentries64), +#endif + SYSIO_TTAG(ioctl), + SYSIO_TTAG(iodone), + SYSIO_TTAG(iowait), + SYSIO_TTAG(link), + SYSIO_TTAG(lseek), +#ifdef _LARGEFILE64_SOURCE + SYSIO_TTAG(lseek64), #endif - _SYSIO_TTAG(opendir), - _SYSIO_TTAG(closedir), - _SYSIO_TTAG(symlink), - _SYSIO_TTAG(readlink), - _SYSIO_TTAG(truncate), - _SYSIO_TTAG(ftruncate), - _SYSIO_TTAG(unlink), - _SYSIO_TTAG(utime), + SYSIO_TTAG(llseek), + SYSIO_TTAG(mkdir), + SYSIO_TTAG(xmknod), + SYSIO_TTAG(mount), + SYSIO_TTAG(umount), + SYSIO_TTAG(open), + SYSIO_TTAG(close), + SYSIO_TTAG(ireadx), + SYSIO_TTAG(iwritex), + SYSIO_TTAG(ireadv), + SYSIO_TTAG(iwritev), + SYSIO_TTAG(rename), + SYSIO_TTAG(rmdir), + SYSIO_TTAG(xstatnd), + SYSIO_TTAG(fxstat), + SYSIO_TTAG(statvfs), + SYSIO_TTAG(fstatvfs), +#ifdef _LARGEFILE64_SOURCE + SYSIO_TTAG(statvfs64), + SYSIO_TTAG(fstatvfs64), +#endif + SYSIO_TTAG(opendir), + SYSIO_TTAG(closedir), + SYSIO_TTAG(symlink), + SYSIO_TTAG(readlink), + SYSIO_TTAG(truncate), + SYSIO_TTAG(ftruncate), + SYSIO_TTAG(unlink), + SYSIO_TTAG(utime), } tracing_tag; extern void *_sysio_entry_trace_q; @@ -216,6 +219,7 @@ extern void *_sysio_register_trace(void int line, void *data, tracing_tag tag, + const char *fmt, va_list ap), void *data, void (*destructor)(void *data)); @@ -225,30 +229,36 @@ extern void _sysio_run_trace_q(void *q, const char *func, int line, tracing_tag tag, + const char *fmt, ...); -#define SYSIO_ENTER(tag, ...) \ +/* Interface enter/leave hook functions */ +#define SYSIO_ENTER(tag, fmt, ...) \ do { \ _sysio_run_trace_q(_sysio_entry_trace_q, \ __FILE__, __func__, __LINE__, \ - _SYSIO_TTAG(tag), \ + SYSIO_TTAG(tag), \ + (fmt), \ __VA_ARGS__); \ } while (0) - -#define SYSIO_LEAVE(tag, ...) \ +#define SYSIO_LEAVE(tag, fmt, ...) \ do { \ _sysio_run_trace_q(_sysio_exit_trace_q, \ __FILE__, __func__, __LINE__, \ - _SYSIO_TTAG(tag), \ + SYSIO_TTAG(tag), \ + (fmt), \ __VA_ARGS__); \ } while (0) -#else -#define SYSIO_ENTER(tag, ...) \ + +extern int _sysio_trace_dump_start(const char *dirpath); +extern void _sysio_trace_dump_stop(void); +#else /* !defined(SYSIO_TRACING) */ +#define SYSIO_ENTER(tag, fmt, ...) \ do { } while (0) -#define SYSIO_LEAVE(tag, ...) \ +#define SYSIO_LEAVE(tag, fmt, ...) \ do { } while (0) -#endif +#endif /* !defined(SYSIO_TRACING) */ /* Accounting for IO stats; Read and write character count. */ #if defined(REDSTORM) |
From: Lee W. <lw...@us...> - 2007-08-20 19:12:12
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv15038/include Modified Files: sysio-cmn.h Log Message: Split tracing support out. Added an initializer queue so that trace functionality may be added external to this library. to use it, register your initializer function with _sysio_register_trace using the _sysio_initializer_trace_q. Only the "func" argument is valid when the pseudo-event is called from _sysio_boot_trace. You might want to remove your initializer event from the initializer queue once called, unless it's ok to call it more than once. Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- sysio-cmn.h 2 Jul 2007 18:58:15 -0000 1.17 +++ sysio-cmn.h 20 Aug 2007 19:12:08 -0000 1.18 @@ -210,9 +210,13 @@ typedef enum { SYSIO_TTAG(utime), } tracing_tag; +extern void *_sysio_initializer_trace_q; extern void *_sysio_entry_trace_q; extern void *_sysio_exit_trace_q; +extern int _sysio_trace_init(void); +extern void _sysio_trace_shutdown(void); + extern void *_sysio_register_trace(void *q, void (*)(const char *file, const char *func, @@ -251,8 +255,6 @@ extern void _sysio_run_trace_q(void *q, __VA_ARGS__); \ } while (0) -extern int _sysio_trace_dump_start(const char *dirpath); -extern void _sysio_trace_dump_stop(void); #else /* !defined(SYSIO_TRACING) */ #define SYSIO_ENTER(tag, fmt, ...) \ do { } while (0) |
From: Lee W. <lw...@us...> - 2007-09-21 19:37:03
|
Update of /cvsroot/libsysio/libsysio/include In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv355/include Modified Files: sysio-cmn.h Log Message: Oops. Need to add changes supporting CONTAINER macro for the new tree abstraction support. Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.18 retrieving revision 1.19 diff -u -w -b -B -p -r1.18 -r1.19 --- sysio-cmn.h 20 Aug 2007 19:12:08 -0000 1.18 +++ sysio-cmn.h 21 Sep 2007 19:36:59 -0000 1.19 @@ -83,6 +83,18 @@ struct intnl_xtvec; struct iovec; /* + * Return offset to given member of given structure or union. + */ +#define OFFSETOF(type, _mbr) \ + ((size_t )&((struct type *)0)->_mbr) + +/* + * Return ptr to record containing the passed member. + */ +#define CONTAINER(type, _mbr, ptr) \ + (struct type *)((ptrdiff_t )(ptr) - OFFSETOF(type, _mbr)) + +/* * Symbol composition. */ #define _PREPEND_HELPER(p, x) \ |
From: Lee W. <lw...@us...> - 2009-02-04 20:07:29
|
Update of /cvsroot/libsysio/libsysio/include In directory ddv4jf1.ch3.sourceforge.com:/tmp/cvs-serv1058/include Modified Files: sysio-cmn.h Log Message: A new API, built when --with-file-handle-interface is set to yes, is available with this deposit. The API allows operation by handles derived from exported volumes. At this point, it's not incredibly well tested. What is tested is the export/unexport functionality and the root_of, lookup, and stat functions. Hopefully, this will mature quickly. Not yet included is the ability to use credentials other than the caller's from it's process credentials. That ability should be here soon. Index: sysio-cmn.h =================================================================== RCS file: /cvsroot/libsysio/libsysio/include/sysio-cmn.h,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- sysio-cmn.h 17 Jun 2008 17:18:57 -0000 1.20 +++ sysio-cmn.h 4 Feb 2009 20:07:23 -0000 1.21 @@ -222,6 +222,27 @@ typedef enum { SYSIO_TTAG(ftruncate), SYSIO_TTAG(unlink), SYSIO_TTAG(utime), +#ifdef FILE_HANDLE_INTERFACE + SYSIO_TTAG(fhi_export), + SYSIO_TTAG(fhi_unexport), + SYSIO_TTAG(fhi_root_of), + SYSIO_TTAG(fhi_iowait), + SYSIO_TTAG(fhi_getattr), + SYSIO_TTAG(fhi_setattr), + SYSIO_TTAG(fhi_lookup), + SYSIO_TTAG(fhi_readlink), + SYSIO_TTAG(fhi_read64x), + SYSIO_TTAG(fhi_write64x), + SYSIO_TTAG(fhi_create), + SYSIO_TTAG(fhi_unlink), + SYSIO_TTAG(fhi_rename), + SYSIO_TTAG(fhi_link), + SYSIO_TTAG(fhi_symlink), + SYSIO_TTAG(fhi_mkdir), + SYSIO_TTAG(fhi_rmdir), + SYSIO_TTAG(fhi_getdirentries64), + SYSIO_TTAG(fhi_statvfs64), +#endif } tracing_tag; extern void *_sysio_initializer_trace_q; |
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) \ |