Subject: Re: truss-like command for netbsd
To: Duncan McEwan <duncan@MCS.VUW.AC.NZ>
From: der Mouse <mouse@Rodents.Montreal.QC.CA>
List: current-users
Date: 10/14/1998 10:32:07
> I recall a little while ago there was a discussion on one of the
> netbsd lists about a command that behaved like the System V truss,
> rather than netbsd's ktrace (ie, wrote text representation of system
> calls to stdout by default).

Yeah, I've got something of the sort.  I implemented PTRACE_SYSCALL and
adapted my SunOS trc command to NetBSD.  But see below.

> (I'm trying to track down why XFree86 3.3.2 causes a Pentium II to
> reboot when the X server starts up and I thought that a truss-like
> command might be less likely to lose buffered information when the
> system fell over).

Well...maybe.  You'd need to use unbuffered output, and make sure the
disks got synced on crash.  Alternatively, set up a tty line so that
write() doesn't return until all bytes have been output (this may
require jiggering the driver, or it may be enough to arrange for
userland to do a "drain" ioctl after each write) and have it send its
log there.

> So, did anyone write such a command or was it simply an idea floating
> around?

The former.

> If it does exist, is it in netbsd-current, or in the pkgsrc?

No.  It's mostly on hold at the moment.  My non-computer life has been
and is being very stressful and time-consuming, and while the code I
have works on the sun3 and sparc (or at least worked last time I tried
it), it is not ready to go into the tree for various reasons.  I have a
list of things that need to be done for it to get it tree-ready, and
when my non-computer life becomes less draining I intend to pick it up
again and do them.

Alternatively, if someone else wants to pick it up and get it
tree-ready, I'll be glad to send off what I have - *that* I *do* have
time to do. :-)

Note that PTRACE_SYSCALL requires a small amount of MD support.  I have
this support implemented for sun3 and sparc (or at least did), but no
other architectures.  It would probably be relatively easy for someone
familiar with another machine to add the relevant support based on the
stuff I have for the Sun ports.

					der Mouse

			       mouse@rodents.montreal.qc.ca
		     7D C8 61 52 5D E7 2D 39  4E F1 31 3E E8 B3 27 4B