On linux in order to view the process stack at a given time we generally use
pstack <pid
>
I am wondering what is the equivalent of the same in osx.
thanks
sudo /usr/libexec/stackshot -i -u -p <pid>
This appends a stack trace of all threads of the process in question to the file /Library/Logs/stackshot-syms.log . Consider to remove the file stackshot-syms.log before calling stackshot. See: stackshot(1)
Note: stackshot is no longer included with OS X 10.11 EL Capitan. Use the lldb debugger instead:
echo "thread backtrace all" | lldb -p <pid>
lldb is part of the command line developer tools. If you don't have lldb on your machine, a popup will help with installing XCode.
Appears "an" equivalent is the sample
command in OS X:
sample <pid> 0
takes a single stacktrace sample.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With