home *** CD-ROM | disk | FTP | other *** search
- Path: sparky!uunet!spool.mu.edu!olivea!decwrl!deccrl!news.crl.dec.com!dbased.nuo.dec.com!nntpd.lkg.dec.com!nntpd2.cxo.dec.com!nabeth!alan
- From: alan@nabeth.cxo.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
- Newsgroups: comp.unix.ultrix
- Subject: Re: Need code to find process information on ultrix
- Message-ID: <1992Dec16.203541.19325@nntpd2.cxo.dec.com>
- Date: 16 Dec 92 20:35:41 GMT
- References: <1992Dec16.130854.4607@rdg.dec.com>
- Sender: alan@nabeth (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
- Reply-To: alan@nabeth.cxo.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
- Organization: Digital Equipment Corporation
- Lines: 39
-
-
- In article <1992Dec16.130854.4607@rdg.dec.com>, millson@mrsun.reo.dec.com (Martin Millson) writes:
- >
- >--
- >Hi,
- >
- > I am looking for some code that will return the total number of page
- >faults , number i/os that a process has done on a ultrix system given its pid
- >upto the current point in time the code gets this information. I would like
- >to use it to snapshot a process before I run some tests and then snapshot
- >it after the tests and use the data returned to work out the difference
- >between the two snapshots.
-
- The information you want is in the data structure described in the
- getrusage(2) manual page. Unfortunately this system call will only
- get the information for the process itself or for it's children.
- The C-shell time built-in will get some of the information you
- want when you run the command. The output can be formatted however
- you want it.
-
- To do this in a general way for any process you'd have to open /dev/kmem,
- track down the proc structure for the process in which you are interested
- and pull out the parts of the rusage structure that you want. This is
- actually pretty straight-forward since the proc table is easy to examine
- (compared to the user structure).
-
- The pid= option of Monitor does this. You can get the sources from
- gatekeeper.dec.com:/pub/DEC/monitor.tar.Z and see how it is done.
- >
- >
- >Thanks
- >
- >Martin
- >
- >--------------------------------------------------------------------------------
- >Martin "Morgul" Millson
- >
- --
- Alan Rollow alan@nabeth.cxo.dec.com
-