A command line tool to help find and debug Rust programs on your machine. Inspired by gops and a fit of boredom.
This only works if the binaries haven't be stripped beforehand.
bash
$ cargo install rsps
Lists all running Rust processes.
bash
$ rsps # or rsps list
PID Parent Name Path
58988 54401 rg /usr/local/bin/rg
58989 47182 rsps target/debug/rsps
Displays Rust processes in a tree-like format.
bash
$ rsps tree
@
├── 59235 [treem]
│ └── 59236 [branch]
│ ├── 59238 [leaf]
│ ├── 59237 [branch]
│ │ ├── 59240 [branch]
│ │ │ ├── 59244 [leaf]
│ │ │ ├── 59242 [branch]
│ │ │ │ └── 59245 [leaf]
│ │ │ └── 59243 [branch]
│ │ │ └── 59246 [leaf]
│ │ └── 59241 [leaf]
│ └── 59239 [leaf]
└── 59262 [rsps]
Dumps the stack of a running Rust process, given the name or pid.
```bash
$ rsps stack cargo # or rsps stack
Thread ID: 297 Name: cargo
Stack Dump:
Frame #0: 7fe294cf57d0 poll
Frame #1: 564691cacb60 jobserver::imp::Client::acquireallowinterrupts::h4f87d446882f6e88
Frame #2: 564691cae370 jobserver::HelperState::foreachrequest::h80f41bf960986b48
Frame #3: 564691cae680 std::syscommon::backtrace::rustbeginshortbacktrace::hcb30739b281791a0
Frame #4: 564691caf0e0 core::ops::function::FnOnce::callonce{{vtable.shim}}::h6fcaf617e71843a9
Frame #5: 564691cf5210 std::sys::unix::thread::Thread::new::threadstart::hb5e40d3d934ebb7a
Frame #6: 7fe294f57eb0 start_thread
Frame #7:
[...] ```
Currently limited to Linux only due to rstack only building on Linux.
Licensed under either of
at your option.
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.