Backtrace of every the threads

Ricardo Ribalda Delgado ricardo.ribalda at
Wed Feb 10 04:05:33 EST 2016


I have been debugging a process that makes a syscall which never
returned. The problem was the interaction between than process and
other kernel threads, due to an error on the way the locks were
designed (my bad).

Luckily, the error is gone now :). but I was wondering if there is a
way to show the backtrace of ALL the threads in the system, which
could have been a wonderful tool to debug this issue.

Things that I tried and NOT worked:

1) perf top:

It is fast and easy if the tasks are in active loops, but if they are
sleeping, waiting for an event, holding a lock.... they will not

2) ftrace

works, but there are MILLIONS of lines to navigate :S Unless there is
a good way to navigate the data it is a "last resource" tool.

3) gdb vmlinux /proc/kcore; info threads

I had big hopes on this... but only one thread was showed.

Are the Linux awareness gdb extensions ready?

4) sysrq, print backtrace

It only shows the active threads, not the "waiting" ones

What I want?

A magic command that shows the backtrace of ALL the threads (kernel
and userland). Something like a ps with steroids.

Does this exist? Where would be the best place to start developing
something like this: perf people, unix-utils, systemd :S , alone in a
dark basement?


Ricardo Ribalda

More information about the Kernelnewbies mailing list