Linux strace like command for Mac OS X (with Dtrace)

On Linux I use the strace command a lot to find out what a kernel calls a binary is executing internally; on Mac OS X this does not exist. In OS X you have, instead, the very powerful, but less easy to use dtrace tool (originally made by Sun for Solaris).

So here is a simple script to get that strace feel under OS X with dtrace:

#!/bin/sh
dtruss -f -t open $@

I put it in /usr/sbin/strace, but anywhere in your path or where it is convenient will do. You need root perms to run it.

Be the first to leave a comment. Don’t be shy.

Join the Discussion

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>