Ever tried to figure out why a Linux process is hung? You probably cobbled together output from GDB, lsof, and /proc, each with its own interface, its own flags, and its own quirks. And if all you have is a core dump? Good luck.
Solaris solved this decades ago with its "ptools": pstack, pfiles, ptree, and others. They have one consistent interface for inspecting live processes and core dumps alike. It's one of those things that, once you've used it, is hard to live without.
So I've been building ptools for Linux: a collection of Linux process inspection utilities modeled after the Solaris originals. Written in Rust, available on
crates.io, fully open source (Apache 2.0), and ready to meet your production debugging needs today:
- pstack: Thread stack traces for live processes and core dumps, with optional DWARF source locations
- pfiles: Every open file descriptor with paths, offsets, socket details, and flags
- ptree: Process trees for the whole system or a single process
- penv: The *current* environment of a running process, not just a snapshot from startup. No other Linux CLI tool does this.
- pargs, pauxv, pcred, psig, plgrp, plimit, prun, pstop, ptime, pwait, and more
Postmortem debugging support is a first-class feature. Most tools work seamlessly with Ubuntu/Debian Apport .crash files or systemd-coredump core dumps on RHEL/Fedora/SUSE, making postmortem debugging feel as natural as inspecting a live process. We've even upstreamed changes to Ubuntu Apport to enable postmortem analysis of open file descriptors.
ptools will be shipping in Fedora 44 next month. But why wait?
github.com/basil/ptools