> 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
> 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.
Not speaking for Stratus Technologies.
PS - I know SVR4 works this way, and I don't remember HP-UX differing.