Retrieve stack traces of all threads of the process.
This is implemented using the rstack crate, which itself uses ptrace to unwind the threads of the process. Because processes cannot ptrace themselves, we're forced to use spawn a child process which does that work. Multiple unwinding implementations are supported via Cargo features:
By default, the libunwind backend is used. You can switch to libdw via Cargo:
[]
= { = "0.1", = ["dw"], = false }
Example
extern crate rstack_self;
use env;
use Command;
use thread;