strace
ProcessesAdvanced In real LinuxTrace system calls of a program
Name: strace = system call trace
This command needs a real Linux system; you can practise it in real Linux mode.
Description
strace runs a program (or attaches to a running one) and logs every system call with its arguments and result: which files it opens, what it reads and writes, what fails. A powerful debugging tool.
Syntax
strace [OPTION]... COMMANDCommon options
| -p PID | Attach to a running process |
| -f | Follow child processes and threads too |
| -e EXPR | Trace only some calls, e.g. -e trace=open |
| -c | Count calls and time per system call instead of listing them |
| -t / -tt | Prefix each line with the time (-tt with microseconds) |
| -T | Show the time spent in each call |
| -s STRSIZE | How much of each string to show (32 by default) |
| -o FILE | Write output to a file |