I wanted to trace the system calls made by the find command to debug some performance issues however I could not figure out how to do this on Mac OS X Yosemite. How can I trace system calls for an arbitrary program similarly to what strace does on FreeBSD? I am especially interested in tracing file-system related calls.
Suggested accepted answer doesn't work for me. This is what I tried:
cd ~
cp /usr/bin/find find
codesign --remove-signature ./find
sudo dtruss ./find …
error:
codesign --remove-signature ./find
sudo dtruss ./find
dtrace: system integrity protection is on, some features will not be available
dtrace: failed to execute ./find: Could not create symbolicator for task
strace
provided bybrew
? e.g. formulae.brew.sh/formula/strace – Ventagebrew
on Linux). – Rochdale