Latest LQ Deal: Complete CCNA, CCNP & Red Hat Certification Training Bundle
Go Back > Forums > Linux Forums > Linux - Newbie
User Name
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!


  Search this Thread
Old 01-13-2011, 12:00 PM   #1
LQ Newbie
Registered: Jan 2011
Posts: 2

Rep: Reputation: 0
Listing of LWP for a PID

Hello ,

How do we get all the LWP for a PID with cpu% and mem% and the thread id

Something equivalent as prstat -L -P pid on Solaris which lists all the threads being used with CPU% and MEM%

Thank you very much
Old 01-13-2011, 12:34 PM   #2
Registered: Dec 2010
Posts: 281

Rep: Reputation: 24

# top
Check out...
# man top
..for commands.

Once you are in top you can sort by using Shift-M for %MEM, and Shift-P for %CPU.

You can use top with a single PID..
# top -p PID
..and cat the info as needed...

Also, check out the man pages for free(), and vmstat()... might have even more info that you could use as well...
Old 01-19-2011, 11:14 AM   #3
LQ Newbie
Registered: Jan 2011
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks for the reply but my main question is how to get all the Light weight process for the PID. When i give top -p PID it gives COU MEM ETC for the PID and it will not display all the LWP of THE PID

Looking forward for the reply

Old 01-19-2011, 11:41 AM   #4
Registered: Apr 2002
Location: in a fallen world
Distribution: slackware by choice, others too :} ... android.
Posts: 23,067
Blog Entries: 11

Rep: Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911Reputation: 911
Hi, welcome to LQ!

Something like:
ps -eLo pid,lwp,pcpu,vsz,comm

Mind you, nothing a "man ps" wouldn't have revealed.



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
What is the more easier way to check the pid and kill the pid cmx08 Linux - General 5 09-09-2008 10:57 PM
reading pid from pid file in C language shifter Programming 1 05-14-2008 10:49 AM
kill pid.... won't work with 'pid' variable given.. sachitha Programming 6 03-06-2006 07:48 PM
How do I get the LWP pid of linux threads? ninelion Programming 4 08-16-2005 08:32 PM
/var/run/[XXX].pid - Tcl pid code liguorir Linux - Software 1 05-20-2004 10:32 PM > Forums > Linux Forums > Linux - Newbie

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

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