[comp.unix.internals] Swap Data for SUN OS

dan@kfw.COM (Dan Mick) (10/03/90)

In article <1990Oct1.194009.2990@ecn.purdue.edu> songer@orchestra.ecn.purdue.edu (Christopher M Songer) writes:
>Hi,
>     I want to read the amount of data swapped out to disk by the machine
>at a given time. I want this data by disk. ie, I want to know that hd1
>has got x meg swapped out and hd0 has y meg, etc. I'm having trouble 
>finding out what symbols to pull out of the kernal. Heck, I'm not even
>sure what struct type has got the info I'm looking for. I'm running
>SUN OS version 4.0.3. I've already got the disk names, etc, I just
>need the swap data.
>     If someone knows, or can point me in the right direction I could
>sure be saved alot of time looking through the kernal source. I'll be 
>greatly appreciative for any help I can get on this one. Thanks.

Well, pstat -s reports it, and it gets it from struct anoninfo anoninfo.
This struct seems to be defined in /usr/include/vm/anon.h.  It's not 
per-disk, though; if you need per-disk, each disk vp set up for swap
is noted in struct swapinfo *swapinfo, which is defined in
/usr/include/vm/swap.h.  You'll probably have to chase the free list 
yourself, using (again) /usr/include/vm/anon.h.