strace是Linux/Unix下的一款可以追踪系统调用的工具。 1.安装strace
apt-get install strace # ubuntu
yum install strace # centos
2.使用示例

3.strace -p
strace -p pid # 根据进程id,追踪此进程系统调用
查看nginx: worker process进程的系统调用

4.strace -c
统计时间,调用数,错误

5.strace -e type=expr
expr = set, file, process, network, signal,ipc, desc,memory 
指定追踪系统调用类型

6.strace -o out.txt
将输出重定向一 个文件

7.strace -i
输出系统调用的指针地址

8.详细参数可通过下面命令查看
man strace