How to get cpu utilization through code with least overhead?
From: j.neuschaefer@gmx.net (Jonathan Neuschäfer)
Date: 2011-07-29 19:15:42
From: j.neuschaefer@gmx.net (Jonathan Neuschäfer)
Date: 2011-07-29 19:15:42
On Thu, Jul 28, 2011 at 04:56:16PM -0700, Vaibhav Jain wrote:
Hi, Is there any other way to do this? If I need to write a kernel module that needs to get cpu utilization should I still use proc/stat ? Is there a kernel function that can be used 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