Has anybody got a good way to profile plugins?

I've been noodling around with gprof and gcc -pg, but that relies on the main executable being also compiled with profiling flags, which I'm pretty certain it's not

Does anybody have any clues as to how to either bodge -pg to work, or generate call data otherwise?