All of lore.kernel.org
 help / color / mirror / Atom feed
From: j.neuschaefer@gmx.net (Jonathan Neuschäfer)
To: kernelnewbies@lists.kernelnewbies.org
Subject: How to get cpu utilization through code with least overhead?
Date: Fri, 29 Jul 2011 21:15:42 +0200	[thread overview]
Message-ID: <20110729191541.GA2266@debian.debian> (raw)
In-Reply-To: <CAKuUYSzv22khweLX-Yz8QjCDPHO2CAnWM0VWJwqVRk7H7+SQYQ@mail.gmail.com>

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

  parent reply	other threads:[~2011-07-29 19:15 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-07-28 17:38 How to get cpu utilization through code with least overhead? Vaibhav Jain
2011-07-28 17:45 ` Mulyadi Santosa
2011-07-28 17:51   ` Vaibhav Jain
2011-07-28 23:56     ` Vaibhav Jain
2011-07-29  0:30       ` Raghu Udiyar
2011-07-29 19:15       ` Jonathan Neuschäfer [this message]
2011-07-30 16:29         ` Vaibhav Jain

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20110729191541.GA2266@debian.debian \
    --to=j.neuschaefer@gmx.net \
    --cc=kernelnewbies@lists.kernelnewbies.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.