linux strace 命令

strace 命令是一种强大的工具,它能够显示所有由用户空间程序发出的系统调用。
  strace 显示这些调用的参数并返回符号形式的值。strace 从内核接收信息,而且不需要以任何特殊的方式来构建内核。
  下面记录几个常用 option .
  1 -f -F选项告诉strace同时跟踪fork和vfork出来的进程
  2 -o xxx.txt 输出到某个文件。
  3 -e execve 只记录 execve 这类系统调用
  —————————————————
输出结果:
  
  brk(0) = 0×8062aa8
  brk(0×8063000) = 0×8063000
  mmap2(NULL, 4096, PROT_READ, MAP_PRIVATE, 3, 0×92f) = 0×40016000
  
  每一行都是一条系统调用,等号左边是系统调用的函数名及其参数,右边是该调用的返回值。

Posted in 生活随笔 |

0 Comments.

Leave a Reply

[ Ctrl + Enter ]

*
To prove you're a person (not a spam script), type the security word shown in the picture. Click on the picture to hear an audio file of the word.
Click to hear an audio file of the anti-spam word

Get Adobe Flash playerPlugin by wpburn.com wordpress themes