strace可以跟踪系统调用的执行情况,在程序发生问题后,可以用strace分析和跟踪问题。 使用方法:
FreeBSD/MacOS下可以使用truss
strace -o /tmp/strace.log -f -p $PID