[plug] pstack

Bernard Blackham bernard at blackham.com.au
Thu Jan 8 20:22:14 WST 2004


On Thu, Jan 08, 2004 at 03:12:06PM +0800, James Devenish wrote:
> How do you dump the execution stack of a currently-running process
> without being able to ptrace it? (E.g. isn't this what /proc is for?)

Most things that do this will use ptrace. There's also ltrace which
will trace what library calls a program makes (though I suspect that
might also use ptrace internally, but it may not).

If you have sysrq keys compiled it, you can press Alt+Sysrq+T to get
a trace of what a process is doing in kernelland (eg, see if it's in
a write, or a read, or a wait, etc).

Why can't you ptrace it? The only process I've never been able to
ptrace before was init, because of a kernel based restriction. I
commented out restriction, recompiled the kernel, and all was peachy :)

Bernard.

-- 
 Bernard Blackham <bernard at blackham dot com dot au>



More information about the plug mailing list