Path: utzoo!utgpu!news-server.csri.toronto.edu!mailrus!cs.utexas.edu!samsung!zaphod.mps.ohio-state.edu!swrinde!ucsd!pacbell.com!pacbell!sactoh0!jak From: jak@sactoh0.UUCP (Jay A. Konigsberg) Newsgroups: comp.unix.wizards Subject: Re: Getting CPU information on unterminatted child processes Message-ID: <3688@sactoh0.UUCP> Date: 11 Aug 90 09:43:04 GMT References: <1990Aug7.215320.13715@mozart.amd.com> Reply-To: jak@sactoh0.UUCP (Jay A. Konigsberg) Organization: SAC-UNIX, Sacramento, Ca. Lines: 29 In article <1990Aug7.215320.13715@mozart.amd.com> leight@mozart.amd.com (Timothy Leight) writes: >I am interested in getting accurate cpu usage information >on unterminated child processes. The getrusage() and/or times() >system calls only return information on terminated children. > >What is the best method for getting this information? > Well, I don't know the best method, but I think I can point you in the right direction (since no one else did). ps -lf will provide much of the information needed, though it may not produce enough and any way you invoke it (peopen or shell script), it will be slow. Another aproach is to get the information directly out of /dev/kmem. However, all I know how to do there is get overall system usage parameters. Specific information of /dev/kmem is probably system specific and un-portable. However, the Sys V and Xenix 2.3.? header file is: /usr/include/sys/sysinfo.h Getting information about kernel level data structures on the net is a little like asking for the moon, no one seems to have it. Anyway, perhaps this post will generate a little discussion. I would like to know more specifics about the Sys V kernel myself. -- ------------------------------------------------------------- Jay @ SAC-UNIX, Sacramento, Ca. UUCP=...pacbell!sactoh0!jak If something is worth doing, its worth doing correctly.