From owner-cvs-all@FreeBSD.ORG Mon Jul 24 12:10:48 2006 Return-Path: X-Original-To: cvs-all@FreeBSD.org Delivered-To: cvs-all@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id A9D7116A4E2; Mon, 24 Jul 2006 12:10:48 +0000 (UTC) (envelope-from rwatson@FreeBSD.org) Received: from cyrus.watson.org (cyrus.watson.org [209.31.154.42]) by mx1.FreeBSD.org (Postfix) with ESMTP id 968B743D5D; Mon, 24 Jul 2006 12:10:45 +0000 (GMT) (envelope-from rwatson@FreeBSD.org) Received: from fledge.watson.org (fledge.watson.org [209.31.154.41]) by cyrus.watson.org (Postfix) with ESMTP id D5D7846B3E; Mon, 24 Jul 2006 08:10:44 -0400 (EDT) Date: Mon, 24 Jul 2006 13:10:44 +0100 (BST) From: Robert Watson X-X-Sender: robert@fledge.watson.org To: Greg 'groggy' Lehey In-Reply-To: <20060724000259.GE16230@wantadilla.lemis.com> Message-ID: <20060724130731.D44945@fledge.watson.org> References: <200607210845.k6L8j0Ep026008@repoman.freebsd.org> <20060721062609.356f090f.trhodes@FreeBSD.org> <8664hrtcv1.fsf@xps.des.no> <20060724000259.GE16230@wantadilla.lemis.com> MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed Cc: Tom Rhodes , src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org, Xin LI , Dag-Erling =?iso-8859-1?Q?Sm=F8rgrav?= Subject: Re: truss status (was: cvs commit: src/sys/dev/lmc if_lmc.h) X-BeenThere: cvs-all@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the entire tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Jul 2006 12:10:48 -0000 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 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