summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2002-06-07 05:37:18 +0000
committerjhb <jhb@FreeBSD.org>2002-06-07 05:37:18 +0000
commitfbebc83b5b089064d7d4f969ef3459ad64815af2 (patch)
treed6f2724dac3173532bc97130435f5c94f5151f01
parentab80d12ef1c521cbfb58560aa8d6071aca990d9d (diff)
downloadFreeBSD-src-fbebc83b5b089064d7d4f969ef3459ad64815af2.zip
FreeBSD-src-fbebc83b5b089064d7d4f969ef3459ad64815af2.tar.gz
Catch up to changes in ktrace API.
-rw-r--r--sys/compat/svr4/svr4_stream.c4
-rw-r--r--sys/kern/sys_generic.c18
-rw-r--r--sys/kern/uipc_syscalls.c16
-rw-r--r--sys/kern/vfs_lookup.c7
4 files changed, 23 insertions, 22 deletions
diff --git a/sys/compat/svr4/svr4_stream.c b/sys/compat/svr4/svr4_stream.c
index feaedcb..2ed6121 100644
--- a/sys/compat/svr4/svr4_stream.c
+++ b/sys/compat/svr4/svr4_stream.c
@@ -227,7 +227,7 @@ svr4_sendit(td, s, mp, flags)
if (error == 0) {
ktruio.uio_iov = ktriov;
ktruio.uio_resid = td->td_retval[0];
- ktrgenio(td->td_proc->p_tracep, s, UIO_WRITE, &ktruio, error);
+ ktrgenio(s, UIO_WRITE, &ktruio, error);
}
FREE(ktriov, M_TEMP);
}
@@ -299,7 +299,7 @@ svr4_recvit(td, s, mp, namelenp)
if (error == 0) {
ktruio.uio_iov = ktriov;
ktruio.uio_resid = len - auio.uio_resid;
- ktrgenio(td->td_proc->p_tracep, s, UIO_READ, &ktruio, error);
+ ktrgenio(s, UIO_READ, &ktruio, error);
}
FREE(ktriov, M_TEMP);
}
diff --git a/sys/kern/sys_generic.c b/sys/kern/sys_generic.c
index f3352b9..8a94b0c 100644
--- a/sys/kern/sys_generic.c
+++ b/sys/kern/sys_generic.c
@@ -184,7 +184,7 @@ dofileread(td, fp, fd, buf, nbyte, offset, flags)
/*
* if tracing, save a copy of iovec
*/
- if (KTRPOINT(td->td_proc, KTR_GENIO)) {
+ if (KTRPOINT(td, KTR_GENIO)) {
ktriov = aiov;
ktruio = auio;
didktr = 1;
@@ -202,7 +202,7 @@ dofileread(td, fp, fd, buf, nbyte, offset, flags)
if (didktr && error == 0) {
ktruio.uio_iov = &ktriov;
ktruio.uio_resid = cnt;
- ktrgenio(td->td_proc->p_tracep, fd, UIO_READ, &ktruio, error);
+ ktrgenio(fd, UIO_READ, &ktruio, error);
}
#endif
td->td_retval[0] = cnt;
@@ -275,7 +275,7 @@ readv(td, uap)
/*
* if tracing, save a copy of iovec
*/
- if (KTRPOINT(td->td_proc, KTR_GENIO)) {
+ if (KTRPOINT(td, KTR_GENIO)) {
MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK);
bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen);
ktruio = auio;
@@ -293,8 +293,7 @@ readv(td, uap)
if (error == 0) {
ktruio.uio_iov = ktriov;
ktruio.uio_resid = cnt;
- ktrgenio(td->td_proc->p_tracep, uap->fd, UIO_READ, &ktruio,
- error);
+ ktrgenio(uap->fd, UIO_READ, &ktruio, error);
}
FREE(ktriov, M_TEMP);
}
@@ -408,7 +407,7 @@ dofilewrite(td, fp, fd, buf, nbyte, offset, flags)
/*
* if tracing, save a copy of iovec and uio
*/
- if (KTRPOINT(td->td_proc, KTR_GENIO)) {
+ if (KTRPOINT(td, KTR_GENIO)) {
ktriov = aiov;
ktruio = auio;
didktr = 1;
@@ -432,7 +431,7 @@ dofilewrite(td, fp, fd, buf, nbyte, offset, flags)
if (didktr && error == 0) {
ktruio.uio_iov = &ktriov;
ktruio.uio_resid = cnt;
- ktrgenio(td->td_proc->p_tracep, fd, UIO_WRITE, &ktruio, error);
+ ktrgenio(fd, UIO_WRITE, &ktruio, error);
}
#endif
td->td_retval[0] = cnt;
@@ -509,7 +508,7 @@ writev(td, uap)
/*
* if tracing, save a copy of iovec and uio
*/
- if (KTRPOINT(td->td_proc, KTR_GENIO)) {
+ if (KTRPOINT(td, KTR_GENIO)) {
MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK);
bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen);
ktruio = auio;
@@ -534,8 +533,7 @@ writev(td, uap)
if (error == 0) {
ktruio.uio_iov = ktriov;
ktruio.uio_resid = cnt;
- ktrgenio(td->td_proc->p_tracep, uap->fd, UIO_WRITE, &ktruio,
- error);
+ ktrgenio(uap->fd, UIO_WRITE, &ktruio, error);
}
FREE(ktriov, M_TEMP);
}
diff --git a/sys/kern/uipc_syscalls.c b/sys/kern/uipc_syscalls.c
index f80dcc9..b44e644 100644
--- a/sys/kern/uipc_syscalls.c
+++ b/sys/kern/uipc_syscalls.c
@@ -578,6 +578,7 @@ sendit(td, s, mp, flags)
#ifdef KTRACE
struct iovec *ktriov = NULL;
struct uio ktruio;
+ int iovlen;
#endif
if ((error = fgetsock(td, s, &so, NULL)) != 0)
@@ -634,9 +635,8 @@ sendit(td, s, mp, flags)
control = 0;
}
#ifdef KTRACE
- if (KTRPOINT(td->td_proc, KTR_GENIO)) {
- int iovlen = auio.uio_iovcnt * sizeof (struct iovec);
-
+ if (KTRPOINT(td, KTR_GENIO)) {
+ iovlen = auio.uio_iovcnt * sizeof (struct iovec);
MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK);
bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen);
ktruio = auio;
@@ -662,7 +662,7 @@ sendit(td, s, mp, flags)
if (error == 0) {
ktruio.uio_iov = ktriov;
ktruio.uio_resid = td->td_retval[0];
- ktrgenio(td->td_proc->p_tracep, s, UIO_WRITE, &ktruio, error);
+ ktrgenio(s, UIO_WRITE, &ktruio, error);
}
FREE(ktriov, M_TEMP);
}
@@ -854,6 +854,7 @@ recvit(td, s, mp, namelenp)
#ifdef KTRACE
struct iovec *ktriov = NULL;
struct uio ktruio;
+ int iovlen;
#endif
if ((error = fgetsock(td, s, &so, NULL)) != 0)
@@ -873,9 +874,8 @@ recvit(td, s, mp, namelenp)
}
}
#ifdef KTRACE
- if (KTRPOINT(td->td_proc, KTR_GENIO)) {
- int iovlen = auio.uio_iovcnt * sizeof (struct iovec);
-
+ if (KTRPOINT(td, KTR_GENIO)) {
+ iovlen = auio.uio_iovcnt * sizeof (struct iovec);
MALLOC(ktriov, struct iovec *, iovlen, M_TEMP, M_WAITOK);
bcopy((caddr_t)auio.uio_iov, (caddr_t)ktriov, iovlen);
ktruio = auio;
@@ -895,7 +895,7 @@ recvit(td, s, mp, namelenp)
if (error == 0) {
ktruio.uio_iov = ktriov;
ktruio.uio_resid = len - auio.uio_resid;
- ktrgenio(td->td_proc->p_tracep, s, UIO_READ, &ktruio, error);
+ ktrgenio(s, UIO_READ, &ktruio, error);
}
FREE(ktriov, M_TEMP);
}
diff --git a/sys/kern/vfs_lookup.c b/sys/kern/vfs_lookup.c
index bb58983..8e4af42 100644
--- a/sys/kern/vfs_lookup.c
+++ b/sys/kern/vfs_lookup.c
@@ -139,8 +139,11 @@ namei(ndp)
}
ndp->ni_loopcnt = 0;
#ifdef KTRACE
- if (KTRPOINT(p, KTR_NAMEI))
- ktrnamei(p->p_tracep, cnp->cn_pnbuf);
+ if (KTRPOINT(td, KTR_NAMEI)) {
+ KASSERT(cnp->cn_thread == curthread,
+ ("namei not using curthread"));
+ ktrnamei(cnp->cn_pnbuf);
+ }
#endif
/*
OpenPOWER on IntegriCloud