在 OS X 10.11 El Capitan环境下,执行如下命令时会报错:
sudo dtruss /bin/ls
dtrace: failed to execute /bin/ls: dtrace cannot control executables signed with restricted entitlements
一个workaround就是把对应的binary拷贝到那些非“restricted"的位置,如/tmp
如下:
sudo dtruss /tmp/ls
试了一下,可以正常动作。