I’m attempting to profile a C++ program by building like so:
clang++ -pg foo.cc -o foo
According to the LLVM 3.0 release notes, this is supported:
“The optimizer and code generator now supports gprof and gcov-style coverage and profiling information, and includes a new llvm-cov tool (but also works with gcov). Clang exposes coverage and profiling through GCC-compatible command line options.”
However, running foo does not produce gmon.out. Replacing clang++ with g++ (and changing nothing else) does produce gmon.out with expected contents.
$ clang++ --version
clang version 3.2 (tags/RELEASE_32/final)
Thread model: posix
This clang++ was built from the release 3.2 source with default configuration.
Any clues on what might be wrong?