Showing results for 
Search instead for 
Did you mean: 

WCHAN field in ps


WCHAN field in ps

How can I know the process is waiting for what/or blocked from somebody?
WCHAN field in ps?

tks a lot
Bharat Katkar
Honored Contributor

Re: WCHAN field in ps

WCHAN indicates the event for which process is wating, if hypen is placed in that field the process is not waiting or sleeping.

I think that should help U.
You need to know a lot to actually know how little you know
Kent Ostby
Honored Contributor

Re: WCHAN field in ps

WCHAN stands for "wait channel".

The value listed by the ps command shows a hexidecimal address of the resource that you are waiting or sleeping on.

Best regards,

Kent M. Ostby
"Well, actually, she is a rocket scientist" -- Steve Martin in "Roxanne"
Navin Bhat_2
Trusted Contributor

Re: WCHAN field in ps

If your goal is to find out what the process is blocked on/ waited on then try using glance as a first step, go into the process details and you could see what it is blocked on or the wait's on.

You could use wchan also to get the function it was waiting on using adb. Again know what you are going for, there could be multiple threads/process waiting on the same wchan. If you need further assistance you could open a support call into HP.

Mike Stroyan
Honored Contributor

Re: WCHAN field in ps

The WCHAN value is not a function address. It is actually the address that was passed into a call to sleep() in the kernel. It should later be used in a call to wakeup().

The WCHAN address is sometimes a global variable with a name that you could match to some particular driver or system call. At other times it is an allocated address that has no particular meaning outside of the kernel code that is making those calls.

You can get a look at what symbol a WCHAN value maps to using adb to print it as a symbolic address. Here is a little script that looks at the WCHAN values of all the processes on the system.

for a in $(UNIX95=1 /usr/bin/ps -e -o wchan | sort | uniq)
print "0x$a?a"
done | adb /stand/vmunix