1753349 Members
5003 Online
108792 Solutions
New Discussion юеВ

int64_t lwp_stat

 
Chris Naud├й
Frequent Advisor

int64_t lwp_stat

I'm writing a program on HP-UX 11.11 that lists all of the threads for a given process and displays the stats for each thread. I've been looking through all of the header files and I can't seem find a description of each of the lwp_stat states. When I use pstat_getlwp() to get lwp_stat I get a numeric value. What do each of these numeric values represent? Are these exactly the same pst_stat from pstat_constants.h? I would also like to know what the different lwp_wchan values are? Can someone point me in the right direction here?
2 REPLIES 2
Don Morris_1
Honored Contributor

Re: int64_t lwp_stat

Yes, lwp_stat is the same states as pst_stat, it seems. (I agree this is confusing since the header references a "state LWP_SLEEP" -- and there's no such state. I wouldn't be surprised if the intention was to have a set of state constants that mirror the PS_* states but with LWP_ instead and that simply didn't happen with the comments reflecting the original intent).

The lwp_wchan values aren't going to have much meaning to you [other than looking for duplicates which tell you that the LWPs are sleeping on the same resource -- which does have value and may be why this was exported]. Wait channels are kernel internal values and will vary even across reboots, much less boxes. You'd need to use intrusive tools on the running kernel (or later crash dump) to find what a particular wait channel actually means.
Chris Naud├й
Frequent Advisor

Re: int64_t lwp_stat

That is exactly what I needed to know. Thanks!