Thread (7 messages) 7 messages, 4 authors, 2011-07-30

How to get cpu utilization through code with least overhead?

From: Vaibhav Jain <hidden>
Date: 2011-07-30 16:29:43

Thanks !!
I looked at the code for top command again and I could see /proc/stat being
used. So I guess
that should be the best way to do it.


On Fri, Jul 29, 2011 at 12:15 PM, Jonathan Neusch?fer <j.neuschaefer@gmx.net
wrote:
On Thu, Jul 28, 2011 at 04:56:16PM -0700, Vaibhav Jain wrote:
quoted
Hi,

Is there any other way to do this? If I need to write a kernel module
that
quoted
needs to get cpu utilization
should I still use proc/stat ? Is there a kernel function that can be
used
quoted
in a module ?
To get the information that's shown in /proc/stat, I'd suggest having a
look at fs/proc/stat.c in the kernel tree.

HTH,
        Jonathan Neusch?fer
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.kernelnewbies.org/pipermail/kernelnewbies/attachments/20110730/b9b4cbb6/attachment.html 
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help