Syscall fault injection
Force the 3rd openat to fail with ENOENT to test error handling; chaos testing without code
strace -f -e inject=openat:error=ENOENT:when=3 -p <pid>
- tool
- strace13 commands
More strace commands
-
strace -f -e signal=all -e trace=none -p <pid>Show only signals (SIGTERM/SIGCHLD) and skip syscalls; debug mysterious kills. note: ltrace for libcalls
-
strace -o trace.log ls /tmpRun a command under strace and save output to file
-
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