惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

Hacker News - Newest:
Hacker News - Newest: "LLM"
The Last Watchdog
The Last Watchdog
L
LINUX DO - 最新话题
Application and Cybersecurity Blog
Application and Cybersecurity Blog
T
Troy Hunt's Blog
Cloudbric
Cloudbric
N
News | PayPal Newsroom
Security Archives - TechRepublic
Security Archives - TechRepublic
TaoSecurity Blog
TaoSecurity Blog
H
Hacker News: Front Page
Help Net Security
Help Net Security
S
Secure Thoughts
Recent Commits to openclaw:main
Recent Commits to openclaw:main
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
PCI Perspectives
PCI Perspectives
AI
AI
Hacker News: Ask HN
Hacker News: Ask HN
NISL@THU
NISL@THU
Last Week in AI
Last Week in AI
Forbes - Security
Forbes - Security
The GitHub Blog
The GitHub Blog
D
DataBreaches.Net
Scott Helme
Scott Helme
Jina AI
Jina AI
T
Threatpost
W
WeLiveSecurity
P
Palo Alto Networks Blog
F
Fortinet All Blogs
腾讯CDC
人人都是产品经理
人人都是产品经理
云风的 BLOG
云风的 BLOG
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
P
Privacy International News Feed
P
Proofpoint News Feed
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
A
About on SuperTechFans
V
Vulnerabilities – Threatpost
www.infosecurity-magazine.com
www.infosecurity-magazine.com
C
Cyber Attacks, Cyber Crime and Cyber Security
B
Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
D
Darknet – Hacking Tools, Hacker News & Cyber Security
IT之家
IT之家
美团技术团队
I
InfoQ
阮一峰的网络日志
阮一峰的网络日志
T
Threat Research - Cisco Blogs
博客园 - 司徒正美

博客园 - 飘啊飘

一个精简的vi源码(2000行) gdb常用命令[转] gdb中信号的处理[转] 在linux中通过进程名获得进程id busybox0.60.3源码学习开始 pygame做的贪吃蛇 python中使用struct模块处理二进制数据 使用PYGAME开发的坦克游戏[代码][思路] 一篇很好的讲/etc/inittab的文章[转] 哲学家吃空心粉问题 《代码整洁之道》笔记之函数 使用面向对象概念优化条件判断语句的一个小应用 python生成文件树的代码 深入理解软件包的配置、编译与安装[转] pygame学习之对象移动 pywin32重启电脑 - 飘啊飘 - 博客园 解决LINUX和WINDOWS时间不一置 通过状态机实现的一个配置读取函数 UNIX基础知识--《APUE》第一章笔记
dtruss 粗糙的翻译
飘啊飘 · 2012-03-15 · via 博客园 - 飘啊飘

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)