iosnoop, iotop, opensnoop, execsnoop, opensnoop, dtruss and other dtrace based commands don't work on osx El capitan, macOS Sierra

iosnoop relies on the dtrace subsystem. from: http://jimtechstuff.blogspot.com/2015/10/dtrace-broken-under-el-capitan.html


Dtrace is broken under El Capitan

One of the tools that I use quite a lot in debugging is 'dtrace' and the various utilities that use it. e.g. open snoop, iotop and a few that I wrote myself.

With the GA of El Capitan, any utility that resides in a system directory cannot be traced by dtrace which is a bit of a problem. I was wanting to see what open system calls the Photos app was using and came across this.

I know I could have used some other Mac utilities (fs_usage, sc_usage etc.) but I'm showing my Solaris roots here and I still wanted to use dtrace.

Fortunately there looks to be a way of enabling dtrace:

Reboot the mac
Hold ⌘R during reboot
From the Utilities menu, run Terminal
Enter the following command
csrutil enable --without dtrace

Note, that when doing so I got the following warning:

This is an unsupported configuration, likely to break in the future and leave your machine in an unknown state.

I'll live with it just now.


(I wanted to just add a comment to Ara Yeressian's mostly correct answer, but stackoverflow won't let me with my current low reputation)


Found the solution from here.

As it turns out the root user in osx elcapitan doesn't have full access to computer. In order to change this behaviour you need to restart the computer and hold the command+R while booting to enter recovery mode. There open terminal from top menu->utility->terminal and execute the next command

csrutil disable 

Then restart your computer. Now you should be able to use iosnoop, iotop and similar dtrace related commands.