views:

734

answers:

2

I have a medium sized application written in c++ using QT. I wanted to profile things to see where my least performant code was so I compiled everything with -pg.

However, my application makes use of a lot of plugins using the QTPlugin mechanism (boils down to a dlopen and a dlsym of a instance object per plugin). I've noticed that gprof doesn't seem to include functions from plugins.

Yes, the plugins are also compiled with -pg and all that. Is there anything special I have to do get everything profiled? Or am I missing something simple?

+3  A: 

If you can use it, I think Valgrind's callgrind only needs debug symbols (-g) to profile code. I'm not sure if it works with dynamically linked objects, though.

strager
+2  A: 

Valgrind(callgrind with kcachegrind as a viewer) is a good choice as strager said. You can also try using http://oprofile.sourceforge.net/

grepsedawk