From owner-freebsd-hackers Sun May 21 18: 6:22 2000 Delivered-To: freebsd-hackers@freebsd.org Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (Postfix) with ESMTP id 6362737B888 for ; Sun, 21 May 2000 18:06:14 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.9.3/8.9.3) id UAA14010; Sun, 21 May 2000 20:06:07 -0500 (CDT) (envelope-from dan) Date: Sun, 21 May 2000 20:06:06 -0500 From: Dan Nelson To: Christian Weisgerber Cc: freebsd-hackers@FreeBSD.ORG Subject: Re: truss -f, updated patch Message-ID: <20000521200606.F12386@dan.emsphone.com> References: <20000521002953.A5031@sharmas.dhs.org> <8g8ksb$lf2$1@bigeye.rhein-neckar.de> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline User-Agent: Mutt/1.2i In-Reply-To: <8g8ksb$lf2$1@bigeye.rhein-neckar.de>; from "Christian Weisgerber" on Sun May 21 14:30:03 GMT 2000 X-OS: FreeBSD 5.0-CURRENT Sender: owner-freebsd-hackers@FreeBSD.ORG Precedence: bulk X-Loop: FreeBSD.ORG In the last episode (May 21), Christian Weisgerber said: > Arun Sharma wrote: > > > http://sharmas.dhs.org/~adsharma/projects/freebsd/truss-diff.gz > > Those gratuitous whitespace and formatting changes are a pain... > > Related question: > Currently, truss does very little parsing of syscall arguments. > That table in syscalls.c looks anemic. Is there any interest in > expanding this? I guess that's something I could take on, as it > appears to be mostly grunt work. I had worked on this a little, but had too much trouble keeping the binary compatible with our emulation code. Also printing syscall args can get pretty hairy if you want to do it *right*. Here's a snippet of an email I sent to another guy that was interested in rewriting truss, about 6 months ago: Specifiers are nice for the simple types, like int, float, and string, but how do you specify that a sycall takes a pointer to a struct timeval, without actually writing "struct timeval *"? You end up rewriting the contents of syscalls.master :) Although you *do* need to specify somewhere which arguments are IN/OUT/BOTH. Like stat(). You only want to print the "struct stat" contents after the syscall has returned. The opposite is the case for utimes(). You want to print the "struct timeval" before the call. Then you have functions like poll() or select(), that modify a structure, so you need to print it before and after. I had patterened my code after a free version of truss for Digital Unix. -- Dan Nelson dnelson@emsphone.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-hackers" in the body of the message