CPU information on Solaris is obtained using the kstat (kernel statistics) system API.
Basic CPU information about the chip can be obtained using the kstat command-line utility:
kstat -m cpu_info
CPU usage details are stored in kstat as an incrementing count of "ticks", with a seperate count for each CPU state (idle,user,kernel,wait). When a CPU spends a tick in a particular state, this count is incremented. To calculate CPU usage Netprobe computes the difference in tick counts from the values recorded at the previous sample. These figures then represent the CPU details for the sample period, and are displayed to the user as percentages of the total tick count.
For example (fake figures):
Therefore for the period of 20s from 12:20:00 to 12:20:20 the CPU performed:
As percentages, these figures are:
*idle (31/65*100) = 47.7% *user (15/65*100) = 23.0% *kernel (8/65*100) = 12.3% *wait (11/65*100) = 17.0%
Figures for the Average_cpu row are computed by summing all tick counts for physical CPUs, and performing the calculations as per the above.
The raw (uncomputed) tick count figures can also be obtained from the command line. The command to run is:
kstat -m cpu_stat