Skip site navigation (1)Skip section navigation (2)
Date:      Mon, 2 Apr 2012 13:12:36 -0400
From:      John Baldwin <jhb@freebsd.org>
To:        Yuri <yuri@rawbw.com>
Cc:        freebsd-hackers@freebsd.org, hackers@freebsd.org
Subject:   Re: Is there any modern alternative to pstack?
Message-ID:  <201204021312.36568.jhb@freebsd.org>
In-Reply-To: <4F79D63E.7010200@rawbw.com>
References:  <4F775DF5.1020704@rawbw.com> <201204020831.09253.jhb@freebsd.org> <4F79D63E.7010200@rawbw.com>

next in thread | previous in thread | raw e-mail | index | archive | help
On Monday, April 02, 2012 12:39:26 pm Yuri wrote:
> On 04/02/2012 05:31, John Baldwin wrote:
> > 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.
> 
> I see pstack -1.2_1 failing even on i386:
> 
> pstack: cannot read context for thread 0x1879f
> pstack: failed to read more threads

Yes, threads don't work for modern binaries (newer than 4.x) without my changes
to make it use libthread_db.  You can find the patch I used for this at
http://www.freebsd.org/~jhb/patches/pstack_threads.patch

-- 
John Baldwin



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201204021312.36568.jhb>