Is there any modern alternative to pstack?

John Baldwin jhb at freebsd.org
Mon Apr 2 14:31:48 UTC 2012


On Saturday, March 31, 2012 3:41:41 pm Yuri wrote:
> I look at seemingly abandoned sysutils/pstack, last modified upstream 
> 2002-11-27.
> It doesn't really work on 9.0 i386, prints some errors.
> 
> It's functions, though, is quite desirable if one wants to understand 
> why some multithreaded program hangs or is not responsive.
> Since there were no updates, I wonder, is this because there is some 
> alternative in FreeBSD that I don't know about, or it is primarily due 
> to the lack of interest/resources?
> 
> I don't take gdb as alternative since it is not single line, and also it 
> has some threading issues of its own.

Hmm, I don't know if the port has it, but I did some work on pstack a while 
ago to make it work with libthread_db so it at least handles i386 ok.  It 
needs to be modified to use something like libunwind though or some other 
unwinder.  And possibly it should use libelf instead of its own ELF-parsing 
code.

-- 
John Baldwin


More information about the freebsd-hackers mailing list