dtruss [-acdeflhoLs] [-t syscall] { -p PID
| -n name | command }
Outputs details on process system calls like truss and less intrusive.Especially interesting are elapsed and cpu times which identify calls that are slow or consume excessive CPU cycles.
Root
privileges are requiured.
-a |
dtrace: system integrity protection is on, some features will not be available
dtrace: failed to execute df: Operation not permitted
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 "date" and output elapsed and cpu times: dtruss -eo date
USAGE: dtruss [-acdefholLs] [-t syscall] { -p PID | -n name | command | -W name } -p PID # examine this PID -n name # examine this process name -t syscall # examine this syscall only -W name # wait for a process matching this name -a # print all details -c # print syscall counts -d # print relative times (us) -e # print elapsed times (us) -f # follow children -l # force printing pid/lwpid -o # print on cpu times -s # print stack backtraces -L # don't print pid/lwpid -b bufsize # dynamic variable buf size eg, dtruss df -h # run and examine "df -h" dtruss -p 1871 # examine PID 1871 dtruss -n tar # examine all processes called "tar" dtruss -f test.sh # run test.sh and follow children
PID/LWPID |