Alternative to -pg for clang?

I observed there is no implementation of -pg for clang. Is there any
plan to do this, or an alternative framework in place? Can anyone
recommend an alternative free and effective sampling profiler with
minimal overhead?

Don't know about a plan for -pg, but since I've been evaluating Linux
profiling tools for a class recently, I'll give some recommendations.

If you're using Linux, I'd recommend "perf" (aka "Linux Perf Events"
or "Linux Performance Counters", names that are un-google-able). The
command line interface is *much* easier to use than oprofile for
performance counters, which is what I was interested in. I think the
callgraph support is a bit weaker than gprof. It handled recursion
*very* poorly, which is pretty lame. The main things to like about it
are the interface, low overhead, and the fact that you don't need to

There's also google-perftools cpuprofiler:
I've only used their heap profiler, which worked reasonably well.
Google uses this for everything apparently, so it's probably not half


Thanks for the pointers, I was hoping very much for something other
than the usual recommendations of "Zoom" and "OProfile". I'll give
these profilers you've suggested a try.

If you can stand the performance penalty, cachegrind + kcachegrind are
also available and can produce some very detailed information.

- Daniel