strace
Table of Contents
Trace a program
strace -s 2000 -f ./program
Trace a running, real-world process
$ sudo strace -o /tmp/strace.out -s 2000 -fp pid
count the system calls
use the â-câ flag to tell strace to count the system calls it observes
sudo strace -c -p pid
time the execution of each system call
use â-Tâ flag to ask it to time the execution of each system call during tracing
$ strace -T ./program