freebsd-dev/usr.bin/procstat
Peter Wemm 43151ee6cf Merge user/peter/kinfo branch as of r185547 into head.
This changes struct kinfo_filedesc and kinfo_vmentry such that they are
same on both 32 and 64 bit platforms like i386/amd64 and won't require
sysctl wrapping.

Two new OIDs are assigned.  The old ones are available under
COMPAT_FREEBSD7 - but it isn't that simple.  The superceded interface
was never actually released on 7.x.

The other main change is to pack the data passed to userland via the
sysctl.  kf_structsize and kve_structsize are reduced for the copyout.
If you have a process with 100,000+ sockets open, the unpacked records
require a 132MB+ copyout.  With packing, it is "only" ~35MB.  (Still
seriously unpleasant, but not quite as devastating).  A similar problem
exists for the vmentry structure - have lots and lots of shared libraries
and small mmaps and its copyout gets expensive too.

My immediate problem is valgrind.  It traditionally achieves this
functionality by parsing procfs output, in a packed format.  Secondly, when
tracing 32 bit binaries on amd64 under valgrind, it uses a cross compiled
32 bit binary which ran directly into the differing data structures in 32
vs 64 bit mode.  (valgrind uses this to track file descriptor operations
and this therefore affected every single 32 bit binary)

I've added two utility functions to libutil to unpack the structures into
a fixed record length and to make it a little more convenient to use.
2008-12-02 06:50:26 +00:00
..
Makefile Merge user/peter/kinfo branch as of r185547 into head. 2008-12-02 06:50:26 +00:00
procstat_args.c Add 'COMM' column to a few more output modes of procstat(1). The only 2007-12-10 20:55:43 +00:00
procstat_basic.c WARNS fixes: mainly constness and avoid comparing signed with 2008-02-08 11:03:05 +00:00
procstat_bin.c Add 'COMM' column to a few more output modes of procstat(1). The only 2007-12-10 20:55:43 +00:00
procstat_cred.c Add 'COMM' column to a few more output modes of procstat(1). The only 2007-12-10 20:55:43 +00:00
procstat_files.c Merge user/peter/kinfo branch as of r185547 into head. 2008-12-02 06:50:26 +00:00
procstat_kstack.c WARNS fixes: mainly constness and avoid comparing signed with 2008-02-08 11:03:05 +00:00
procstat_threads.c WARNS fixes: mainly constness and avoid comparing signed with 2008-02-08 11:03:05 +00:00
procstat_vm.c Merge user/peter/kinfo branch as of r185547 into head. 2008-12-02 06:50:26 +00:00
procstat.1 Integrate the new MPSAFE TTY layer to the FreeBSD operating system. 2008-08-20 08:31:58 +00:00
procstat.c WARNS fixes: mainly constness and avoid comparing signed with 2008-02-08 11:03:05 +00:00
procstat.h