Problems with using gperftools on Mac OS X
问题 I have found several conflicting answers over this topic. This blog post requires libuwind, but that doesn't work on Mac OS X. I included #include <google/profiler.h> in my code, however my compiler (g++) could not find the library. I installed gperftools via homebrew. In addition, I found this stackoverflow question showing this: Then I ran pprof to generate the output: [hidden ~]$ pprof --text ./a.out cpu.profile Using local file ./a.out. Using local file cpu.profile. Removing __sigtramp