Is there tool to see call-stack of running thread similar to Process Explorer by Sysinternals ?

So far I tried htop, qps and Linux Process Explorer. None of them can provide that information.


| improve this question | | | | |

Gdb, the GNU debugging utility, can provide such functionality, although only for selected programs or processes individually. There is not an easy way to do it and switch between the call-stacks of the processes running on the system like the Sysinternals program does on Windows. However, you could try pstack, but I have not had much success with it.

You also have to install the dbg packages (i.e. the symbol packages) so that any gdb call-stack backtrace will work. See the Ubuntu wiki for more information on these packages. Basically, the dbg version of the package is installed very like the normal one is. You run, for example,

sudo apt-get install xserver-xorg-core-dbg

You can do a backtrace on a program by starting the program under gdb or you can do one on a program already running by attaching gdb to that process: please see here for further details.

Please see the official manual for more information on gdb and backtracing and more generally useful information is here at the Ubuntu debugging page.

Additional ways of analysing running processes using strace,etc, which are of use to developers, etc, in analysing a process and its system calls, as opposed to stack calls, have been moved to this question here (as I thought they are now more relevant there):

| improve this answer | | | | |
  • Thanks a lot for very detailed answer. I'll try everything tonight. But there is no way to get call-stack of running thread I assume ? – expert Sep 24 '12 at 22:16
  • @ruslan I've edited my answer and moved the strace and ltrace discussion to the linked askubuntu question, as I realised that you are more interested in looking at call stacks using something like gdb. See here askubuntu.com/questions/191964/…. I hope this is ok, as I realised it wasn't really what you wanted here. – user76204 Sep 24 '12 at 23:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.