LinuxQuestions.org
Help answer threads with 0 replies.
Go Back   LinuxQuestions.org > Forums > Other *NIX Forums > Solaris / OpenSolaris
User Name
Password
Solaris / OpenSolaris This forum is for the discussion of Solaris and OpenSolaris.
General Sun, SunOS and Sparc related questions also go here.

Notices



Reply
 
Search this Thread
Old 03-27-2003, 11:58 AM   #1
asharma
LQ Newbie
 
Registered: Mar 2003
Posts: 3

Rep: Reputation: 0
CPU usage of a process


Hey there,
Which file has the information about a process' CPU usage ? I went as far as /proc/<pid_no>/
what next ?
 
Old 03-27-2003, 08:36 PM   #2
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
Does prstat have the info that you're looking for?
 
Old 03-27-2003, 10:38 PM   #3
nakkaya
Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
type top and it will list all the proc by their cpu usage
 
Old 03-28-2003, 01:08 AM   #4
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Quote:
Originally posted by nakkaya
type top and it will list all the proc by their cpu usage
I don't believe top is installed by default with a Solaris install, but you can install it afterwards.

You can also try a ps -e or ps -el to list your processes running which I believe will display cpu usage of running processes.
 
Old 03-28-2003, 01:11 AM   #5
nakkaya
Guru
 
Registered: Jan 2003
Location: Turkey&USA
Distribution: Emacs and linux is its device driver(Slackware,redhat)
Posts: 1,398

Rep: Reputation: 45
btw how do you know its solaris?
 
Old 03-28-2003, 10:00 AM   #6
stickman
Senior Member
 
Registered: Sep 2002
Location: Nashville, TN
Posts: 1,552

Rep: Reputation: 53
ummm... because the question was asked in the Solaris forum. And top isn't included in a default install. It might be included in the SFW packages though.

Last edited by stickman; 03-28-2003 at 10:02 AM.
 
Old 03-28-2003, 10:02 AM   #7
trickykid
Guru
 
Registered: Jan 2001
Posts: 24,133

Rep: Reputation: 199Reputation: 199
Quote:
Originally posted by nakkaya
btw how do you know its solaris?
And how do you know its not Solaris he's talking about?
I would presume it is since he seems to be posting in the Solaris Forum where I haven't seen any mistakes for members to ask something that wasn't Solaris related.
 
Old 03-29-2003, 03:17 PM   #8
asharma
LQ Newbie
 
Registered: Mar 2003
Posts: 3

Original Poster
Rep: Reputation: 0
Hi all,
Yup, iam looking for info on solaris.
The problem is, i want the information of CPU usage in a particular CPU intensive operation part of my application.

That info cannot be obtained by a utility like ps -ef or top.
I want the CPU Time usage at instant x, perform the operation and then see the CPU time used at instant 'y'.

the diff. in readings at 'y' and 'x' will gimme an idea ...
I've looked into times( ) call. But its granularity is only 1/100 of a second.
Thanks for the interest.
 
  


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
limit cpu % usage for a process student04 Linux - General 15 03-18-2014 08:22 PM
How to get %CPU usage of a process devershetty Linux - Newbie 1 08-18-2008 02:52 AM
How to get %CPU usage of a process devershetty Linux - Newbie 13 08-16-2008 12:51 PM
process cpu usage vanv101 Fedora 9 06-24-2005 06:53 PM
Limiting a process CPU usage therandomthing Linux - Software 1 06-07-2005 10:00 PM


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

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