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

VTune fails to analyze a process running in a Docker container

Nathan_A_1
Beginner
2,489 Views

Hi,

I'd like to use VTune to profile a process running inside a docker container. This doesn't work in either the GUI or the command line. Running the command line version of the collector, VTune seems to report an internal assertion:

$ amplxe-cl -collect hotspots -target-pid $(pgrep writebench)
amplxe: Collection started. To stop the collection, either press CTRL-C or enter from another console window: amplxe-cl -r [redacted] -command stop.
amplxe: Error: [Instrumentation Engine]: Source/pin/base_l/sysfuncs_linux.cpp: GetProcessName: 208: assertion failed: p 
amplxe: Collection failed.
amplxe: Internal Error

I'm able to successfully analyze the same process when it's running outside of Docker. I'm using VTune 2016 Update 4:

$ cat support.txt 
Package ID: N/A
Package Contents: Intel(R) VTune(TM) Amplifier XE 2016 Update 4
Build Number: 470476

The issue is easily reproducible using the standard redis docker container:

$ docker run redis /usr/local/bin/redis-server

In another shell (running as root)

# amplxe-cl -collect hotspots -target-pid $(pgrep redis-server)
amplxe: Collection started. To stop the collection, either press CTRL-C or enter from another console window: amplxe-cl -r  [redacted]  -command stop.
amplxe: Error: [Instrumentation Engine]: Source/pin/base_l/sysfuncs_linux.cpp: GetProcessName: 208: assertion failed: p 
amplxe: Collection failed.
amplxe: Internal Error

 

Can you please help?

 

0 Kudos
5 Replies
Denis_P_Intel
Employee
2,489 Views

The Advanced Hotspots analysis type is the only available when you try to profile app running within a Docker container from the host. Don’t use other analysis types because they may cause the internal assertions.

Please, try the commands below where $PID is id of  a process running within a Docker container:
$ amplxe-cl -collect advanced-hotspots -target-pid=$PID
or if you want to see call stacks
$ amplxe-cl -collect advanced-hotspots -knob collection-detail=stack-sampling -target-pid=$PID

Pay attention that you have to copy the binaries (your apps and other) from the Docker container to the host for better symbol resolution and call stacks, then re-finalize the collected data.

Another option is to deploy VTune in a Docker container. In this case "Basic Hotspots" and "Lock and Waits" analysis types should work but other analysis type may have some problems.

Also if your target application generates dynamic code that you have to make extra steps to see it resolved in VTune GUI, otherwise the dynamic code will be shown as [Unknown] in the VTune GUI.

Thanks,
Denis
 

0 Kudos
Richard_K_Intel
Employee
2,489 Views
0 Kudos
Denis_P_Intel
Employee
2,489 Views

Hello Nathan,

Are you succeeded in using Advanced Hotspots for profiling app running inside a Docker container from the host? Do you need help?

0 Kudos
PAVEL_G_Intel
Employee
2,489 Views

Hi Denis,

As I know profiling in Docker is supported in VTune Amplifier 2018.  This may be found in release notes.
https://software.intel.com/en-us/articles/intel-vtune-amplifier-release-notes

Nathan uses VTune Amplifier 2016 XE Update 4. Are we expects that it will work?

0 Kudos
Denis_P_Intel
Employee
2,489 Views

Eagle eye award! Thanks,  Pavel )

Nathan, please try VTune Amplifier 2018 and let us know how it goes.

0 Kudos
Reply