Chinaunix首页 | 论坛 | 博客
  • 博客访问: 1734264
  • 博文数量: 297
  • 博客积分: 285
  • 博客等级: 二等列兵
  • 技术积分: 3006
  • 用 户 组: 普通用户
  • 注册时间: 2010-03-06 22:04
个人简介

Linuxer, ex IBMer. GNU https://hmchzb19.github.io/

文章分类

全部博文(297)

文章存档

2020年(11)

2019年(15)

2018年(43)

2017年(79)

2016年(79)

2015年(58)

2014年(1)

2013年(8)

2012年(3)

分类: LINUX

2015-05-17 16:12:40

Strace 和  Ltrace 的不同,ltrace 可以trace 用户态C library Call,Strace 则是系统调用的trace. 
strace的命令行参数:
-f :除了跟踪当前进程外,还跟踪其子进程。
-o file :将输出信息写到文件file中,而不是显示到标准错误输出(stderr)。
-p pid :绑定到一个由pid对应的正在运行的进程。此参数常用来调试后台进程。
-e :  使用表达式指定跟踪的系统调用

点击(此处)折叠或打开

  1. strace -c ifconfig eth0

点击(此处)折叠或打开

  1. strace -e open ifconfig eth0
  2. strace -e trace=open,access ifconfig eth0

点击(此处)折叠或打开

  1. strace -o strace_ssh.txt -p 4423
这些则是时间相关的参数:
-t: add a timestamp to each line
-tt: add a timestamp with microsecond
-ttt: add a timestamp with microseconds and the number of seconds since the epoch
-T: add the time spent in the system call




阅读(1201) | 评论(0) | 转发(0) |
给主人留下些什么吧!~~