Trace only specific syscalls

Filter to file-related syscalls only

strace -e trace=openat,read,write curl https://example.com

tool
strace13 commands
tags
stracelinuxdebug

More strace commands

  • strace -c -e trace=all python3 app.py

    Summary table of syscall counts and time spent

  • strace -f -e trace=process nginx -t

    Trace 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

  • strace -e trace=openat -e trace=file myapp 2>&1 | grep 'ENOENT'

    Find files the process tries to open but cannot find

  • strace -e trace=network,socket curl https://example.com 2>&1 | grep -v '^---'

    Capture all network-related syscalls

all 13 strace commands