From owner-freebsd-current@FreeBSD.ORG Mon Feb 18 11:43:07 2008 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 77E1F16A417; Mon, 18 Feb 2008 11:43:07 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from cain.gsoft.com.au (cain.gsoft.com.au [203.31.81.10]) by mx1.freebsd.org (Postfix) with ESMTP id 8FB5813C469; Mon, 18 Feb 2008 11:43:05 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (ppp121-45-73-250.lns10.adl6.internode.on.net [121.45.73.250]) (authenticated bits=0) by cain.gsoft.com.au (8.13.8/8.13.8) with ESMTP id m1IBgpSk026172 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 18 Feb 2008 22:12:53 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: Dag-Erling =?utf-8?q?Sm=C3=B8rgrav?= Date: Mon, 18 Feb 2008 22:12:43 +1030 User-Agent: KMail/1.9.7 References: <200802122009.m1CK94Y8026959@repoman.freebsd.org> <200802181513.42681.doconnor@gsoft.com.au> <86pruu7dc8.fsf@ds4.des.no> In-Reply-To: <86pruu7dc8.fsf@ds4.des.no> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart19102424.6xQeb0Q0rm"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200802182212.45377.doconnor@gsoft.com.au> X-Spam-Score: -2.212 () BAYES_00,RDNS_DYNAMIC X-Scanned-By: MIMEDefang 2.63 on 203.31.81.10 Cc: Kostik Belousov , freebsd-current@freebsd.org, Giorgos Keramidas 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 X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 18 Feb 2008 11:43:07 -0000 --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" writes: > > Giorgos Keramidas 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--