From mboxrd@z Thu Jan 1 00:00:00 1970 From: j.neuschaefer@gmx.net (Jonathan =?utf-8?Q?Neusch=C3=A4fer?=) Date: Fri, 29 Jul 2011 21:15:42 +0200 Subject: How to get cpu utilization through code with least overhead? In-Reply-To: References: Message-ID: <20110729191541.GA2266@debian.debian> To: kernelnewbies@lists.kernelnewbies.org List-Id: kernelnewbies.lists.kernelnewbies.org 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