gperftools: basic CPUPROFILE usage fails on osx (with gperftools installed via brew)
I tried to follow the steps outlined in (see below links) but nothing worked:
brew install gperftools
brew test gperftools # works, sanity check
clang -o /tmp/z01 -lprofiler hello.c
CPUPROFILE=/tmp/prof.out /tmp/z01
pprof /tmp/z01 /tmp/prof.out
Using local file /tmp/z01.
Using local file /tmp/prof.out.
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool-classic: can't open file: /usr/lib/liboah.dylib (No such file or directory)
error: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/otool-classic: can't open file: /usr/lib/liboah.dylib (No such file or directory)
...
likewise with /usr/local/opt/gcc/bin/gcc-11 -o /tmp/z01 -L/usr/local/Cellar/gperftools/2.9.1/lib -lprofiler -g hello.c
links
- https://stackoverflow.com/questions/22623934/how-to-install-gprof-on-os-x
- https://stackoverflow.com/questions/10562280/line-number-in-google-perftools-cpu-profiler-on-macosx?noredirect=1&lq=1
- https://stackoverflow.com/questions/29308174/how-to-profile-from-the-command-line-on-mac-os-x?noredirect=1&lq=1
- https://gperftools.github.io/gperftools/cpuprofile.html
About this issue
- Original URL
- State: open
- Created 3 years ago
- Reactions: 13
- Comments: 16 (4 by maintainers)
It seems linked to some libs moved around on recent versions of MAC OS: https://developer.apple.com/forums/thread/655588
Reproduced through an Homebrew install and an installation from sources, on gperftools-2.9.1.
Same issue arises with gperftools installed via MacPorts
Same issue here.
Just to keep this list up and running. I’m also having the same issue with gperftools installed via MacPorts
Same issue, could someone please share the solution? thanks!
I’ve met the question
Still an issue
Anyone figure this out?