I am trying to use VTune profiler on my Qt Creator C++ project. I am using the MinGW 11.2.0 compiler.
At this point I am unable to see the function names or their source files in VTune:
So far I have tried setting these flags in my *.pro file, but the compiler is complaining about them:
QMAKE_CFLAGS_RELEASE += /Zi
QMAKE_LFLAGS_RELEASE += /DEBUG
I have also tried building my project with the MSVC kit, but it doesn't compile, so that is not an option either.
All the documentation that I managed to find refers to Visual Studio, but that is not helpful for me since I am using Qt Creator.
Is there any way I could make VTune show me the function names ?
Thank you for posting in Intel Communities.
While compiling the C++ program, you can use -g flag. This will debug the code, and the function names will thus be displayed in VTune Analysis.
Eg: g++ input.cpp -g -o output.exe
I have taken a sample C++ program (Fibonacci) and compiled it with and without the -g flag and ran VTune (Hotspot) Analysis for both cases. As you can see below, the executable created with -g flag shows the function name, and the executable created without -g flag is not.
I assume this will resolve your issue. If yes, please make sure to accept this as a solution. This would help others with a similar issue. Thank you!
We assume that your issue is resolved. If you need any additional information, please post a new question as this thread will no longer be monitored by Intel