Stack trace per syscall strace
Print user stack on each openat to find which code path opens a file; needs debug symbols
strace -k -e trace=openat -f -p <pid>
more strace
all 13 commands →
Syscall fault injection
strace -f -e inject=openat:error=ENOENT:when=3 -p <pid>
Trace signals delivered
strace -f -e signal=all -e trace=none -p <pid>
Trace a new process
strace -o trace.log ls /tmp
Attach to running process
strace -p $(pgrep nginx | head -1) -o /tmp/nginx.trace
Trace only specific syscalls
strace -e trace=openat,read,write curl https://example.com