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.
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It only takes a minute to sign up.Sign up to join this community
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.
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):