The man page states the difference but does not explain it in detail.

CPU

   The percentage of recent CPU time used by the process. If
executing in a non-global zone and the pools facility is active, the
percentage will be that of the processors in the processor set in use
by the pool to which the zone is bound.

USR

   The percentage of time the process has spent in user mode.
SYS

   The percentage of time the process has spent in system mode.

The CPU number is the same as ps reports, its a time-decayed average
of recent CPU usage measured using clock-tick sampling. Its also
divided down by the number of CPUs in the system (or zone). So if you
see 2% on a 10CPU system its the same as 20% on a 1CPU system.

The USR and SYS numbers are proportions of wall-clock time, accurately
measured on every state transition using microstate accounting. Since
prstat runs at a given interval, they are the average over the
interval since the previous measurement. This is a much more useful
measure, and it is not divided down by the CPU count.

The output you show looks suspicious to me because process C has not
accumulated any time since starting. You should let it run for a while
and reach a steady state before trying to compare the two measures.

Adrian

On 10/19/06, Cherian Abraham <[EMAIL PROTECTED]> wrote:
Hi All,

Thanks for all the feedback.
I tried to run both prstat and prstat -m option and here are the output 
displays...
(showing only three processes).

prstat -mL
   PID USERNAME USR SYS TRP TFL DFL LCK SLP LAT VCX ICX SCL SIG PROCESS/LWPID
 25952 root      30  30 0.0 0.0 0.0 0.0  30 0.0 100  6K 87K   0 processC/1
 25571 root     5.1 0.7 0.0 0.0 0.0 0.0  93 0.0  57  68  5K   0 processB/1
  2003 root     0.3 1.2 0.1 0.0 0.0 0.0  97 1.9  67   8  1K  21 processA/1

prstat
 PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP
  2003 root       39M   38M sleep   59    0   3:05:58 0.6% processA/1
 25571 root     6488K 5752K sleep   13    0   0:00:00 0.5% processB/1
 25952 root     5208K 4184K sleep   23    0   0:00:00 0.1% processC/1

Is it possible to relate the CPU usage shown by prstat and prstat -m ? or am i 
comparing apples and oranges here ? process C shows 0.1% CPU usage (is this 
only usr time?) and microstate accounting shows 30% user time, 30% sys time and 
30% sleep. How does one relate the two ? The above is just snapshots taken 
almost at the same time.

My testing is normally done in a 2 hr time frame. So i could run prstat with 10 
sec sampling rate and prstat -m with also a 10 sec sampling rate during the 
same period. The sampling instance for both maybe slightly off. If i average 
out during this run for each process from prstat and also the same from prstat 
-m, how do i relate these values ?


This message posted from opensolaris.org
_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org

_______________________________________________
perf-discuss mailing list
perf-discuss@opensolaris.org

Reply via email to