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: closed
- Created 5 years ago
- Reactions: 17
- Comments: 21 (6 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
We’re not in “can’t work” territory on OSX. There is definitely issues in our support of cpu profiling and so called heap profiling, but they work (for some definition). Malloc bits work (but OSX “features” makes performance advantage mostly moot; malloc/new performance is broken on those OSes).
For sure, you’ll get fullest and best experience on GNU/Linux (not windows), but learning by fixing/doing could also be great motivation. If for some reason Apple’s systems are your passion, feel free to dive in and contribute.
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?