0

So it seems sprof doesn't exist as part of MinGW. Yet I have a DLL created in Qt Creator (along with the core exe using this DLL) and compiled with qmake and MinGW. And I need to profile that. Nothing too complex here, just see where too much time is spent.

What are your suggestions ? What tools or methodologies come along with MinGW for that ? What about outside MinGW ?

Thanks in advance, Charles

Charles
  • 988
  • 1
  • 11
  • 28
  • 1
    http://www.network-theory.co.uk/docs/gccintro/gccintro_80.html – Hans Passant Oct 07 '16 at 16:14
  • http://stackoverflow.com/a/378024/23771 – Mike Dunlavey Oct 08 '16 at 13:32
  • @Hans Passant This page only talks about gprof, which doesn't work with DLLs. – Charles Oct 10 '16 at 07:03
  • @MikeDunlavey The method described in this post of yours cannot be applied to me, because I have a graphical display tool which already takes up most of the CPU load (> 50%). My DLL takes at most 10% of it ... so I would always land somewhere in the graphical display and rarely at all in my program ... Unless you teach me a way to limit my debugger in Qt to my DLL. – Charles Oct 10 '16 at 07:07
  • @Charles: That technique is for finding speedups. So if you actually know (not just assume) your DLL accounts for a small fraction of time, then even if you could reduce its time to zero, the speedup you get would be marginal. Regardless, if you were to take 20-30 samples, say, the fraction of them that land in your DLL tells you roughly what fraction of time it uses (which might actually be more than you think), and those samples give you visibility into why it spends that much time. – Mike Dunlavey Oct 10 '16 at 19:05
  • @MikeDunlavey At the end of the day the graphical stuff gets deactivated, as it is only for development/debug purposes. The core code (my DLL) is integrated into the actual master module that does no display - only passes the data around, calls the subroutines, etc ... The graphical tools imitates that behavior, but also allows to pause and resume, monitor data and status at any step, etc ... And I cannot run the master module at my desk. – Charles Oct 11 '16 at 11:06
  • @Charles: I would assume there must be some way to debug the master module. It's only a suggestion. You know best. – Mike Dunlavey Oct 11 '16 at 12:26
  • @MikeDunlavey Yes but let's just say it's out of my reach. Basic question remains the one from the title. – Charles Oct 11 '16 at 13:16
  • https://jonforums.github.io/cochise/2011/07/18/profiling-mingw-apps.html – AnotherParker Jan 18 '18 at 14:01

0 Answers0