I am trying to profile a Qt window application that I am developing and have read up on the methods to profile using gprof. I have successfully configure the project to compile and link with the -pg flags to enable profiling and the gmon.out is output everytime the the application is executed. However when I tried to run gprof to convert the gmon.out file into a readable txt file, I ran into the "gmon.out too short to be a gmon file" error message. I tried googling for an answer to this problem but to no avail. Someone also asked the same question here but no answer was given.
I am using Qt 4.7.4 with Qt Creator 2.3.0 with mingw compiler on Windows 7 for this project.
The flags I have set in the .pro files are:
# Profiler flags
CONFIG += DEBUG
QMAKE_CXXFLAGS_DEBUG += -pg
QMAKE_CXXFLAGS_MT_DBG += -pg
QMAKE_LFLAGS_DEBUG += -pg
This is how I called gprof from command prompt:
C:\QtSDK\mingw\bin>gprof "C:\Qt exe\debug\QtGUI.exe" > profile.txt
And the error message: gmon.out: file too short to be a gmon file
I have also checked the file size for gmon.out; it is around 520 kb each time I ran the debug application. Is this really too short to be a gmon file?