Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Profiling Qt application that uses plugins

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?

like image 675
Evan Teran Avatar asked Dec 18 '25 16:12

Evan Teran


2 Answers

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.

like image 168
strager Avatar answered Dec 20 '25 05:12

strager


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

like image 42
grepsedawk Avatar answered Dec 20 '25 05:12

grepsedawk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!