login
Header Space

 
 

Usage percentages of each Cpu in a SMP system

September 3, 2006 - 10:52am
Submitted by Unbeliever on September 3, 2006 - 10:52am.
FreeBSD

Hi!

I need to write an app that retrieves the cpu usage of each cpu in my smp system.

Im using kvm_read() with "_cp_time" as symbol (as "top" does) to calculate the percentages. But this function gives only one array of values (maybe the average of the overall cpus).

How can i take the usage percentages of each cpu?

Thanks.

speck-geostationary