Updated procstat(1)

Robert Watson rwatson at FreeBSD.org
Tue Nov 27 09:35:09 PST 2007


Dear all,

I've updated the procstat(1) kernel patch and userland tool; the updated 
version can be found at:

   http://www.watson.org/~robert/freebsd/20071127-procstat.tgz

The new version includes a number of changes from the old version, including:

- A number of bug fixes and cleanliness improvements in the layout of output,
   etc, including fixes for bugs reported by Skip Ford.

- "-a" now means "all processes", and the old -a has become -c, and the old -c
   has become -s.  I.e., "All", "Command line" and "Security" rather than
   "Args" and "Credential".

- Threads and processes are now sorted by pid and then tid.  If processes are
   specified manually by pid, they are not sorted, although their threads will
   be.

- A new "-k" has been added, which prints the kernel thread stacks for threads
   in a process (although not swapped out or actively running threads).  This
   is extremely useful for answering questions of the sort "But *why* is the
   process blocked in UMA".  It has both a simple mode (-k_, which lists just
   kernel function names, and a slightly more detailed mode (-kk), which adds
   the offset into the function.

The last of these required new kernel changes, including an MD component. 
I've tested the MD parts only on i386, although I have quick hacks at what 
they should look like on amd64, arm, powerpc, sparc64, sun4v.  I don't promise 
these compile or work, but they might do.

I think procstat(1) is getting a lot closer to commitable state for 8-CURRENT, 
but further feedback would be most welcome (including reports of success on 
non-i386 architectures, and possibly patches to fix them).  For FreeBSD 
developers with P4 access, you can also check out

   //depot/user/rwatson/procstat/...

Robert N M Watson
Computer Laboratory
University of Cambridge


More information about the freebsd-hackers mailing list