LinuxQuestions.org
Did you know LQ has a Linux Hardware Compatibility List?
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Distributions
User Name
Password
Linux - Distributions This forum is for Distribution specific questions.
Red Hat, Slackware, Debian, Novell, LFS, Mandriva, Ubuntu, Fedora - the list goes on and on... Note: An (*) indicates there is no official participation from that distribution here at LQ.

Notices

Reply
 
Search this Thread
Old 03-30-2011, 04:53 PM   #1
sbauer72
Member
 
Registered: Mar 2011
Posts: 36

Rep: Reputation: 0
top calculations


ALL,

does anyony know how top calculates the %idle and % cpu usage?

I am curious about what files it uses.
 
Old 03-30-2011, 04:54 PM   #2
corp769
Guru
 
Registered: Apr 2005
Posts: 5,814

Rep: Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001Reputation: 1001
It uses the /proc/stat file.
See here: http://colby.id.au/node/39
 
Old 04-01-2011, 09:54 PM   #3
sbauer72
Member
 
Registered: Mar 2011
Posts: 36

Original Poster
Rep: Reputation: 0
corp769,

Thank you for your help. I am just getting started with shell scripting so what you gave you really helped.

Where did you get the formulas to calculate the usage and difference? I am just curious.
 
  


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
Date calculations on Sun sparc ukursat Linux - Newbie 1 12-05-2008 11:01 PM
threads for mathematical calculations? skywalker27182 Programming 3 02-13-2005 11:25 AM
need help with pi calculations! daven1 Programming 2 01-06-2005 08:21 PM
Date calculations in BASH script Crashman Programming 4 07-03-2004 11:15 AM
EIGRP and IGRP metric calculations dai Linux - Networking 1 12-16-2002 03:59 PM


All times are GMT -5. The time now is 02:50 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration