LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 02-11-2013, 06:41 AM   #1
veena hosur
LQ Newbie
 
Registered: Feb 2013
Posts: 13

Rep: Reputation: Disabled
cpu load


how to calculate the cpu load in c for the current program? and it is possible to use kernel module if so how?
 
Old 02-11-2013, 06:48 AM   #2
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Did you mean to check load or cpu utilization by a c program? Else, explain it little more.
 
Old 02-11-2013, 06:51 AM   #3
veena hosur
LQ Newbie
 
Registered: Feb 2013
Posts: 13

Original Poster
Rep: Reputation: Disabled
i mean cpu usage of current c program in percentage.
 
Old 02-11-2013, 09:32 AM   #4
shivaa
Senior Member
 
Registered: Jul 2012
Location: Grenoble, Fr.
Distribution: Sun Solaris, RHEL, Ubuntu, Debian 6.0
Posts: 1,800
Blog Entries: 4

Rep: Reputation: 286Reputation: 286Reputation: 286
Well, you can check cpu utilization by all running processes, including your c program, using top command.
After invoking your c program, invoke top command, so you will able to see your program and it's cpu usage in list of processes shown by top.
Code:
~$ top
Hope this is what you're looking for.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
[SOLVED] High CPU load, but low CPU usage (high idle CPU) baffy Linux - Newbie 5 03-13-2013 10:24 AM
CPU load yaximik Linux - Newbie 1 02-11-2013 03:23 AM
AMD CPU Generating Way More System Load Than Intel Xeon CPU? kresyzig Programming 1 10-11-2010 10:35 AM
cpu utilization and cpu load soltanloo Linux - General 1 06-07-2009 03:19 AM
Generate alert with "CPU load average" "CPU utilization" viky Linux - Hardware 3 07-25-2007 05:24 AM


All times are GMT -5. The time now is 12:01 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration