Path: utzoo!utgpu!news-server.csri.toronto.edu!rutgers!uwm.edu!zaphod.mps.ohio-state.edu!samsung!uunet!charyb!dan From: dan@kfw.COM (Dan Mick) Newsgroups: comp.unix.internals Subject: Re: Swap Data for SUN OS Message-ID: <1990Oct2.231222.17028@kfw.COM> Date: 2 Oct 90 23:12:22 GMT References: <1990Oct1.194009.2990@ecn.purdue.edu> Reply-To: dan@kfw.com (Dan Mick) Distribution: usa Organization: KFW Corporation, Newbury Park, CA Lines: 19 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.