Search code examples
macossystem.diagnosticsdtrace

Mac OSX: Using dtruss?


I'm trying to dtruss a process in Mac OSX Catalina, however dtrace is reporting an error.

$ sudo dtruss whoami                 
dtrace: system integrity protection is on, some features will not be available

dtrace: failed to execute whoami: (os/kern) failure

I'm basically trying to get a stack trace. Can anyone provide guidance on accomplishing this?

Thanks


Solution

  • This article explains how to accomplish this: Enabling D-Trace on system with SIP

    You can disable SIP entirely by doing the following:

    1. Reboot your mac
    2. Hold ⌘R during reboot
    3. From the Utilities menu, run Terminal
    4. Enter the following command
    csrutil disable
    

    Alternatively you can re-enable SIP while still allowing dtrace to work by also running the following:

    csrutil enable --without dtrace