How to Use strace for System Call Debugging
strace intercepts and records system calls made by a process, making it invaluable for diagnosing permission errors, missing files, and performance issues on your Breeze.
Basic Usage
# Trace a command
strace ls /var/www
# Trace a running process by PID
sudo strace -p 1234
Filtering System Calls
Focus on specific categories to reduce noise:
# File operations only
strace -e trace=file ls /var/www
# Network calls only
strace -e trace=network curl http://localhost
# Process-related calls
strace -e trace=process bash -c "echo hello"
Saving Output
# Write trace to a file for analysis
strace -o /tmp/trace.log -e trace=file nginx -t
# Include timestamps
strace -t -o /tmp/trace.log -p 1234
# Show time spent in each call
strace -T -e trace=file cat /etc/hosts
Practical Debugging Examples
- Permission denied —
strace -e trace=open,openatshows exactly which file access is failing - Missing libraries —
strace -e trace=openon a failing binary reveals search paths - Slow startup —
strace -csummarizes time per syscall to find bottlenecks
Summary Mode
# Get a statistical summary of system calls
strace -c -p 1234
The summary shows call count, error count, and time per syscall — perfect for identifying what is slowing down services on your Breeze.