Intel® VTune™ Amplifier
Use Intel® VTune™ Amplifier to profile native or Java* applications running in an LXC*, Docker, or Mesos* container on a Linux system.
Prerequisites:
VTune Amplifier automatically detects an application running in the container. No container configuration specific for performance analysis is required. But to run VTune Amplifier's algorithm analyses (Basic hotspots, Concurrency, or Locks and waits), make sure to run the container with the ptrace support enabled:
host> docker run --cap-add=SYS_PTRACE -td myimage
or launch the container in the privileged mode:
host> docker run --privileged -td myimage
To configure and run an analysis for a container target from GUI:
Create a VTune Amplifier project on the host system.
Specify your analysis targetin the Analysis Target tab:
From the left pane, select your target system: local host to start analysis from your host Linux system or remote Linux (SSH) to start analysis from a remote Linux system connected to your host system via SSH. For the remote Linux targets, make sure to configure SSH connection.
Select a target type. For container target analysis, the following target types are supported: Attach to Process and Profile System.
In the Profile System mode, VTune Amplifier profiles all applications running in the same container or in different containers simultaneously. So, the standard limitation for the system-wide profiling of the managed code is not applicable to Java applications running in the containers.
From the right pane, configure your process or system target as usual using the following configuration panes:
You can attach the VTune Amplifier running under the superuser account to a Java process or a C/C++ application with embedded JVM instance running under a low-privileged user account. For example, you may attach the VTune Amplifier to Java based daemons or services.
The dynamic attach mechanism is supported only with the Java Development Kit (JDK).
Click the Choose Analysis button on the right to switch to the Analysis Type tab.
From the left pane, select an analysis and customize the analysis options, if required.
The Advanced Hotspots and General Exploration analyses are configured to use driverless data collection based on the Linux Perf* tool to gather performance data for targets running in a container.
Click Start to launch the analysis.
Alternatively, you may configure and run any of these analyses using the VTune Amplifier command line interface (amplxe-cl). For example, to run a system-wide Advanced Hotspots analysis locally, enter:
host> amplxe-cl -collect advanced-hotspots -analyze-system -d 60
To run Advanced Hotspots analysis in the Attach to Process mode on a remote system, enter:
host> amplxe-cl -target-system=ssh:user1@172.16.254.1 -collect advanced-hotspots --target-process=java -d 60
The collected result opens in the default Hotspots viewpoint, where paths to container modules show up with the docker or lxc prefixes. For example: