From owner-freebsd-current@FreeBSD.ORG Mon Feb 18 04:43:59 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 336A916A419; Mon, 18 Feb 2008 04:43:59 +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 521BF13C448; Mon, 18 Feb 2008 04:43:57 +0000 (UTC) (envelope-from doconnor@gsoft.com.au) Received: from inchoate.gsoft.com.au (inchoate.gsoft.com.au [203.31.81.30]) (authenticated bits=0) by cain.gsoft.com.au (8.13.8/8.13.8) with ESMTP id m1I4hioc014000 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Mon, 18 Feb 2008 15:13:44 +1030 (CST) (envelope-from doconnor@gsoft.com.au) From: "Daniel O'Connor" To: Giorgos Keramidas Date: Mon, 18 Feb 2008 15:13:35 +1030 User-Agent: KMail/1.9.7 References: <200802122009.m1CK94Y8026959@repoman.freebsd.org> <200802181004.21379.doconnor@gsoft.com.au> <20080218040625.GA8141@kobe.laptop> In-Reply-To: <20080218040625.GA8141@kobe.laptop> MIME-Version: 1.0 Content-Type: multipart/signed; boundary="nextPart1353809.8pjBojVj5D"; protocol="application/pgp-signature"; micalg=pgp-sha1 Content-Transfer-Encoding: 7bit Message-Id: <200802181513.42681.doconnor@gsoft.com.au> X-Spam-Score: -3.977 () ALL_TRUSTED,BAYES_00 X-Scanned-By: MIMEDefang 2.63 on 203.31.81.10 Cc: Kostik Belousov , Dag-Erling Smorgrav , freebsd-current@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 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 04:43:59 -0000 --nextPart1353809.8pjBojVj5D Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Mon, 18 Feb 2008, Giorgos Keramidas wrote: > >>> However, you still keep the file around which can be rather space > >>> consuming :( > >> > >> Yes, but it also means you can do offline analysis later. :) > >> Tradeoffs either way. > > > > Yes, but being able to specify stdout to ktrace would be really, > > really nice.. > > 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=20 was 'owned' by the process being traced, I always thought ktrace did. > It is probably easy to add an -F flag to ktrace/kdump which would > inhibit the check for a `regular' file, so you could then write: > > ( ktrace -aF -f /dev/stdout ls ) | \ > kdump -F -f /dev/stdin > > ( ktrace -aF -f /dev/stderr ls >/dev/null ) 2>&1 | \ > kdump -F -f /dev/stdin > > But the first will probably fail when kdump tries to parse the output > of ls(1), and the second may fail in a similar manner when kdump > tries to parse an error message like a ktrace record. > > This sort of difficulty in separating the output of the traced > process and the ktrace records themselves is probably at least part > of the reason why nobody has done it yet. I did have a look at the source and the file opening etc is handled by=20 the kernel but I am not sure who 'owns' that file descriptor. If, as you suggest, it is the process being traced then yes it would=20 cause problems. I guess it couldn't be moved to ktrace without rearchitecting how=20 ktracing works so the ktrace process sticks around writing stuff out to=20 disk. =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 --nextPart1353809.8pjBojVj5D 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) iD8DBQBHuQz+5ZPcIHs/zowRAraHAKCakJJ2Feljucdt/t+LkfmewUt0XwCgib2i LiJ6naAWz9a3Zzue5zR6bUc= =avaK -----END PGP SIGNATURE----- --nextPart1353809.8pjBojVj5D--