|
I believe this is similar to what you read in /proc/stat on Linux. In Linux, you can read the timer ticks spent on user, system and IO, IRQ etc using /proc/stat. But you need to calculate the CPU % by adding the total time spent against each category. Generally following is a common approach. If you look at source of procps (vmstat.c) you might be able to get an idea how it's done on Linux.
All CPU = User + System + Idle time
User CPU % = User / All CPU * 100%
System CPU % = System / All CPU * 100%
But you have to check where you can place pr_cutime and pr_cstime. It looks like it's part of User time.
|