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

About this issue

  • Original URL
  • State: open
  • Created 3 years ago
  • Reactions: 13
  • Comments: 16 (4 by maintainers)

Most upvoted comments

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?