On Fri, Jul 29, 2011 at 5:26 AM, Vaibhav Jain <span dir="ltr"><<a href="mailto:vjoss197@gmail.com">vjoss197@gmail.com</a>></span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex;">
<div>Hi,</div>
<div> </div>
<div>Is there any other way to do this? If I need to write a kernel module that needs to get cpu utilization </div>
<div>should I still use proc/stat ? Is there a kernel function that can be used in a module ?</div>
<div> </div>
<div>Thanks</div>
<div>Vaibhav Jain <font color="#888888"></font><br></div></blockquote><div> </div></div>The kernel writes all cpu metrics and more to /proc/stat. I/O data goes
to /proc/diskstat and memory to /proc/vmstat. Top and other tools
interpret the counters written to these files.<br clear="all">
<br>
You can also look at hardware performance counters, as used by the perf utility.<br>
<div>--<br>Raghu S Udiyar<br></div>