Intel® VTune™ Profiler Performance Analysis Cookbook

ID 766316
Date 9/05/2023
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

Profiling a Remote Target Through a Proxy Server (NEW)

This recipe describes how to run Intel® VTune™ Profiler through a proxy server to profile remote targets.

When you need to profile remote target systems, follow this recipe to run Intel® VTune™ Profiler through a proxy server. The recipe describes host configurations for Windows, Linux*, and macOS* systems.

Ingredients

This section lists the software used for the performance analysis scenario.

  • Operating system: Windows, Linux, or macOS systems

  • Tools:Intel® VTune™ Profiler

    NOTE:
    • Starting with the 2020 release, Intel® VTune™ Amplifier has been renamed to Intel® VTune™ Profiler.

    • Most recipes in the Intel® VTune™ Profiler Performance Analysis Cookbook are flexible. You can apply them to different versions of Intel® VTune™ Profiler. In some cases, minor adjustments may be required.

    • Get the latest version of Intel® VTune™ Profiler:

Windows Host Configuration

Prerequisites:

If you do not already have RSA private/public keys for passwordless SSH access, follow this procedure to generate them using the internal VTune Profiler generator.

  1. Create a python script called generator.py. In this script, replace USER with your username and HOSTNAME with the name of your target machine.

    import sys
    import pythonhelpers1.genhelpers as genhelpers
    if len(sys.argv) < 2:
        print("Usage: amplxe-python generator.py USER@HOSTNAME")
        sys.exit(1)
    private_key = "id_rsa_vtune_" + str(sys.argv[1])
    genhelpers.ssh_keygen(private_key, private_key + '.pub')
    
  2. In a command window, run this command:

    VTUNE_INSTALL_DIR\bin64\amplxe-python generator.py USER@HOSTNAME

The private and public keys should get created in the current directory.

Run VTune Profiler on Windows Host through Proxy Server
  1. Copy these keys to the %USERPROFILE%\.ssh directory on the host system:

    • id_rsa_vtune_USER@HOSTNAME
    • id_rsa_vtune_USER@HOSTNAME.pub
  2. Add the content of the public key to ~/.ssh/authorized_keys on the target system and ~ - USER home directory.

  3. Install the Ncat third-party utility on the Windows host for remote connection through a proxy server. You can download this from https://nmap.org/ncat.

  4. Create %USERPROFILE%\.ssh\config with these lines:

    Host HOSTNAME
        ProxyCommand “PATH\TO\NCAT\ncat.exe” --proxy-type <TYPE> --proxy <PROXYADDR[:PORT]> %h %p
    

    Here,

    • TYPE refers to the type of proxy server.
    • PROXYADDR refers to the address of the proxy server.
    • PORT refers to the port number.

  5. Fix permissions for the config and private key.

    icacls %USERPROFILE%\.ssh\id_rsa_vtune_USER@HOSTNAME /inheritance:r 
    icacls %USERPROFILE%\.ssh\id_rsa_vtune_USER@HOSTNAME /grant:r "%USERNAME%":"(R)"
    icacls %USERPROFILE%\.ssh\config /inheritance:r 
    icacls %USERPROFILE%\.ssh\config /grant:r "%USERNAME%":"(R)"
    
  6. Check the connection by calling the uname command.

    VTUNE_INSTALL_DIR\bin64\ssh.exe -i "%USERPROFILE%\.ssh\id_rsa_vtune_USER@HOSTNAME" USER@HOSTNAME uname

You are now ready to run Intel® VTune™ Profiler on the Windows host to profile the remote target.

Linux/macOS Host Configuration

Prerequisites: If you do not already have RSA private/public keys for passwordless SSH access, generate them using an empty passphrase :

host> ssh-keygen -t rsa

Run VTune Profiler on Linux/macOS Host through Proxy Server
  1. Add the content of the public key to ~/.ssh/authorized_keys on the target system, ~ - USER home directory. Replace USER with your username.

  2. If you do not already have it on the host machine, download and install Ncat or Netcat third-party utilities on the host for remote connection through proxy. You can download them from:

  3. Create ~/.ssh/config with these lines. The nc option depends on your version.

    Host HOSTNAME
        ProxyCommand nc -X <TYPE> –x <PROXYADDR[:PORT]> %h %p
    

    or

    Host HOSTNAME
        ProxyCommand nc --proxy-type <TYPE> --proxy <PROXYADDR[:PORT]> %h %p
    

    where:

    • HOSTNAME refers to the name of the target machine.
    • TYPE refers to the type of proxy server.
    • PROXYADDR refers to the address of the proxy server.
    • PORT refers to the port number.

  4. Check the connection by calling the uname command.

    ssh USER@HOSTNAME uname

You are now ready to run Intel® VTune™ Profiler on the Linux or macOS host to profile the remote target.