Profile a Single Process with pidstat
pidstat prints time-series CPU, memory, and I/O statistics for one PID (or all tasks), ideal for capturing a process's behavior over minutes.
01Command
$ pidstat -u -r -d -p 1234 2 502What it does
top gives a momentary snapshot, but pidstat produces interval samples you can log or diff, which makes it the tool for profiling a specific PID. -u adds CPU (%usr, %system), -r memory (RSS, major faults), and -d I/O (kB_read/s, kB_wrtn/s); combine them in one command as shown. Without -p it reports every task and flags dead ones; `pidstat -G <name>` filters by process name instead of PID.
03Risk
04Undo
✓No undo needed — this command does not change persistent state.
05Sources
- pidstat(1) - Report statistics for Linux tasksEvidence: pidstat reports statistics for Linux tasks (processes): -u CPU usage, -r memory, -d I/O, -p selects a task, with interval and count arguments.
Last verified: 2026-09-17 · Category: System & Settings
06Related solutions
Launch an interactive process viewer with color meters for CPU cores, memory, and swap, plus search, sort, and kill controls.
Show every TCP and UDP socket in listening state with the owning process name and PID — the modern replacement for netstat.
Show every systemd unit currently in a failed state, so you can inspect and restart whatever broke.