Operating System - HP-UX
1820591 Members
1959 Online
109626 Solutions
New Discussion юеВ

Showing process threads with /usr/bin/ps command

 
Johan Brusche
Honored Contributor

Showing process threads with /usr/bin/ps command

+
It would be nice if HP-UX had an argument to the /usr/bin/ps command to display process threads, like for instance Tru64's "ps -Am"

On Solaris also there is a ps argument to obtain that info.

Any alternatives that do NOT involve Glance ?

Rgds,
__ Johan.

_JB_
6 REPLIES 6
Robert-Jan Goossens
Honored Contributor

Re: Showing process threads with /usr/bin/ps command

Hi Johan,

something like this?
# UNIX95= ps -xC java

Regards,
Robert-Jan
Johan Brusche
Honored Contributor

Re: Showing process threads with /usr/bin/ps command


That shows the java process, but not it's threads.

More something like this (from p4)

PID PPID TID's KT_STAT KT_WCHAN SYS_CALL COMMAND
----- ----- ------- -------- -------- -------- -------
2700 1 3021 TSSLEEP 0xe00000012a83b080 /opt/OV/nonOV/jdk/a/bin/IA64N/java -DovtomcatA -Djava.awt.headless=true -Xms256m -Xmx512m -Djava.endorsed.dirs=/opt/OV/nonOV/tomcat/a/common/endorsed -classpath /opt/OV/nonOV/jdk/a/lib/tools.jar:/opt/OV/nonOV/tomcat/a/bin/bootstrap.jar:/opt/OV/nonOV/tomcat/a/bin/commons-logging-api.jar -Dcatalina.base=/opt/OV/nonOV/tomcat/a -Dcatalina.home=/opt/OV/nonOV/tomcat/a -Djava.io.tmpdir=/opt/OV/nonOV/tomcat/a/temp org.apache.catalina.startup.Bootstrap start
3044 TSSLEEP 0xe0000001368f7d80
3147 TSSLEEP 0xe000000136d98f40
3160 TSSLEEP 0xe000000136da7c40
3161 TSSLEEP 0xe000000136daac80
3162 TSSLEEP 0xe0000001367fce40
3163 TSSLEEP 0xe000000136d8df00
3164 TSSLEEP 0xe00000013698dec0
3165 TSSLEEP 0xe000000136df9cc0
3166 TSSLEEP 0xe000000136dfad00
3167 TSSLEEP 0xe000000136dfc698
3291 TSSLEEP 0xe000000136dfd6d8
3292 TSSLEEP 0xe0000001367b4d80
3293 TSSLEEP 0xe000000136983e80
3294 TSSLEEP 0xe000000136f82c40


Johan.

_JB_
Venkatesh BL
Honored Contributor

Re: Showing process threads with /usr/bin/ps command

I think Glance is the only official alternative.
Steven E. Protter
Exalted Contributor

Re: Showing process threads with /usr/bin/ps command

Shalom,

http://www.hpux.ws/?p=8

Might be some things you like in the memory leak scripts.

SEP
Steven E Protter
Owner of ISN Corporation
http://isnamerica.com
http://hpuxconsulting.com
Sponsor: http://hpux.ws
Twitter: http://twitter.com/hpuxlinux
Founder http://newdatacloud.com
Dennis Handly
Acclaimed Contributor

Re: Showing process threads with /usr/bin/ps command

Here is a previous thread with possible workarounds:
http://forums.itrc.hp.com/service/forums/questionanswer.do?threadId=1224393
Emil Velez
Honored Contributor

Re: Showing process threads with /usr/bin/ps command

This will print out thread information every 10 seconds. You can just print it out once by removing the -j option. There are many other thread metrics you can print out instead of these.

# cat thread1
print " "
print "Date: ",GBL_STATDATE,"Time: ",
GBL_STATTIME
thread loop
print THREAD_THREAD_ID,THREAD_PROC_NAME,
THREAD_PROC_ID,THREAD_RUN_TIME,THREAD_STATE,
THREAD_CPU_TOTAL_TIME

root@r204c56 [/root]
# glance -adviser_only -syntax ./thread1 -j 10