[SunHELP] actual, not average CPU load?

Sebastien DAUBIGNE sebastien.daubigne at atosorigin.com
Tue Mar 7 07:35:32 CST 2006


Valery Yankin a icrit :
> owly goes down instead of dropping. Why?" So I guess I need to make it clear fo
> r the colleagues that this is the way `ps` measures the CPU load time.
>
> The problem is, I am using sort of a factory-tailored Solaris installation with
>  a fixed set of tools, and it is forbidden to install anything else. So, no pkg
> _add for me.
>   

You can use Solaris standard commad "truss -cfp" to get theses figures.
You can get CPU time in kernel and userland, and for each syscall 
precisely, with a little performance drop, e.g :

#truss -cfp 9406
^Csyscall              seconds   calls  errors
write                    .00       3
yield                    .00       5
pread                    .19    1283
                     -------  ------   ----
sys totals:              .19    1291      0
usr time:                .51
elapsed:                8.82


Then  you can compute the CPU load for this process ((sys+usr)/elapsed).


You can start it evey 30 seconds and get the figures

Here is a sample scipt that will display the truss output every 30 seconds :

#!/bin/ksh

while : ; do
  truss -cfp <pid_of_process_to_monitor> &
  trusspid=$!
  trap "kill $trusspid ; exit" INT QUIT
  sleep 30
  date
  kill $trusspid
done


-- 
Sebastien DAUBIGNE
Sebastien.daubigne at atosorigin.com - +33(0)5.57.26.56.36
AtosOrigin Infogerance - IMS/ERP/Pessac



More information about the SunHELP mailing list