I have the following code:
#include <stdio.h>
int main() {
for (size_t i = 0; i < 100000; i++)
{
printf("%zu ", i);
if(i == 10)
getchar();
}
}
When this executable is built and profiled in Windows with Visual Studio IDE integration, clicking on the start button within VTune opens a console window where I am able to see the printing of the numbers including waiting for user input from the getchar();
command.
I am unable to get this similar functionality in Ubuntu. I open VTune profiler via running the following script in Ubuntu:
source "/opt/intel/oneapi/vtune/latest/env/vars.sh" && vtune-gui --project-path "/home/TryerGit/GoogleDrive/research_programming/debugtesting/VTune/vtune" --app-path "/home/TryerGit/GoogleDrive/research_programming/debugtesting/VTune/.vscode/dist/Release/GNU-Linux/linux"
After this, VTune app opens up but when the Start profiling button is pressed, where exactly can one interact with the executable? Where, for e.g., would the printf
statements go and where can one press a character in response to getchar();
?
Intel folks confirmed that this seems to be a bug in VTune. A workaround was provided here