interpreting wchan

interpreting wchan

Post by michael_h.. » Sun, 22 Apr 2001 02:47:40



I'm trying to interpret the WCHAN field that's defined in sys/pstat.h in the
pst_status structure. ps(1) also returns it.

So far all i've found is that if the process status is PS_SLEEP (ie: the
process is waiting on something), then this field contains the event the
process is waiting on. Best I can tell this is the memory location of the
system call it's waiting for.

Any idea what this value might mean, or how to get something that's a bit
more
readable, like which system call it's referencing?

thanks
mike

 -----  Posted via NewsOne.Net: Free (anonymous) Usenet News via the Web  -----
  http://newsone.net/ -- Free reading and anonymous posting to 60,000+ groups
   NewsOne.Net prohibits users from posting spam.  If this or other posts

 
 
 

interpreting wchan

Post by Kevin Strietze » Sun, 22 Apr 2001 07:56:49



> I'm trying to interpret the WCHAN field that's defined in sys/pstat.h in the
> pst_status structure. ps(1) also returns it.

> So far all i've found is that if the process status is PS_SLEEP (ie: the
> process is waiting on something), then this field contains the event the
> process is waiting on. Best I can tell this is the memory location of the
> system call it's waiting for.

> Any idea what this value might mean, or how to get something that's a bit
> more
> readable, like which system call it's referencing?

The wait channel is technically an arbitrary number.  In practice, it is
usually a pointer to the data structure being slept on, not the system
call.  The data structure is typically an I/O descriptor of some sort,
such as a file system buffer header.  The only reliable way to determine
for sure the structure type is to read the source code :-( to see what
kind of pointer as the wait channel when going to sleep.

Your best bet for finding out which system call a process is sleeping in
is probably tusc or trace, depending on operating system release.  You
could also probably use Q4, the kernel de*.

By the way, multiple different wait channels are used for efficiency.
The wait channel identifies the event, and when that event occurs, all
processes sleeping with that wait channel are awoken.  Each process then
looks to see whether it really should have been awakened, and if so,
continues; but if not, goes back to sleep on the event.

--Kevin
  Not speaking for Stratus Technologies.

PS - I know SVR4 works this way, and I don't remember HP-UX differing.

 
 
 

1. How to interpret the WCHAN field of ps?

The manual says the the WCHAN field of the 'ps' command gives the reason why a
process is stopped.  However it gives a hex value.  Does anyone in the net
know how to interpret it?

Thanks in advance.

--

Computer Science Department, The Chinese University of HONG KONG

2. New Discussion Board - Merry Christmas to all :-)

3. How does one interpret the WCHAN field in ps's output?

4. ANNOUNCE: XaAES beta 6 released

5. what wchan in ps -elf means ?

6. Regarding Static and Dynamic Scheduling in TAO

7. WCHAN field of ps -l

8. Scoping

9. Interpreting crash images

10. Interpreting/charting sar data

11. cma_dump.log (How to interpret it ??)

12. Interpreting sar -d

13. Help interpreting dmesg output