How to get cpu utilization through code with least overhead?

Vaibhav Jain vjoss197 at gmail.com
Thu Jul 28 13:38:41 EDT 2011


Hi,

I need to write code to get and record the cpu utilization in certain
interval with the least overhead.
Could anybody please advise me on how to proceed ? I tried looking at the
code for "top" command to see
how it works but couldn't figure out much.
I don't want to write script that uses commands and pulls out the results as
I want the overhead to be as small as possible.

Thanks
Vaibhav Jain
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110728/b6cc95da/attachment.html 


More information about the Kernelnewbies mailing list