home *** CD-ROM | disk | FTP | other *** search
/ NetNews Usenet Archive 1992 #30 / NN_1992_30.iso / spool / comp / unix / ultrix / 8914 < prev    next >
Encoding:
Internet Message Format  |  1992-12-16  |  2.1 KB

  1. 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
  2. From: alan@nabeth.cxo.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
  3. Newsgroups: comp.unix.ultrix
  4. Subject: Re: Need code to find process information on ultrix
  5. Message-ID: <1992Dec16.203541.19325@nntpd2.cxo.dec.com>
  6. Date: 16 Dec 92 20:35:41 GMT
  7. References: <1992Dec16.130854.4607@rdg.dec.com>
  8. Sender: alan@nabeth (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
  9. Reply-To: alan@nabeth.cxo.dec.com (Alan Rollow - Alan's Home for Wayward Tumbleweeds.)
  10. Organization: Digital Equipment Corporation
  11. Lines: 39
  12.  
  13.  
  14. In article <1992Dec16.130854.4607@rdg.dec.com>, millson@mrsun.reo.dec.com (Martin Millson) writes:
  15. >
  16. >--
  17. >Hi,
  18. >
  19. >    I am looking for some code that will return the total number of page
  20. >faults , number i/os that a process has done on a ultrix system given its pid
  21. >upto the current point in time the code gets this information. I would like
  22. >to use it to snapshot a process before I run some tests and then snapshot
  23. >it after the tests and use the data returned to work out the difference 
  24. >between the two snapshots.
  25.  
  26. The information you want is in the data structure described in the
  27. getrusage(2) manual page.  Unfortunately this system call will only
  28. get the information for the process itself or for it's children.
  29. The C-shell time built-in will get some of the information you
  30. want when you run the command.  The output can be formatted however
  31. you want it.
  32.  
  33. To do this in a general way for any process you'd have to open /dev/kmem,
  34. track down the proc structure for the process in which you are interested
  35. and pull out the parts of the rusage structure that you want.  This is
  36. actually pretty straight-forward since the proc table is easy to examine
  37. (compared to the user structure).
  38.  
  39. The pid= option of Monitor does this.  You can get the sources from
  40. gatekeeper.dec.com:/pub/DEC/monitor.tar.Z and see how it is done.
  41. >
  42. >
  43. >Thanks
  44. >
  45. >Martin
  46. >    
  47. >--------------------------------------------------------------------------------
  48. >Martin "Morgul" Millson
  49. >
  50. --
  51. Alan Rollow                alan@nabeth.cxo.dec.com
  52.