0

I'm used to gprof for profiling my C code, but I want to start using a GUI-based Windows application such as Luke Stackwalker. gprof works perfectly fine on my binary, but Luke Stackwalker has some issues:

Launching executable C:\lshare\POT03\Eclipse\Debug\POTaak3.exe.
SymInit: Symbol-SearchPath: ';.;C:\Program Files\Luke Stackwalker;C:\Program Files\Luke Stackwalker;C:\WINDOWS;C:\WINDOWS\system32;SRV*C:\websymbols*http://msdl.microsoft.com/download/symbols;', symOptions: 530, UserName: 'Pieter'

OS-Version: 5.1.2600 (Service Pack 3) 0x100-0x1

C:\lshare\POT03\Eclipse\Debug\POTaak3.exe:POTaak3.exe (00400000), size: 61440, SymType: '-unknown-', PDB: '$Tƒ|'
C:\WINDOWS\system32\ntdll.dll:ntdll.dll (7C900000), size: 753664, SymType: '-unknown-', PDB: '©Uƒ|'
C:\WINDOWS\system32\kernel32.dll:kernel32.dll (7C7D0000), size: 1048576, SymType: '-unknown-', PDB: '©Uƒ|'
C:\WINDOWS\system32\msvcrt.dll:msvcrt.dll (77BE0000), size: 360448, SymType: '-unknown-', PDB: '©Uƒ|'
ERROR: SymGetModuleInfo64, GetLastError: 1114 (Address: 7C90E514)
Sorting profile data.
Done; 2 samples collected at 1.$ samples/second.

Who shot the who in the what now? What am I doing wrong here? I did remember to use the -pg flag.

Pieter
  • 31,619
  • 76
  • 167
  • 242
  • Strange, never got this error. Is this a 64-bit executable? (I only tried it with 32-bit executables). I always compile with Visual Studio 2003 and use the /Zi option to generate debug information. Could it be that Luke Stackwalker doesn't recognize the gcc debug information? Can gcc create Visual Studio compatible debug information? – Patrick Feb 20 '10 at 18:25
  • I looked up the gcc documentation. -pg should be used if you want to profile using the gcc profiler (gprof). With Luke Stackwalker you are using an external profiler, which does not require something special in the application, except debug information. Try removing -pg and adding an option to generate debug information with your executable. -g might be sufficient, but if it doesn't work you might have to look for other debug formats. Hope this helps. – Patrick Feb 20 '10 at 18:35
  • I've had no luck with that. `SymType: '-unknown-'` might be an important clue though. – Pieter Feb 21 '10 at 09:02
  • And no, it's not a 64-bit executable. I still use one o'them 32-bit type laptops. The EXE itself executes fine, by the way. – Pieter Feb 21 '10 at 09:03

2 Answers2

1

I understand why you want something other than gprof. Luke Stackwalker takes stack samples, but (last time I checked) it doesn't summarize inclusive % of wall-clock time used at the level of lines of code. On Linux, you could use lsstack or pstack, and there must be a similar tool on Windows. In your situation, I just rely on the pause button in the IDE to take stackshots.

Community
  • 1
  • 1
Mike Dunlavey
  • 40,059
  • 14
  • 91
  • 135
0

The SymType -unknown- means that either the program has not been compiled with the gcc -g option to generate debug info, or the debug info format cannot be recognized by the microsoft debughelp library that is used by Luke Stackwalker.

Please check that you are using the -g option when compiling the program (and not stripping the executable). Otherwise, it would be nice to know which gcc version you are using.

  • I'm sure that it is being compiled with `-g`, because `gdb` has no problems getting access to the source code. gcc version info: `gcc (GCC) 3.4.5 (mingw-vista special r3)` – Pieter Feb 24 '10 at 19:21
  • Tried it, I confirm it does not work. Luke fails to read the debug info in the executable. The strange thing is I swear I have tried this before and it worked, but now I could not make it work. – sami sallinen Feb 26 '10 at 05:21