On Wed, Jan 28, 2009 at 9:56 AM, Stefan Parvu <stefanparv...@yahoo.com> wrote: > Hi, > > I wrote a simple recorder script, similar with mpstat, done in Perl, > using Sun::Solaris::Kstat. The utility is found: > http://www.nbl.fi/~nbl97/solaris/perf/sdr_bin/cpurec062. Based on > Brendan's K9Toolkit, the script uses kstat to extract for each cpu > found on the system the following information: > > * timestamp: seconds since Epoch > * Xcalls: rate of multiprocessor cross calls > * Intr: rate of intrerrupts > * iThr: rate of interrupts threads > * Csw: rate of context switches > * Icsw: rate of involuntary context switches > * Migr: rate of migrations > * Smtx: rate of kernel mutexes > * Syscalls: rate of system calls > * User: percentage of time spent in user mode > * Sys: percentage of time spent in sys mode > * Idle: percentage of time spent in idle mode > > This works fine except from time to time Im able to see > situations like: user+sys+idle != 100 . Is this my bad in converting > something or simple these are the values coming from kstat !?
These are derived values and are rounded, so expecting exactly 100 isn't going to work. Accurate statistics for user/kernel/idle should be derived from: cpu::sys:cpu_nsec_kernel and the like. -- -Peter Tribble http://www.petertribble.co.uk/ - http://ptribble.blogspot.com/ _______________________________________________ perf-discuss mailing list perf-discuss@opensolaris.org