strace is a diagnostic and debugging utility for Linux with a command-line interface. It watches how processes interact with the kernel.
Overview
strace is a userspace utility for Linux that helps with diagnosis, debugging, and instruction about process behavior. It uses a traditional command-line interface and relies on the kernel ptrace feature to operate.
It monitors interactions between processes and the Linux kernel. Those interactions include system calls, delivery of signals, and changes in process state. The tool can also interfere with those interactions when used for deeper investigation.
Packages are distributed downstream for installation on Linux systems. A user manual is available as documentation for day-to-day use after installation.
Compared with simply reading source code, strace shows live kernel-facing behavior from running programs, which makes it suited to understanding what a process is actually doing on a system.
Key features
- Monitors system calls
- Tracks signal delivery
- Observes process state changes
- Command-line interface
- Uses kernel ptrace
- Can tamper with interactions
- Diagnostic and debugging focus
- Instructional tracing use
Use cases
- Debugging process-kernel behavior
- Tracing system calls
- Teaching how syscalls work
- Diagnosing misbehaving processes