Docs / Linux Basics / How to Use strace for System Call Debugging

How to Use strace for System Call Debugging

By Admin · Mar 1, 2026 · Updated Apr 23, 2026 · 26 views · 2 min read

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 deniedstrace -e trace=open,openat shows exactly which file access is failing
  • Missing librariesstrace -e trace=open on a failing binary reveals search paths
  • Slow startupstrace -c summarizes 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.

Was this article helpful?