Use Gprof to get profiler information on QT release version program on Win7

  • Hi, I am trying to profile my QT program with Gprof. For debug version I can do that via adding follwing lines in the .pro file:
    QMAKE_LFLAGS += -pg

    This will create a gmon.out after closing the program, and then use gporf on it will get the profiling information.

    However when I try this on the release version, it failed. The gmon.out can still be created but gprof can't read it, and reported:
    "myprogram has no symbols". I add "-g" or even "-g --disable-strip --enable-debug" but it still doesn't work. Any ideas?

  • so it is impossible to do it in the QT release version program?

  • welcome to devnet

    AFAIK this is not specific question to Qt. It depends on whether you can profile with a certain compiler/linker option. Personally, I doubt that this is possible straight away, but my knowledge of using gprof is very limited.

    You need to check the gprof manual for special settings required. As soon as there are specific gprof settings required, you may need at least a recompilation IMO.

Log in to reply