Date: Mon, 24 Jul 2006 13:10:44 +0100 (BST) From: Robert Watson <rwatson@FreeBSD.org> To: Greg 'groggy' Lehey <grog@FreeBSD.org> Cc: Tom Rhodes <trhodes@FreeBSD.org>, src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, Xin LI <delphij@FreeBSD.org>, Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= <des@des.no> Subject: Re: truss status (was: cvs commit: src/sys/dev/lmc if_lmc.h) Message-ID: <20060724130731.D44945@fledge.watson.org> In-Reply-To: <20060724000259.GE16230@wantadilla.lemis.com> References: <200607210845.k6L8j0Ep026008@repoman.freebsd.org> <20060721062609.356f090f.trhodes@FreeBSD.org> <8664hrtcv1.fsf@xps.des.no> <20060724000259.GE16230@wantadilla.lemis.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On Mon, 24 Jul 2006, Greg 'groggy' Lehey wrote: > On Friday, 21 July 2006 at 13:29:38 +0200, Dag-Erling Smrgrav wrote: >> Tom Rhodes <trhodes@FreeBSD.org> writes: >>> Wait. I'm lost. Isn't truss(1) broken on FreeBSD? >> >> Depends on your definition of broken. It kind of works provided you have >> /proc mounted. Still, there's really not much point in using it; ktrace(1) >> is better in almost all respects. > > truss is good in that it gives immediate output. I used it recently under > 6.1, and I somehow missed that it was broken. A few things are wrong with truss, none that make it completely broken: (1) In the past there were a number of reports of problems with race conditions during truss attach/detach. These reports have entirely disappeared, as far as I can tell, due to process locking fixes, procfs fixes, debugging fixes, etc. If they still exist, they should be investigated, but up-to-date debugging infomation will be needed. (2) truss relies on procfs, which is known to be evil, and as such, doesn't work out of the box since we don't mount procfs out of the box. Several people have worked on enhancing ptrace() so that it can be used to implement truss, but no one has finished this work. I think the necessary ptrace() traps now exist for system calls so that this could be done. (3) truss is believed not to work properly with threaded applications. ktrace has been extended to know about thread IDs, and has always been able to generate traces properly for threaded apps, whereas truss likely doesn't see events from more than one thread (or if it does, it likely gets very mixed up). It might be good to confirm this. Robert N M Watson Computer Laboratory University of Cambridge
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20060724130731.D44945>