Visible to Intel only — GUID: GUID-060B7F39-0A7B-48DC-A0B5-9465CE9230B7
Visible to Intel only — GUID: GUID-060B7F39-0A7B-48DC-A0B5-9465CE9230B7
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:
From the Intel® VTune™ Profiler product page.
Download the latest standalone package from the Intel® oneAPI standalone components page.
Windows Host Configuration
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.
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')
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.
Copy these keys to the %USERPROFILE%\.ssh directory on the host system:
- id_rsa_vtune_USER@HOSTNAME
- id_rsa_vtune_USER@HOSTNAME.pub
Add the content of the public key to ~/.ssh/authorized_keys on the target system and ~ - USER home directory.
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.
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.
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)"
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
Add the content of the public key to ~/.ssh/authorized_keys on the target system, ~ - USER home directory. Replace USER with your username.
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:
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.
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.