Gprof and Win32 multithreading



  • Is there any way to get gprof working with multithreaded Win32 code that uses CreateThread and window procedures? I get gibberish when I try to run it (like 2 function calls in the whole program).

    I found a fix for pthreads library (http://sam.zoy.org/writings/programming/gprof.html) and I would probably be able after weeks of struggling to get it to work with Win32. However, I thought maybe someone here has also had a problem with this and had already devised a solution?



  • gprof itself is just an output formatter, so theoretically any profiling system that generated gprof input data could work, but for practical purposes: No. The Windows libraries were not compiled with gcc. You can't trace through them.



  • I don't really understand that - I want to check which of my own functions takes up the most time. I don't want to profile API calls. Anyway, I'll try to modify the pthreads soultion and check if it works.


Log in to reply