Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good free profiler that supports MingW32 please? [closed]

I asked in another thread, how to profile my stuff, and people gave me lots of good replies, except that when I tried to use several of free profilers, including AMD Codeanalyst for example, they only support Microsoft PDB format, and MingW is unable to generate those.

So, what profiler can help me profile a multi-threaded application with Lua scripting and is compiled with MingW?

EDIT: gprof is crap, the awnser that says why I don't want it, is right on the spot... If I get all the functions that it litsts as troublesome, NONE of them are related to the issue that I have (there are a certain action that causes a massive slowdown, and I can't figure why, and gprof can't figure it either)

like image 642
speeder Avatar asked Nov 16 '25 19:11

speeder


1 Answers

If you don't want to use gprof, I'm not surprised.

It took me a while to figure out how to do this under GDB, but here's what I do. Get the app running and change focus to the app's output window, even if it's only a DOS-box. Then I hit the Control-Break key (while it's being slow). Then GDB halts and I do info threads and it tells me what threads there are, typically 1 and 2. I switch to the thread I want, like thread 2. Then I do bt to see a stack trace. This tells me exactly what it was doing when I hit Control-Break. I do this a number of times, like 10 or 20, and if there's a performance problem, no matter what it is, it shows up on multiple samples of the stack. The slower it makes the program, the fewer samples I have to take before I see it.

For a complete analysis of how and why it works, see that link.

P.S. I also do handle SIGINT stop print nopass when I start GDB.

like image 138
Mike Dunlavey Avatar answered Nov 18 '25 10:11

Mike Dunlavey