博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
dtruss 粗糙的翻译
阅读量:4542 次
发布时间:2019-06-08

本文共 2415 字,大约阅读时间需要 8 分钟。

mac下的strace。废话不说,直接看:

 

dtruss(1m) USER COMMANDS dtruss(1m)

 

NAME

dtruss - process syscall details. Uses DTrace.
dtruss - 使用DTrace来监视系统调用

SYNOPSIS

dtruss [-acdeflhoLs] [-t syscall] { -p PID | -n name | command }

DESCRIPTION

dtruss prints details on process system calls. It is like a DTrace ver-
sion of truss, and has been designed to be less intrusive than truss.
dtruss 在进程进行系统调用的时候,进行输出。它就像DTrace版的truss,和truss相比,它
插入一些信息。

Of particular interest is the elapsed times and on cpu times, which can

identify both system calls that are slow to complete, and those which
are consuming CPU cycles.
一个有意思的功能是计算时间和cpu时间,两个调用之间哪个更慢,消耗的cpu时间的比较

Since this uses DTrace, only users with root privileges can run this

command.
只有在有root权限的终端下,可以使用DTrace。

OPTIONS

-a print all details

-b bufsize

dynamic variable buffer size. Increase this if you notice
dynamic variable drop errors. The default is "4m" for 4
megabytes per CPU.

-c print system call counts

输出系统调用数

-d print relative timestamps, us

输出时间消耗
-e print elapsed times, us
输出剩余多少时间
-f follow children as they are forked
监视fork出来的进程调用

-l force printing of pid/lwpid per line

-L don't print pid/lwpid per line

-n name

examine processes with this name
-o print on-cpu times, us
输出花在cpu上的时间

-s print stack backtraces

输出栈跟踪

-p PID examine this PID

监视某个pid

-t syscall

examine this syscall only
只监视某个系统调用

EXAMPLES

run and examine the "df -h" command
# dtruss df -h

examine PID 1871
# dtruss -p 1871

examine all processes called "tar"
# dtruss -n tar

run test.sh and follow children
# dtruss -f test.sh

run the "date" command and print elapsed and on cpu times,

# dtruss -eo date

FIELDS
PID/LWPID
Process ID / Lightweight Process ID

RELATIVE

relative timestamps to the start of the thread, us (microsec-
onds)

ELAPSD elapsed time for this system call, us

CPU on-cpu time for this system call, us

SYSCALL(args)

system call name, with arguments (some may be evaluated)

DOCUMENTATION
See the DTraceToolkit for further documentation under the Docs direc-
tory. The DTraceToolkit docs may include full worked examples with ver-
bose descriptions explaining the output.

EXIT

dtruss will run forever until Ctrl-C is hit, or if a command was exe-
cuted dtruss will finish when the command ends.

AUTHOR

Brendan Gregg [Sydney, Australia]

SEE ALSO

procsystime(1M), dtrace(1M), truss(1)

 

version 0.80 Jun 17, 2005 dtruss(1m)

转载于:https://www.cnblogs.com/shiweifu/archive/2012/03/15/2397806.html

你可能感兴趣的文章
01背包
查看>>
一道面试题关于js中添加动态属性
查看>>
结对编程项目——四则运算
查看>>
XML分页
查看>>
input、raw_input区别,运算符,运算优先级,多变赋值方式
查看>>
grpc python quickstart
查看>>
oracle异常处理
查看>>
scrapy下载中间件,UA池和代理池
查看>>
NOIP2017 宝藏 题解报告【状压dp】
查看>>
HDU 6357.Hills And Valleys-动态规划(区间翻转l,r找最长非递减子序列)
查看>>
从零开始,让你的框架支持CocoaPods
查看>>
memcached部署memcached环境及PHP扩展
查看>>
rvm 安装后的补充工作:source $HOME/.profile
查看>>
Oracle常见等待事件
查看>>
udp
查看>>
Scrapy在 setting.py 文件中 设置 日志 记录等级
查看>>
Python标准库的学习准备
查看>>
Facebook 添加点赞按钮
查看>>
浪潮之巅读后感…20151423
查看>>
【移动开发人员沙龙 北京站】第二期 报名火热来袭
查看>>