Analyzers
Talk to fellow users of Intel Analyzer tools (Intel VTune™ Profiler, Intel Advisor)
5038 Discussions

Getting VTune Profiler to open the executable in a separate terminal in Linux Ubuntu

TryerGit
New Contributor I
1,344 Views

Hello,

I have the following code:

 

#include <stdio.h>

int main() {
    for (size_t i = 0; i < 100000; i++)
    {
        printf("%d ", i);
        if(i == 10)
            getchar();
    }
}

 

When this app 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();?

0 Kudos
1 Solution
JyothisV_Intel
Moderator
1,277 Views

Hi,

 

Good day to you.

 

Thanks for posting in Intel Communities.

 

We were able to replicate the issue that you mentioned from our side. We are checking with the internal team to find a solution to this. Intel VTune used to print the output of the program directly to the terminal window from which GUI is loaded while profiling an application. This seems to be bug and we are working to get a possible fix. Thanks for reporting the same. 

 

Alternatively as a workaround solution, we recommend using the VTune CLI to perform analysis of interactive applications rather than using the GUI for Linux. The results can later be opened inside VTune to view them. The steps to get the corresponding CLI command for any GUI equivalent configuration is given below:

  1. Open VTune GUI from the Linux terminal window by running the below commands:
    source /opt/intel/oneapi/setvars.sh
    vtune-gui​
  2. Configure the analysis like you typically do in the WHERE, WHAT and HOW sections.
  3. Once all analysis configurations are selected, instead of starting the analysis, click on the Command Line button (Refer attached screenshot) at the bottom of the GUI to get the equivalent CLI command. Copy the command by clicking the Copy button from the dialog box.
  4. Close Intel VTune Profiler GUI and run the copied command in the terminal window. The output of the application is printed directly to the terminal window and can accept user inputs and display output during the run.
  5. Once the analysis is done, the results will be generated.
  6. Then open VTune GUI again by running the vtune-gui command.
  7. Click the Open Results button (Refer attached screenshot) to navigate to the directory where the analysis results were generated and choose the *.vtune present in that directory to view the corresponding results in VTune GUI

 

Sorry for the inconvenience caused. We will get back to you with an update fix soon.

 

Do get back to us if you face any issues.

 

Thanks and Regards,

Jyothis V James

 

View solution in original post

0 Kudos
3 Replies
JyothisV_Intel
Moderator
1,278 Views

Hi,

 

Good day to you.

 

Thanks for posting in Intel Communities.

 

We were able to replicate the issue that you mentioned from our side. We are checking with the internal team to find a solution to this. Intel VTune used to print the output of the program directly to the terminal window from which GUI is loaded while profiling an application. This seems to be bug and we are working to get a possible fix. Thanks for reporting the same. 

 

Alternatively as a workaround solution, we recommend using the VTune CLI to perform analysis of interactive applications rather than using the GUI for Linux. The results can later be opened inside VTune to view them. The steps to get the corresponding CLI command for any GUI equivalent configuration is given below:

  1. Open VTune GUI from the Linux terminal window by running the below commands:
    source /opt/intel/oneapi/setvars.sh
    vtune-gui​
  2. Configure the analysis like you typically do in the WHERE, WHAT and HOW sections.
  3. Once all analysis configurations are selected, instead of starting the analysis, click on the Command Line button (Refer attached screenshot) at the bottom of the GUI to get the equivalent CLI command. Copy the command by clicking the Copy button from the dialog box.
  4. Close Intel VTune Profiler GUI and run the copied command in the terminal window. The output of the application is printed directly to the terminal window and can accept user inputs and display output during the run.
  5. Once the analysis is done, the results will be generated.
  6. Then open VTune GUI again by running the vtune-gui command.
  7. Click the Open Results button (Refer attached screenshot) to navigate to the directory where the analysis results were generated and choose the *.vtune present in that directory to view the corresponding results in VTune GUI

 

Sorry for the inconvenience caused. We will get back to you with an update fix soon.

 

Do get back to us if you face any issues.

 

Thanks and Regards,

Jyothis V James

 

0 Kudos
TryerGit
New Contributor I
1,229 Views

Thanks. Your suggestion works. Please do push a bug fix.

0 Kudos
JyothisV_Intel
Moderator
1,092 Views

Hi,


Good day to you.


Thanks for confirming the same.


We have escalated this issue to the development team, and they are working on a fix shortly. We will get back to you when it is fixed.


Thanks and Regards,

Jyothis V James


0 Kudos
Reply