Usage percentages of each Cpu in a SMP system

Submitted by Unbeliever
on September 3, 2006 - 7:52am

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.