Strace 工具

来源:互联网 发布:搭建php开发环境 编辑:程序博客网 时间:2024/06/01 10:29
The tool of Strace can show the system call that comes from  the user-space program. Strace not only can display these system call and their parameters, but also return a value .
 Several commonly used options like the following:
1. "-f" meaning that Strace will trace the process comes from fork() and vfork() in the same time. For example: starce -f ./a.out

2. "starce -o xxx.txt" meaning that the result output to xxx.txt.

3. "strace -e trace=nanosleep" meaning that Starce only reacording the related process. "nanosleep" can also be "network, filename, file descriptor"

4. "strace -p pid" //trace the background process.

5. "strace -T" //reacording the time that every system call spended.

6. "strace -t" //reacording the time of every system call happened.
0 0
原创粉丝点击