LinuxQuestions.org
Share your knowledge at the LQ Wiki.
Home Forums Tutorials Articles Register
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, 05: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, 05: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, 05: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, 08: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



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 09:24 AM
CPU load yaximik Linux - Newbie 1 02-11-2013 02:23 AM
AMD CPU Generating Way More System Load Than Intel Xeon CPU? kresyzig Programming 1 10-11-2010 09:35 AM
cpu utilization and cpu load soltanloo Linux - General 1 06-07-2009 02:19 AM
Generate alert with "CPU load average" "CPU utilization" viky Linux - Hardware 3 07-25-2007 04:24 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 07:42 AM.

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
Open Source Consulting | Domain Registration