Profiling a Remote Target Through a Proxy Server (NEW)
This recipe describes how to run
Intel® VTune™
through a proxy server to profile remote targets.
Profiler
Content expert:
Kirill UhanovWhen you need to profile remote target systems, follow this recipe to run
Intel® VTune™
through a proxy server. The recipe describes host configurations for Windows, Linux*, and macOS* systems.
Profiler
Ingredients
This section lists the software used for the performance analysis scenario.
- Operating system: Windows, Linux, or macOS systems
- Tools:Intel® VTune™Profiler
- Starting with the 2020 release, Intel® VTune™ Amplifier has been renamed toIntel® VTune™.Profiler
- Most recipes in theIntel® VTune™Performance Analysis Cookbook are flexible. You can apply them to different versions ofProfilerIntel® VTune™. In some cases, minor adjustments may be required.Profiler
- Get the latest version ofIntel® VTune™:Profiler
- From theIntel® VTune™product page.Profiler
- Download the latest standalone package from the Intel® oneAPI standalone components page.
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.
- Create a python script calledgenerator.py. In this script, replaceUSERwith your username andHOSTNAMEwith 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.
Run VTune Profiler on Windows Host through Proxy Server
- Copy these keys to the%USERPROFILE%\.sshdirectory 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_keyson the target system and~ -home directory.USER
- Install theNcatthird-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\configwith these lines:Host HOSTNAME ProxyCommand “PATH\TO\NCAT\ncat.exe” --proxy-type <TYPE> --proxy <PROXYADDR[:PORT]> %h %pHere,
- TYPErefers to the type of proxy server.
- PROXYADDRrefers to the address of the proxy server.
- PORTrefers 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 theunamecommand.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™
on the Windows host to profile the remote target.
Profiler
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
- Add the content of the public key to~/.ssh/authorized_keyson the target system,~ -home directory. Replace USER with your username.USER
- 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/configwith these lines. Thencoption depends on your version.Host HOSTNAME ProxyCommand nc -X <TYPE> –x <PROXYADDR[:PORT]> %h %porHost HOSTNAME ProxyCommand nc --proxy-type <TYPE> --proxy <PROXYADDR[:PORT]> %h %pwhere:
- HOSTNAMErefers to the name of the target machine.
- TYPErefers to the type of proxy server.
- PROXYADDRrefers to the address of the proxy server.
- PORTrefers to the port number.
- Check the connection by calling theunamecommand.ssh USER@HOSTNAME uname
You are now ready to run
Intel® VTune™
on the Linux or macOS host to profile the remote target.
Profiler