![]() Then sleep for a second or so, and read them all again. Read both utime and stime for the process you're interested in, and read time_total from /proc/stat. You need to take the sum of the values on this line to get a time_total measure. This tells you the cumulative CPU time that's been used in various categories, in units of jiffies. You're probably after utime and/or stime. ![]() Uninterruptible wait, Z is zombie, T is traced or stopped)Ĭmin_flt number of minor faults with child'sĬmaj_flt number of major faults with child's State state (R is running, S is sleeping, D is sleeping in an These are the first few fields (from Documentation/filesystems/proc.txt in your kernel source): Table 1-3: Contents of the stat files (as of 2.6.22-rc3) You need to parse out the data from /proc//stat.
0 Comments
Leave a Reply. |