Trace a new process
Run a command under strace and save output to file
strace -o trace.log ls /tmp
- tool
- strace13 commands
More strace commands
-
strace -p $(pgrep nginx | head -1) -o /tmp/nginx.traceTrace syscalls of an already-running process by PID
-
strace -e trace=openat,read,write curl https://example.comFilter to file-related syscalls only
-
strace -c -e trace=all python3 app.pySummary table of syscall counts and time spent
-
strace -f -e trace=process nginx -tTrace syscalls in all forked children (-f)
-
strace -tt -T curl https://example.com 2>&1 | head -40-tt adds absolute time; -T shows time spent in each call