[Libsysio-commit] HEAD: libsysio/src access.c chdir.c chmod.c chown.c dup.c fcntl.c fsync.c getdire
Brought to you by:
lward
From: Lee W. <lw...@us...> - 2007-07-02 18:58:29
|
Update of /cvsroot/libsysio/libsysio/src In directory sc8-pr-cvs6.sourceforge.net:/tmp/cvs-serv18012/src Modified Files: access.c chdir.c chmod.c chown.c dup.c fcntl.c fsync.c getdirentries.c init.c ioctl.c iowait.c link.c lseek.c mkdir.c mknod.c module.mk mount.c open.c readlink.c rename.c rmdir.c rw.c stat.c statvfs.c stddir.c symlink.c truncate.c unlink.c utime.c Log Message: Altered tracing support to include a format now. Re-introducing _HAVE_STATVFS6 for binary compatibility. Index: access.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/access.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- access.c 30 Apr 2007 16:56:25 -0000 1.16 +++ access.c 2 Jul 2007 18:58:15 -0000 1.17 @@ -101,6 +101,16 @@ _sysio_check_permission(struct pnode *pn err = -EACCES; /* assume error */ stat = &ino->i_stbuf; do { +#ifdef _SYSIO_ROOT_UID + /* + * Root? + */ + if (_sysio_is_root(crp)) { + err = 0; + break; + } +#endif + /* * Owner? */ @@ -260,12 +270,12 @@ SYSIO_INTERFACE_NAME(access)(const char SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(access, path, amode); + SYSIO_INTERFACE_ENTER(access, "%s%d", path, amode); INTENT_INIT(&intent, INT_GETATTR, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno); if (err) - SYSIO_INTERFACE_RETURN(-1, err, access, 0); + SYSIO_INTERFACE_RETURN(-1, err, access, "%d", 0); err = _sysio_ldcreds(geteuid(), getegid(), &cr); if (err < 0) goto out; @@ -273,7 +283,7 @@ SYSIO_INTERFACE_NAME(access)(const char _sysio_check_permission(pno, &cr, amode); out: P_RELE(pno); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, access, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, access, "%d", 0); } #ifdef REDSTORM Index: chdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chdir.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -w -b -B -p -r1.29 -r1.30 --- chdir.c 1 May 2007 16:33:53 -0000 1.29 +++ chdir.c 2 Jul 2007 18:58:15 -0000 1.30 @@ -126,15 +126,15 @@ SYSIO_INTERFACE_NAME(chdir)(const char * struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(chdir, path); + SYSIO_INTERFACE_ENTER(chdir, "%s", path); err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) - SYSIO_INTERFACE_RETURN(-1, err, chdir, 0); + SYSIO_INTERFACE_RETURN(-1, err, chdir, "%d", 0); err = _sysio_p_chdir(pno); if (err) P_RELE(pno); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, chdir, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, chdir, "%d", 0); } #ifdef REDSTORM @@ -243,7 +243,7 @@ SYSIO_INTERFACE_NAME(getcwd)(char *buf, int err; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(getcwd, buf, size); + SYSIO_INTERFACE_ENTER(getcwd, "%zu", size); #ifdef DEFER_INIT_CWD if (!_sysio_cwd) { struct pnode *pno; @@ -258,7 +258,7 @@ SYSIO_INTERFACE_NAME(getcwd)(char *buf, } #endif err = _sysio_p_path(_sysio_cwd, &buf, buf ? size : 0); - SYSIO_INTERFACE_RETURN(err ? NULL : buf, err, getcwd, buf, size); + SYSIO_INTERFACE_RETURN(err ? NULL : buf, err, getcwd, "%s", 0); } #ifdef __GLIBC__ Index: chmod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chmod.c,v retrieving revision 1.15 retrieving revision 1.16 diff -u -w -b -B -p -r1.15 -r1.16 --- chmod.c 30 Apr 2007 16:52:20 -0000 1.15 +++ chmod.c 2 Jul 2007 18:58:16 -0000 1.16 @@ -75,14 +75,14 @@ SYSIO_INTERFACE_NAME(chmod)(const char * struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(chmod, path, mode); + SYSIO_INTERFACE_ENTER(chmod, "%s%mY", path, mode); err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; err = do_chmod(pno, mode); P_RELE(pno); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, chmod, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, chmod, "%d", 0); } #ifdef REDSTORM @@ -98,7 +98,7 @@ SYSIO_INTERFACE_NAME(fchmod)(int fd, mod struct file *fil; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(fchmod, fd, mode); + SYSIO_INTERFACE_ENTER(fchmod, "%d%mY", fd, mode); err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -108,7 +108,7 @@ SYSIO_INTERFACE_NAME(fchmod)(int fd, mod err = do_chmod(fil->f_pno, mode); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fchmod, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fchmod, "%d", 0); } #ifdef REDSTORM Index: chown.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/chown.c,v retrieving revision 1.14 retrieving revision 1.15 diff -u -w -b -B -p -r1.14 -r1.15 --- chown.c 30 Apr 2007 16:52:20 -0000 1.14 +++ chown.c 2 Jul 2007 18:58:16 -0000 1.15 @@ -82,7 +82,7 @@ SYSIO_INTERFACE_NAME(chown)(const char * struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(chown, path, owner, group); + SYSIO_INTERFACE_ENTER(chown, "%s%uY%gY", path, owner, group); err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -90,7 +90,7 @@ SYSIO_INTERFACE_NAME(chown)(const char * err = _do_chown(pno, owner, group); P_RELE(pno); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, chown, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, chown, "%d", 0); } #ifdef REDSTORM @@ -106,7 +106,7 @@ SYSIO_INTERFACE_NAME(fchown)(int fd, uid struct file *fil; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(fchown, fd, owner, group); + SYSIO_INTERFACE_ENTER(fchown, "%d%uY%gY", fd, owner, group); err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -116,7 +116,7 @@ SYSIO_INTERFACE_NAME(fchown)(int fd, uid err = _do_chown(fil->f_pno, owner, group); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fchown, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fchown, "%d", 0); } #ifdef REDSTORM Index: dup.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/dup.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- dup.c 30 Apr 2007 16:52:20 -0000 1.13 +++ dup.c 2 Jul 2007 18:58:16 -0000 1.14 @@ -56,11 +56,13 @@ SYSIO_INTERFACE_NAME(dup2)(int oldfd, in int fd; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(dup2, oldfd, newfd); + SYSIO_INTERFACE_ENTER(dup2, "%d%d", oldfd, newfd); if (newfd < 0) - SYSIO_INTERFACE_RETURN(-1, -EBADF, dup2, 0); + SYSIO_INTERFACE_RETURN(-1, -EBADF, dup2, "%d", 0); fd = _sysio_fd_dup(oldfd, newfd, 1); - SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, fd < 0 ? fd : 0, dup2, 0); + SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, + fd < 0 ? fd : 0, + dup2, "%d", 0); } #ifdef REDSTORM @@ -75,9 +77,11 @@ SYSIO_INTERFACE_NAME(dup)(int oldfd) int fd; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(dup, oldfd); + SYSIO_INTERFACE_ENTER(dup, "%d", oldfd); fd = _sysio_fd_dup(oldfd, -1, 0); - SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, fd < 0 ? fd : 0, dup, 0); + SYSIO_INTERFACE_RETURN(fd < 0 ? -1 : fd, + fd < 0 ? fd : 0, + dup, "%d", 0); } #ifdef __GLIBC__ Index: fcntl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fcntl.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -w -b -B -p -r1.29 -r1.30 --- fcntl.c 1 May 2007 16:33:53 -0000 1.29 +++ fcntl.c 2 Jul 2007 18:58:16 -0000 1.30 @@ -161,7 +161,7 @@ _sysio_vfcntl(int fd, int cmd, va_list a struct file *fil; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(vfcntl, fd, cmd); + SYSIO_INTERFACE_ENTER(vfcntl, "%d%d", fd, cmd); err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -269,7 +269,7 @@ _sysio_vfcntl(int fd, int cmd, va_list a } out: - SYSIO_INTERFACE_RETURN(rtn, err, vfcntl, 0); + SYSIO_INTERFACE_RETURN(rtn, err, vfcntl, "%d", 0); } int Index: fsync.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/fsync.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- fsync.c 30 Apr 2007 16:52:20 -0000 1.9 +++ fsync.c 2 Jul 2007 18:58:16 -0000 1.10 @@ -58,12 +58,12 @@ SYSIO_INTERFACE_NAME(fsync)(int fd) int err; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(fsync, fd); + SYSIO_INTERFACE_ENTER(fsync, "%d", fd); fil = _sysio_fd_find(fd); if (!(fil && fil->f_pno)) - SYSIO_INTERFACE_RETURN(-1, -EBADF, fsync, 0); + SYSIO_INTERFACE_RETURN(-1, -EBADF, fsync, "%d", 0); err = PNOP_SYNC(fil->f_pno); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fsync, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fsync, "%d", 0); } int @@ -73,10 +73,10 @@ SYSIO_INTERFACE_NAME(fdatasync)(int fd) int err; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(fdatasync, fd); + SYSIO_INTERFACE_ENTER(fdatasync, "%d", fd); fil = _sysio_fd_find(fd); if (!(fil && fil->f_pno)) - SYSIO_INTERFACE_RETURN(-1, -EBADF, fdatasync, 0); + SYSIO_INTERFACE_RETURN(-1, -EBADF, fdatasync, "%d", 0); err = PNOP_DATASYNC(fil->f_pno); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fdatasync, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fdatasync, "%d", 0); } Index: getdirentries.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/getdirentries.c,v retrieving revision 1.24 retrieving revision 1.25 diff -u -w -b -B -p -r1.24 -r1.25 --- getdirentries.c 1 May 2007 16:33:53 -0000 1.24 +++ getdirentries.c 2 Jul 2007 18:58:16 -0000 1.25 @@ -84,6 +84,7 @@ filldirents(struct file *fil, return cc; } +#ifdef _LARGEFILE64_SOURCE static ssize_t PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64))(int fd, char *buf, @@ -95,16 +96,16 @@ PREPEND(_, SYSIO_INTERFACE_NAME(getdiren ssize_t cc; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(getdirentries64, fd, buf, nbytes, basep); + SYSIO_INTERFACE_ENTER(getdirentries64, + "%d%zu%oZ", fd, nbytes, basep); fil = _sysio_fd_find(fd); cc = filldirents(fil, buf, nbytes, basep); SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0, - getdirentries64, buf, basep); + getdirentries64, "%zd%oZ", basep); } -#ifdef _LARGEFILE64_SOURCE #undef getdirentries64 sysio_sym_strong_alias(PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64)), SYSIO_INTERFACE_NAME(getdirentries64)) @@ -164,7 +165,7 @@ SYSIO_INTERFACE_NAME(getdirentries)(int char *cp; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(getdirentries, fd, buf, nbytes, basep); + SYSIO_INTERFACE_ENTER(getdirentries, "%d%zu%d", fd, nbytes, *basep); fil = _sysio_fd_find(fd); count = cc = filldirents(fil, buf, nbytes, &b); @@ -223,11 +224,26 @@ SYSIO_INTERFACE_NAME(getdirentries)(int d64p = (struct dirent64 *)((char *)d64p + d64.d_reclen); } - if (cc < 0) - SYSIO_INTERFACE_RETURN(-1, cc, getdirentries, buf, basep); + if (cc < 0) { +#ifndef BSD +#define _basefmt "%oY" +#else +#define _basefmt "%ld" +#endif + SYSIO_INTERFACE_RETURN(-1, + cc, + getdirentries, "%zd" _basefmt, *basep); +#undef _basefmt + } cc = (char *)dp - buf; *basep = b; - SYSIO_INTERFACE_RETURN(cc, 0, getdirentries, buf, basep); +#ifndef BSD +#define _basefmt "%oY" +#else +#define _basefmt "%ld" +#endif + SYSIO_INTERFACE_RETURN(cc, 0, getdirentries, "%zd" _basefmt, *basep); +#undef _basefmt } #else /* !defined(DIRENT64_IS_NATURAL) */ sysio_sym_strong_alias(PREPEND(_, SYSIO_INTERFACE_NAME(getdirentries64), Index: init.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/init.c,v retrieving revision 1.35 retrieving revision 1.36 diff -u -w -b -B -p -r1.35 -r1.36 --- init.c 9 May 2007 23:40:20 -0000 1.35 +++ init.c 2 Jul 2007 18:58:16 -0000 1.36 @@ -93,6 +93,7 @@ struct trace_callback { int line, void *data, int tag, + const char *fmt, va_list ap); void *data; /* callback data */ void (*destructor)(void *data); /* data destructor */ @@ -205,16 +206,9 @@ out: void _sysio_shutdown() { - if (!(_sysio_fd_close_all() == 0 && - _sysio_unmount_all() == 0)) - abort(); -#ifdef ZERO_SUM_MEMORY - _sysio_fd_shutdown(); - _sysio_i_shutdown(); - _sysio_fssw_shutdown(); - _sysio_access_shutdown(); #ifdef SYSIO_TRACING + _sysio_trace_dump_stop(); { struct trace_callback *tcb; @@ -227,6 +221,15 @@ _sysio_shutdown() _sysio_remove_trace(&_sysio_exit_trace_head, tcb); } #endif + if (!(_sysio_fd_close_all() == 0 && + _sysio_unmount_all() == 0)) + abort(); + +#ifdef ZERO_SUM_MEMORY + _sysio_fd_shutdown(); + _sysio_i_shutdown(); + _sysio_fssw_shutdown(); + _sysio_access_shutdown(); #endif } @@ -325,7 +328,8 @@ _sysio_register_trace(void *q, const char *func, int line, void *data, - tracing_tag tag, + int tag, + const char *fmt, va_list ap), void *data, void (*destructor)(void *data)) @@ -365,16 +369,17 @@ _sysio_run_trace_q(void *q, const char *func, int line, int tag, + const char *fmt, ...) { va_list ap, aq; struct trace_callback *tcb; - va_start(ap, tag); + va_start(ap, fmt); tcb = ((struct trace_q *)q)->tqh_first; while (tcb) { va_copy(aq, ap); - (*tcb->f)(file, func, line, tcb->data, tag, ap); + (*tcb->f)(file, func, line, tcb->data, tag, fmt, ap); va_end(aq); tcb = tcb->links.tqe_next; } @@ -387,6 +392,7 @@ _sysio_trace_entry(const char *file __IS int line __IS_UNUSED, void *data __IS_UNUSED, tracing_tag tag, + const char *fmt __IS_UNUSED, va_list ap __IS_UNUSED) { @@ -399,6 +405,7 @@ _sysio_trace_exit(const char *file __IS_ int line __IS_UNUSED, void *data __IS_UNUSED, tracing_tag tag, + const char *fmt __IS_UNUSED, va_list ap __IS_UNUSED) { @@ -933,44 +940,102 @@ do_command(char *buf) static int _sysio_boot_tracing(const char *arg) { + int err; + const char *dirpath; long l; char *cp; - static struct trace_callback - *entcb = NULL, - *exitcb = NULL; - - l = 0; - if (arg) { - l = strtol(arg, (char **)&cp, 0); - if (*cp || !(l == 0 || l == 1)) - return -EINVAL; - } - if (l) { - if (entcb == NULL) - entcb = - _sysio_register_trace(_sysio_entry_trace_q, + int stop; + struct hook { + struct trace_q *q; + void (*f)(const char *file, + const char *func, + int line, + void *data, + int tag, + const char *fmt, + va_list ap); + void *data; + void (*destructor)(void *data); + struct trace_callback *cb; + }; + static struct hook hooks[] = { + { + &_sysio_entry_trace_head, _sysio_trace_entry, NULL, - NULL); - if (entcb == NULL) - return -errno; - if (exitcb == NULL) - exitcb = - _sysio_register_trace(_sysio_exit_trace_q, + NULL, + NULL + }, + { + &_sysio_exit_trace_head, _sysio_trace_exit, NULL, - NULL); - if (exitcb == NULL) - return -errno; + NULL, + NULL + }, + { + NULL, + NULL, + NULL, + NULL, + NULL + } + }; + struct hook *h; + + err = 0; + dirpath = NULL; + l = strtol(arg, (char **)&cp, 0); + if (*arg != '\0' && *cp != '\0') + dirpath = arg; + stop = 0; + if (dirpath) + err = _sysio_trace_dump_start(dirpath); + else if (l) { + /* + * Start console tracing. + */ + do { + if (l != 1) { + err = -EINVAL; + break; + } + for (h = hooks; h->f != NULL; h++) { + if (h->cb) + continue; + h->cb = + _sysio_register_trace(h->q, + h->f, + h->data, + h->destructor); + if (!h->cb) { + err = -ENOMEM; + break; + } + } + } while (0); } else { - if (entcb != NULL) - _sysio_remove_trace(_sysio_entry_trace_q, entcb); - entcb = NULL; - if (exitcb != NULL) - _sysio_remove_trace(_sysio_exit_trace_q, exitcb); - exitcb = NULL; + /* + * Trace dump stop. + */ + stop = 1; } - return 0; + if (!(dirpath || l) || err) { + /* + * Trace dump stop. + */ + _sysio_trace_dump_stop(); + /* + * Stop console tracing. + */ + for (h = hooks; h->f != NULL; h++) { + if (!h->cb) + continue; + _sysio_remove_trace(h->q, h->cb); + h->cb = NULL; + } + } + return err; } #endif Index: ioctl.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/ioctl.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- ioctl.c 30 Apr 2007 16:52:20 -0000 1.13 +++ ioctl.c 2 Jul 2007 18:58:16 -0000 1.14 @@ -61,7 +61,7 @@ SYSIO_INTERFACE_NAME(ioctl)(int fd, unsi va_list ap; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(ioctl, fd, request); + SYSIO_INTERFACE_ENTER(ioctl, "%d%lu", fd, request); err = 0; fil = _sysio_fd_find(fd); if (!fil) { @@ -74,7 +74,7 @@ SYSIO_INTERFACE_NAME(ioctl)(int fd, unsi va_end(ap); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, ioctl, request); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, ioctl, "%d%lu", request); } Index: iowait.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/iowait.c,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- iowait.c 30 Apr 2007 16:52:20 -0000 1.12 +++ iowait.c 2 Jul 2007 18:58:16 -0000 1.13 @@ -63,13 +63,14 @@ SYSIO_INTERFACE_NAME(iodone)(void *ioid) int rc; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(iodone, ioid); + SYSIO_INTERFACE_ENTER(iodone, "%p", ioid); ioctx = _sysio_ioctx_find(ioid); if (!ioctx) - SYSIO_INTERFACE_RETURN(-1, -EINVAL, iodone, 0); + SYSIO_INTERFACE_RETURN(-1, -EINVAL, iodone, "%d", 0); rc = _sysio_ioctx_done(ioctx); - SYSIO_INTERFACE_RETURN(rc < 0 ? -1 : rc, rc < 0 ? rc : 0, iodone, 0); + SYSIO_INTERFACE_RETURN(rc < 0 ? -1 : rc, rc < 0 ? rc : 0, + iodone, "%d", 0); } /* @@ -85,12 +86,12 @@ SYSIO_INTERFACE_NAME(iowait)(void *ioid) ssize_t cc; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(iowait, ioid); + SYSIO_INTERFACE_ENTER(iowait, "%p", ioid); ioctx = _sysio_ioctx_find(ioid); if (!ioctx) - SYSIO_INTERFACE_RETURN(-1, -EINVAL, iowait, 0); + SYSIO_INTERFACE_RETURN(-1, -EINVAL, iowait, "%zd", 0); cc = _sysio_ioctx_wait(ioctx); SYSIO_INTERFACE_RETURN(cc < 0 ? -1 : cc, cc < 0 ? (int )cc : 0, - iowait, 0); + iowait, "%zd", 0); } Index: link.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/link.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- link.c 30 Apr 2007 16:52:20 -0000 1.13 +++ link.c 2 Jul 2007 18:58:16 -0000 1.14 @@ -62,7 +62,7 @@ SYSIO_INTERFACE_NAME(link)(const char *o struct pnode *old, *new; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(link, oldpath, newpath); + SYSIO_INTERFACE_ENTER(link, "%s%s", oldpath, newpath); INTENT_INIT(&intent, 0, NULL, NULL); err = _sysio_namei(_sysio_cwd, oldpath, 0, &intent, &old); if (err) @@ -104,7 +104,7 @@ error2: error1: P_RELE(old); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, link, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, link, "%d", 0); } #ifdef REDSTORM Index: lseek.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/lseek.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -w -b -B -p -r1.29 -r1.30 --- lseek.c 1 May 2007 16:33:53 -0000 1.29 +++ lseek.c 2 Jul 2007 18:58:16 -0000 1.30 @@ -36,7 +36,7 @@ * Lee Ward * Sandia National Laboratories, New Mexico * P.O. Box 5800 - * Albuquerque, NM 87185-1110 + * Albuquerque, NM 87185-1319 * * le...@sa... */ @@ -128,14 +128,16 @@ SYSIO_INTERFACE_NAME(lseek64)(int fd, of off64_t off; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(lseek64, fd, offset, whence); + SYSIO_INTERFACE_ENTER(lseek64, "%d%loY%d", fd, offset, whence); fil = _sysio_fd_find(fd); if (!fil) - SYSIO_INTERFACE_RETURN((off64_t )-1, -EBADF, lseek64, 0); + SYSIO_INTERFACE_RETURN((off64_t )-1, + -EBADF, + lseek64, "%loY", 0); off = _sysio_lseek(fil, offset, whence, _SEEK_MAX(fil)); SYSIO_INTERFACE_RETURN(off < 0 ? (off64_t )-1 : off, off < 0 ? (int )off : 0, - lseek64, 0); + lseek64, "%loY", 0); } #ifdef __GLIBC__ @@ -160,16 +162,16 @@ SYSIO_INTERFACE_NAME(lseek)(int fd, off_ off_t rtn; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(lseek, fd, offset, whence); + SYSIO_INTERFACE_ENTER(lseek, "%d%oY%d", fd, offset, whence); fil = _sysio_fd_find(fd); if (!fil) - SYSIO_INTERFACE_RETURN((off_t )-1, -EBADF, lseek, 0); + SYSIO_INTERFACE_RETURN((off_t )-1, -EBADF, lseek, "%oY", 0); off = _sysio_lseek(fil, offset, whence, LONG_MAX); if (off < 0) - SYSIO_INTERFACE_RETURN((off_t )-1, (int )off, lseek, 0); + SYSIO_INTERFACE_RETURN((off_t )-1, (int )off, lseek, "%oY", 0); rtn = (off_t )off; assert(rtn == off); - SYSIO_INTERFACE_RETURN(rtn, 0, lseek, 0); + SYSIO_INTERFACE_RETURN(rtn, 0, lseek, "%oY", 0); } #ifdef __GLIBC__ @@ -195,20 +197,20 @@ SYSIO_INTERFACE_NAME(llseek)(unsigned in * This is just plain goofy. */ SYSIO_INTERFACE_ENTER(llseek, + "%d%lu%lu%u", fd, offset_high, offset_low, - result, whence); fil = _sysio_fd_find(fd); if (!fil) - SYSIO_INTERFACE_RETURN(-1, -EBADF, llseek, NULL); + SYSIO_INTERFACE_RETURN(-1, -EBADF, llseek, "%d", NULL); #ifndef _LARGEFILE64_SOURCE if (offset_high) { /* * We are using 32-bit internals. This just isn't * going to work. */ - SYSIO_INTERFACE_RETURN(-1, -EOVERFLOW, llseek, NULL); + SYSIO_INTERFACE_RETURN(-1, -EOVERFLOW, llseek, "%d", NULL); } #else off = offset_high; @@ -217,9 +219,12 @@ SYSIO_INTERFACE_NAME(llseek)(unsigned in #endif off = _sysio_lseek(fil, off, whence, _SEEK_MAX(fil)); if (off < 0) - SYSIO_INTERFACE_RETURN((off_t )-1, (int )off, llseek, NULL); + SYSIO_INTERFACE_RETURN(-1, (int )off, llseek, "%d", NULL); *result = off; - SYSIO_INTERFACE_RETURN(0, 0, llseek, result); + /* + * Note: Need to add the result to the tracing info some day :( + */ + SYSIO_INTERFACE_RETURN(0, 0, llseek, "%d", 0); } #undef __llseek Index: mkdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mkdir.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 --- mkdir.c 30 Apr 2007 16:52:20 -0000 1.21 +++ mkdir.c 2 Jul 2007 18:58:16 -0000 1.22 @@ -78,7 +78,7 @@ SYSIO_INTERFACE_NAME(mkdir)(const char * struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(mkdir, path, mode); + SYSIO_INTERFACE_ENTER(mkdir, "%s%mY", path, mode); INTENT_INIT(&intent, INT_CREAT, &mode, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NEGOK, &intent, &pno); if (err) @@ -88,7 +88,7 @@ SYSIO_INTERFACE_NAME(mkdir)(const char * err = _sysio_mkdir(pno, mode); P_RELE(pno); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, mkdir, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, mkdir, "%d", 0); } #ifdef REDSTORM Index: mknod.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mknod.c,v retrieving revision 1.20 retrieving revision 1.21 diff -u -w -b -B -p -r1.20 -r1.21 --- mknod.c 30 Apr 2007 16:52:20 -0000 1.20 +++ mknod.c 2 Jul 2007 18:58:16 -0000 1.21 @@ -91,7 +91,7 @@ PREPEND(__, SYSIO_INTERFACE_NAME(xmknod) struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(xmknod, __ver, path, mode, dev); + SYSIO_INTERFACE_ENTER(xmknod, "%d%s%mY%dY",__ver, path, mode, dev); if (__ver != _MKNOD_VER) { err = -ENOSYS; goto out; @@ -111,7 +111,7 @@ PREPEND(__, SYSIO_INTERFACE_NAME(xmknod) error: P_RELE(pno); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, xmknod, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, xmknod, "%d", 0); } #ifdef REDSTORM Index: module.mk =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/module.mk,v retrieving revision 1.12 retrieving revision 1.13 diff -u -w -b -B -p -r1.12 -r1.13 --- module.mk 30 Apr 2007 23:24:13 -0000 1.12 +++ module.mk 2 Jul 2007 18:58:16 -0000 1.13 @@ -10,6 +10,12 @@ else LUSTRE_SRCDIR_SRCS = endif +if WITH_STATVFS +STATVFS_SRCS = src/statvfs.c +else +STATVFS_SRCS = +endif + SRCDIR_SRCS = src/access.c src/chdir.c src/chmod.c \ src/chown.c src/dev.c src/dup.c src/fcntl.c \ src/fs.c src/fsync.c \ @@ -18,10 +24,11 @@ SRCDIR_SRCS = src/access.c src/chdir.c s src/link.c src/lseek.c src/mkdir.c \ src/mknod.c src/mount.c src/namei.c \ src/open.c src/rw.c src/reconcile.c src/rename.c \ - src/rmdir.c src/stat.c src/statvfs.c \ + src/rmdir.c src/stat.c $(STATVFS_SRCS) \ src/stddir.c src/readdir.c src/readdir64.c \ src/symlink.c src/readlink.c \ src/truncate.c src/unlink.c src/utime.c \ - $(FILE_SUPPORT) $(LUSTRE_SRCDIR_SRCS) + $(FILE_SUPPORT) $(LUSTRE_SRCDIR_SRCS) \ + src/tracing.c SRCDIR_EXTRA = src/module.mk Index: mount.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/mount.c,v retrieving revision 1.23 retrieving revision 1.24 diff -u -w -b -B -p -r1.23 -r1.24 --- mount.c 1 May 2007 16:33:53 -0000 1.23 +++ mount.c 2 Jul 2007 18:58:17 -0000 1.24 @@ -351,6 +351,7 @@ SYSIO_INTERFACE_NAME(mount)(const char * SYSIO_INTERFACE_DISPLAY_BLOCK; SYSIO_INTERFACE_ENTER(mount, + "%s%s%s%lu", source, target, filesystemtype, mountflags); @@ -361,7 +362,7 @@ SYSIO_INTERFACE_NAME(mount)(const char * filesystemtype, mountflags, data); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, mount, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, mount, "%d", 0); } int @@ -372,7 +373,7 @@ SYSIO_INTERFACE_NAME(umount)(const char struct mount *mnt; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(umount, target); + SYSIO_INTERFACE_ENTER(umount, "%s", target); /* * Look up the target path node. */ @@ -398,7 +399,7 @@ SYSIO_INTERFACE_NAME(umount)(const char err = _sysio_do_unmount(mnt); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, umount, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, umount, "%d", 0); } /* Index: open.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/open.c,v retrieving revision 1.29 retrieving revision 1.30 diff -u -w -b -B -p -r1.29 -r1.30 --- open.c 30 Apr 2007 16:52:20 -0000 1.29 +++ open.c 2 Jul 2007 18:58:17 -0000 1.30 @@ -161,7 +161,7 @@ SYSIO_INTERFACE_NAME(open)(const char *p if (flags & O_NOFOLLOW) ndflags |= ND_NOFOLLOW; #endif - SYSIO_INTERFACE_ENTER(open, path, flags, mode); + SYSIO_INTERFACE_ENTER(open, "%s%d%mY", path, flags, mode); /* * Find the file. @@ -192,14 +192,14 @@ SYSIO_INTERFACE_NAME(open)(const char *p P_RELE(pno); - SYSIO_INTERFACE_RETURN(rtn, 0, open, 0); + SYSIO_INTERFACE_RETURN(rtn, 0, open, "%d", 0); error: if (fil) F_RELE(fil); if (pno) P_RELE(pno); - SYSIO_INTERFACE_RETURN(-1, rtn, open, 0); + SYSIO_INTERFACE_RETURN(-1, rtn, open, "%d", 0); } #ifdef __GLIBC__ @@ -231,9 +231,9 @@ SYSIO_INTERFACE_NAME(close)(int fd) int err; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(close, fd); + SYSIO_INTERFACE_ENTER(close, "%d", fd); err = _sysio_fd_close(fd); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, close, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, close, "%d", 0); } #ifdef __GLIBC__ Index: readlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/readlink.c,v retrieving revision 1.9 retrieving revision 1.10 diff -u -w -b -B -p -r1.9 -r1.10 --- readlink.c 30 Apr 2007 16:52:20 -0000 1.9 +++ readlink.c 2 Jul 2007 18:58:17 -0000 1.10 @@ -64,7 +64,7 @@ SYSIO_INTERFACE_NAME(readlink)(const cha struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(readlink, path, bufsiz); + SYSIO_INTERFACE_ENTER(readlink, "%s%zd", path, bufsiz); INTENT_INIT(&intent, INT_GETATTR, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, ND_NOFOLLOW, &intent, &pno); if (err) @@ -77,8 +77,14 @@ SYSIO_INTERFACE_NAME(readlink)(const cha error: P_RELE(pno); out: +#ifdef HAVE_POSIX_1003_READLINK +#define _rtnfmt "%zd" +#else +#define _rtnfmt "%d" +#endif SYSIO_INTERFACE_RETURN(err < 0 ? -1 : err, err >= 0 ? 0 : err, - readlink, buf); + readlink, _rtnfmt "%*s", err, buf); +#undef _rtnfmt } #ifdef REDSTORM Index: rename.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rename.c,v retrieving revision 1.13 retrieving revision 1.14 diff -u -w -b -B -p -r1.13 -r1.14 --- rename.c 30 Apr 2007 16:52:20 -0000 1.13 +++ rename.c 2 Jul 2007 18:58:17 -0000 1.14 @@ -62,13 +62,13 @@ SYSIO_INTERFACE_NAME(rename)(const char struct pnode *old, *new; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(rename, oldpath, newpath); + SYSIO_INTERFACE_ENTER(rename, "%s%s", oldpath, newpath); /* * Neither old nor new may be the empty string. */ if (*oldpath == '\0' || *newpath == '\0') - SYSIO_INTERFACE_RETURN(-1, -ENOENT, rename, 0); + SYSIO_INTERFACE_RETURN(-1, -ENOENT, rename, "%d", 0); old = new = NULL; do { @@ -108,5 +108,5 @@ SYSIO_INTERFACE_NAME(rename)(const char P_RELE(new); if (old) P_RELE(old); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, rename, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, rename, "%d", 0); } Index: rmdir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rmdir.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 --- rmdir.c 30 Apr 2007 16:52:20 -0000 1.21 +++ rmdir.c 2 Jul 2007 18:58:17 -0000 1.22 @@ -62,7 +62,7 @@ SYSIO_INTERFACE_NAME(rmdir)(const char * struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(rmdir, path); + SYSIO_INTERFACE_ENTER(rmdir, "%s", path); do { INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL); err = _sysio_namei(_sysio_cwd, path, 0, &intent, &pno); @@ -79,7 +79,7 @@ SYSIO_INTERFACE_NAME(rmdir)(const char * } while (0); if (pno) P_RELE(pno); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, rmdir, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, rmdir, "%d", 0); } #ifdef REDSTORM Index: rw.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/rw.c,v retrieving revision 1.21 retrieving revision 1.22 diff -u -w -b -B -p -r1.21 -r1.22 --- rw.c 1 May 2007 16:33:53 -0000 1.21 +++ rw.c 2 Jul 2007 18:58:17 -0000 1.22 @@ -306,12 +306,16 @@ _do_ireadx(int fd, struct ioctx *ioctx; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(ireadx, fd, iov, iov_count, xtv, xtv_count); + SYSIO_INTERFACE_ENTER(ireadx, + "%d%*iY%*xZ", + fd, + iov_count, iov, + xtv_count, xtv); fil = _sysio_fd_find(fd); if (fil == NULL) - SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF, ireadx, iov); + SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF, ireadx, "%p", 0); if (fil->f_pno->p_base->pb_ino == NULL) - SYSIO_INTERFACE_RETURN(IOID_FAIL, -ESTALE, ireadx, iov); + SYSIO_INTERFACE_RETURN(IOID_FAIL, -ESTALE, ireadx, "%p", 0); err = _sysio_iiox(READ, fil, @@ -319,7 +323,7 @@ _do_ireadx(int fd, xtv, xtv_count, release_xtvec, completio, &ioctx); - SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err, ireadx, iov); + SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err, ireadx, "%p", 0); } #ifdef _LARGEFILE64_SOURCE @@ -352,12 +356,16 @@ _do_iwritex(int fd, struct ioctx *ioctx; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(iwritex, fd, iov, iov_count, xtv, xtv_count); + SYSIO_INTERFACE_ENTER(iwritex, + "%d%*iY%*xZ", + fd, + iov_count, iov, + xtv_count, xtv); fil = _sysio_fd_find(fd); if (fil == NULL) - SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF, iwritex, iov); + SYSIO_INTERFACE_RETURN(IOID_FAIL, -EBADF, iwritex, "%p", 0); if (fil->f_pno->p_base->pb_ino == NULL) - SYSIO_INTERFACE_RETURN(IOID_FAIL, -ESTALE, iwritex, iov); + SYSIO_INTERFACE_RETURN(IOID_FAIL, -ESTALE, iwritex, "%p", 0); err = _sysio_iiox(WRITE, fil, @@ -365,7 +373,7 @@ _do_iwritex(int fd, xtv, xtv_count, release_xtvec, completio, &ioctx); - SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err, iwritex, iov); + SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err, iwritex, "%p", 0); } #ifdef _LARGEFILE64_SOURCE @@ -869,9 +877,9 @@ _do_iiov(direction dir, SYSIO_INTERFACE_DISPLAY_BLOCK; if (dir == READ) - SYSIO_INTERFACE_ENTER(ireadv, fd, iov, count); + SYSIO_INTERFACE_ENTER(ireadv, "%d%*iY", fd, count, iov); else - SYSIO_INTERFACE_ENTER(iwritev, fd, iov, count); + SYSIO_INTERFACE_ENTER(iwritev, "%d%*iY", fd, count, iov); xtv = NULL; err = 0; do { @@ -909,10 +917,10 @@ _do_iiov(direction dir, free(xtv); if (dir == READ) SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err, - ireadx, iov); + ireadx, "%p", 0); else SYSIO_INTERFACE_RETURN(err ? IOID_FAIL : ioctx, err, - iwritex, iov); + iwritex, "%p", 0); /* Not reached. */ } Index: stat.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stat.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- stat.c 1 May 2007 16:33:53 -0000 1.19 +++ stat.c 2 Jul 2007 18:58:17 -0000 1.20 @@ -66,7 +66,7 @@ _sysio_fxstat(int ver, int fildes, struc int err; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(fxstat, ver, fildes); + SYSIO_INTERFACE_ENTER(fxstat, "%d%d", ver, fildes); if (ver != _STAT_VER) { err = -ENOSYS; goto out; @@ -84,7 +84,10 @@ _sysio_fxstat(int ver, int fildes, struc */ err = PNOP_GETATTR(fil->f_pno, stat_buf); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fxstat, stat_buf); + /* + * Note: Pass the stat buffer to the tracing routines some day. + */ + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fxstat, "%d", 0); } static int @@ -98,7 +101,7 @@ _sysio_xstatnd(int ver, struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(xstatnd, ver, filename, ndflags); + SYSIO_INTERFACE_ENTER(xstatnd, "%d%s%u", ver, filename, ndflags); if (ver != _STAT_VER) { err = -ENOSYS; goto out; @@ -118,7 +121,10 @@ _sysio_xstatnd(int ver, sizeof(struct intnl_stat)); P_RELE(pno); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, xstatnd, stat_buf); + /* + * Note: Pass the stat buffer to the tracing routines some day. + */ + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, xstatnd, "%d", 0); } #ifdef _LARGEFILE64_SOURCE Index: statvfs.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/statvfs.c,v retrieving revision 1.16 retrieving revision 1.17 diff -u -w -b -B -p -r1.16 -r1.17 --- statvfs.c 9 May 2007 23:16:20 -0000 1.16 +++ statvfs.c 2 Jul 2007 18:58:17 -0000 1.17 @@ -94,9 +94,12 @@ SYSIO_INTERFACE_NAME(statvfs64)(const ch int err; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(statvfs64, path); + SYSIO_INTERFACE_ENTER(statvfs64, "%s", path); err = _sysio_statvfs(path, buf); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, statvfs64, buf); + /* + * Note: Pass the statvfs buffer to the tracing routines some day. + */ + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, statvfs64, "%d", 0); } #ifdef REDSTORM @@ -111,9 +114,12 @@ SYSIO_INTERFACE_NAME(fstatvfs64)(int fd, int err; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(fstatvfs64, fd, buf); + SYSIO_INTERFACE_ENTER(fstatvfs64, "%d", fd); err = _sysio_fstatvfs(fd, buf); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fstatvfs64, buf); + /* + * Note: Pass the statvfs buffer to the tracing routines some day. + */ + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fstatvfs64, "%d", 0); } #ifdef REDSTORM @@ -156,14 +162,17 @@ SYSIO_INTERFACE_NAME(statvfs)(const char #endif /* defined(_LARGEFILE64_SOURCE) */ SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(statvfs, path); + SYSIO_INTERFACE_ENTER(statvfs, "%s", path); err = _sysio_statvfs(path, _call_buf); #if defined(_LARGEFILE64_SOURCE) if (!err) convstatvfs(buf, _call_buf); #undef _call_buf #endif /* defined(_LARGEFILE64_SOURCE) */ - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, statvfs, buf); + /* + * Note: Pass the statvfs buffer to the tracing routines some day. + */ + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, statvfs, "%d", 0); } #ifdef REDSTORM @@ -184,14 +193,17 @@ SYSIO_INTERFACE_NAME(fstatvfs)(int fd, s #endif /* defined(_LARGEFILE64_SOURCE) */ SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(fstatvfs, fd); + SYSIO_INTERFACE_ENTER(fstatvfs, "%d", fd); err = _sysio_fstatvfs(fd, _call_buf); #ifndef INTNL_STATVFS_IS_NATURAL if (!err) convstatvfs(buf, _call_buf); #undef _call_buf #endif - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fstatvfs, buf); + /* + * Note: Pass the statvfs buffer to the tracing routines some day. + */ + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, fstatvfs, "%d", 0); } #ifdef REDSTORM Index: stddir.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/stddir.c,v retrieving revision 1.3 retrieving revision 1.4 diff -u -w -b -B -p -r1.3 -r1.4 --- stddir.c 30 Apr 2007 16:52:20 -0000 1.3 +++ stddir.c 2 Jul 2007 18:58:17 -0000 1.4 @@ -51,18 +51,18 @@ SYSIO_INTERFACE_NAME(opendir)(const char SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(opendir, name); + SYSIO_INTERFACE_ENTER(opendir, "%s", name); dir = (DIR * )calloc(1, sizeof(DIR)); if (!dir) - SYSIO_INTERFACE_RETURN(NULL, -ENOMEM, opendir, 0); + SYSIO_INTERFACE_RETURN(NULL, -ENOMEM, opendir, "%p", 0); dir->fd = SYSIO_INTERFACE_NAME(open)(name, O_RDONLY); if (dir->fd < 0) { free(dir); - SYSIO_INTERFACE_RETURN(NULL, -errno, opendir, 0); + SYSIO_INTERFACE_RETURN(NULL, -errno, opendir, "%p", 0); } - SYSIO_INTERFACE_RETURN(dir, 0, opendir, 0); + SYSIO_INTERFACE_RETURN(dir, 0, opendir, "%p", 0); } sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(opendir), @@ -74,12 +74,12 @@ SYSIO_INTERFACE_NAME(closedir)(DIR *dir) int rc; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(closedir, dir); + SYSIO_INTERFACE_ENTER(closedir, "%p", dir); rc = SYSIO_INTERFACE_NAME(close)(dir->fd); free(dir); - SYSIO_INTERFACE_RETURN(rc, 0, closedir, 0); + SYSIO_INTERFACE_RETURN(rc, 0, closedir, "%d", 0); } sysio_sym_weak_alias(SYSIO_INTERFACE_NAME(closedir), Index: symlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/symlink.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- symlink.c 30 Apr 2007 16:52:20 -0000 1.17 +++ symlink.c 2 Jul 2007 18:58:17 -0000 1.18 @@ -62,7 +62,7 @@ SYSIO_INTERFACE_NAME(symlink)(const char struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(symlink, oldpath, newpath); + SYSIO_INTERFACE_ENTER(symlink, "%s%s", oldpath, newpath); INTENT_INIT(&intent, INT_CREAT, NULL, NULL); err = _sysio_namei(_sysio_cwd, @@ -84,7 +84,7 @@ SYSIO_INTERFACE_NAME(symlink)(const char error: P_RELE(pno); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, symlink, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, symlink, "%d", 0); } #ifdef REDSTORM Index: truncate.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/truncate.c,v retrieving revision 1.17 retrieving revision 1.18 diff -u -w -b -B -p -r1.17 -r1.18 --- truncate.c 1 May 2007 16:33:53 -0000 1.17 +++ truncate.c 2 Jul 2007 18:58:17 -0000 1.18 @@ -91,7 +91,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(truncate struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(truncate, path, length); + SYSIO_INTERFACE_ENTER(truncate, "%s%oZ", path, length); err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -99,7 +99,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(truncate P_RELE(pno); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, truncate, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, truncate, "%d", 0); } #ifdef _LARGEFILE64_SOURCE @@ -127,7 +127,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ftruncat struct file *fil; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(ftruncate, fd, length); + SYSIO_INTERFACE_ENTER(ftruncate, "%d%oZ", fd, length); err = 0; fil = _sysio_fd_find(fd); if (!(fil && F_CHKRW(fil, 'w'))) { @@ -136,7 +136,7 @@ PREPEND(_, SYSIO_INTERFACE_NAME(ftruncat } err = do_truncate(fil->f_pno, length); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, ftruncate, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, ftruncate, "%d", 0); } #ifdef _LARGEFILE64_SOURCE Index: unlink.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/unlink.c,v retrieving revision 1.19 retrieving revision 1.20 diff -u -w -b -B -p -r1.19 -r1.20 --- unlink.c 30 Apr 2007 16:52:20 -0000 1.19 +++ unlink.c 2 Jul 2007 18:58:17 -0000 1.20 @@ -62,7 +62,7 @@ SYSIO_INTERFACE_NAME(unlink)(const char struct pnode *pno; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(unlink, path); + SYSIO_INTERFACE_ENTER(unlink, "%s", path); do { INTENT_INIT(&intent, INT_UPDPARENT, NULL, NULL); err = @@ -80,7 +80,7 @@ SYSIO_INTERFACE_NAME(unlink)(const char } while (0); if (pno) P_RELE(pno); - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, unlink, 0); + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, unlink, "%d", 0); } #ifdef REDSTORM Index: utime.c =================================================================== RCS file: /cvsroot/libsysio/libsysio/src/utime.c,v retrieving revision 1.8 retrieving revision 1.9 diff -u -w -b -B -p -r1.8 -r1.9 --- utime.c 30 Apr 2007 16:52:20 -0000 1.8 +++ utime.c 2 Jul 2007 18:58:18 -0000 1.9 @@ -76,7 +76,7 @@ SYSIO_INTERFACE_NAME(utime)(const char * struct intnl_stat stbuf; SYSIO_INTERFACE_DISPLAY_BLOCK; - SYSIO_INTERFACE_ENTER(utime, path); + SYSIO_INTERFACE_ENTER(utime, "%s", path); err = _sysio_namei(_sysio_cwd, path, 0, NULL, &pno); if (err) goto out; @@ -91,5 +91,8 @@ SYSIO_INTERFACE_NAME(utime)(const char * _sysio_p_setattr(pno, SETATTR_ATIME | SETATTR_MTIME, &stbuf); P_RELE(pno); out: - SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, utime, buf); + /* + * Note: Pass the utimbuf buffer to the tracing routines some day. + */ + SYSIO_INTERFACE_RETURN(err ? -1 : 0, err, utime, "%d", 0); } |