Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 18 Feb 2008 22:12:43 +1030
From:      "Daniel O'Connor" <doconnor@gsoft.com.au>
To:        Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= <des@des.no>
Cc:        Kostik Belousov <kostikbel@gmail.com>, freebsd-current@freebsd.org, Giorgos Keramidas <keramida@freebsd.org>
Subject:   Re: [src] cvs commit: src/include unistd.h src/lib/libc/sys readlink.2 src/sys/compat/freebsd32 syscalls.master src/sys/kern syscalls.master vfs_syscalls.c src/sys/sys syscallsubr.h
Message-ID:  <200802182212.45377.doconnor@gsoft.com.au>
In-Reply-To: <86pruu7dc8.fsf@ds4.des.no>
References:  <200802122009.m1CK94Y8026959@repoman.freebsd.org> <200802181513.42681.doconnor@gsoft.com.au> <86pruu7dc8.fsf@ds4.des.no>

next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart19102424.6xQeb0Q0rm
Content-Type: text/plain;
  charset="utf-8"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline

On Mon, 18 Feb 2008, Dag-Erling Sm=C3=B8rgrav wrote:
> "Daniel O'Connor" <doconnor@gsoft.com.au> writes:
> > Giorgos Keramidas <keramida@freebsd.org> writes:
> > > Specifying stdout may be a bit tricky, since the traced
> > > application may be using the same stream to print output.  The
> > > same is possible with stderr, but may be a tiny bit less likely.
> >
> > I didn't realise that the file descriptor used to write tracing
> > data out was 'owned' by the process being traced, I always thought
> > ktrace did.
>
> ktrace does absolutely nothing other than enable tracing and exec the
> application.  The 'k' in "ktrace" means "kernel".

Yes..

> > I did have a look at the source and the file opening etc is handled
> > by the kernel but I am not sure who 'owns' that file descriptor.
>
> There is no file descriptor.  There is a vnode in the kernel which is
> not listed in the traced process's file table.  This is the whole
> point of ktrace: it is undetectable by the traced process.

I thought it was undetectable but I was willing to learn, I guess I was=20
right originally :)

> > I guess it couldn't be moved to ktrace without rearchitecting how
> > ktracing works so the ktrace process sticks around writing stuff
> > out to disk.
>
> ...which would make it just as useless as truss, since it would
> (among other things) change the way job control works for the traced
> process.

I don't see why, I thought that if you had to specify an FD then it=20
could be one owned by ktrace rather than the tracing process, however=20
that was based on an incorrect assumption so it is not relevant.

=2D-=20
Daniel O'Connor software and network engineer
for Genesis Software - http://www.gsoft.com.au
"The nice thing about standards is that there
are so many of them to choose from."
  -- Andrew Tanenbaum
GPG Fingerprint - 5596 B766 97C0 0E94 4347 295E E593 DC20 7B3F CE8C

--nextPart19102424.6xQeb0Q0rm
Content-Type: application/pgp-signature; name=signature.asc 
Content-Description: This is a digitally signed message part.

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2.0.4 (FreeBSD)

iD8DBQBHuW815ZPcIHs/zowRAkhuAJ9uapz6PTf9WtZcRhKR3bw/SG96DgCgm3Zq
kwjOsf07dhvhRTZqApxHlbA=
=JDbG
-----END PGP SIGNATURE-----

--nextPart19102424.6xQeb0Q0rm--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200802182212.45377.doconnor>