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

The VTune CLI hang when do some performance collect

Fangyin
Beginner
1,267 Views

hi

I setup one VMWare virtual machine and install the Ubuntu 18.04 Desktop OS.

I enabled the virtual CPU performance counter feature on my VM.

Then install the vtune_profiler_2020_update1.tar.gz and use the command to collect the hotspots( PID 2687 is my application and the execute file have the debug symbols and not stripped

vtune -collect hotspots -r sc_hotspots -target-pid=2687 -duration=20

I want to collect the hotspots duration 20 seconds but the command can't finalization automatically, i try to use the CTRL+C to end the command but failed. 

It seems like the vtune hang when it collect the performance data.

0 Kudos
6 Replies
JananiC_Intel
Moderator
1,251 Views

Hi Fangyin,


 

Thanks for reaching out to us. We have tried executing the commands which you have shared in devcloud which is an ubuntu machine and was able to run successfully. Also we are trying to deploy an ubuntu vm machine in order to try the same, will get back to you soon.



0 Kudos
Fangyin
Beginner
1,248 Views

hi, JananiC

Here are my system information and i hope this have a little help for this issue.

I setup one VMWare virtual machine and the guest OS:

root@sonicwall-virtual-machine:~# lsb_release -a
No LSB modules are available.
Distributor ID: Ubuntu
Description: Ubuntu 18.04 LTS
Release: 18.04
Codename: bionic

 

This is my application which i want to analyse:

root@sonicwall-virtual-machine:~/sonicos-base# file sonicosv.ns.eng
sonicosv.ns.eng: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), dynamically linked, interpreter /lib64/ld-linux-x86-64.so.2, for GNU/Linux 3.2.0, BuildID[sha1]=2ab55d53920c979aa5b898abf9b8ffddac899d6e, with debug_info, not stripped

 

And i think my application runs fine:

root@sonicwall-virtual-machine:~/sonicos-base# ps -elf | grep sonicosv
4 S root 2997 2957 95 80 0 - 917021 futex_ 14:47 pts/2 00:00:23 ./sonicosv.ns.eng
0 S root 3303 2877 0 80 0 - 5383 pipe_w 14:47 pts/1 00:00:00 grep --color=auto sonicosv

 

So now i can use the vtune CLI to capture the hotspots performance data as below:

root@sonicwall-virtual-machine:~# vtune -collect hotspots -r sc_hotspots -target-pid=2997 -duration=60

I try to use the vtune CLI to attach my application and want to collect the hotspots performance data duration 60 seconds.

But unfortunately the vtune command stucked more than 60 seconds, even more than 1 hour.

I can't use the CTRL+C to terminate the vtune command except use the CTRL+Z.

I try to use the strace system command to attach the vtune process and find this:

 

root@sonicwall-virtual-machine:~/sonicos-base# ps -elf | grep vtune
5 S root 4127 1 0 80 0 - 9699 poll_s 14:54 ? 00:00:00 SCREEN -dmS vtune_run
4 S root 4292 4128 0 80 0 - 145746 futex_ 14:56 pts/3 00:00:01 vtune -collect hotspots -r sc_hotspots -target-pid=2997 -duration=60
0 S root 4320 4292 0 80 0 - 166424 futex_ 14:56 pts/3 00:00:00 /opt/intel/vtune_profiler_2020.1.0.607630/bin64/amplxe-runss --ui-output-fo--ui-output-fd 5 --option-file /home/sonicwall/sc_hotspots/config/runss.options
4 S root 4340 4320 0 80 0 - 8191 poll_s 14:56 pts/3 00:00:00 /opt/intel/vtune_profiler_2020.1.0.607630/bin64/amplxe-perf stat --log-fd 2/tmp/amplxe-tmp-root/perf-pipe-4320-5289692790633 --pipe-sync -c -x ; -p 2997 -e cpu/event=0x3c,name='CPU_CLK_UNHALTED.THREAD'/Duk,cpu/umask=0x3,name=UNHALTED.REF_TSC'/Duk,cpu/event=0xc0,name='INST_RETIRED.ANY'/Duk,cpu/event=0x3c,umask=0x1,name='CPU_CLK_UNHALTED.REF_XCLK'/uk,cpu/event=0x3c,umask=0x2U_CLK_UNHALTED.ONE_THREAD_ACTIVE'/uk,cpu/event=0x10,umask=0x10,name='FP_COMP_OPS_EXE.SSE_PACKED_DOUBLE'/uk,cpu/event=0x10,umask=0x40,name='FP_COMP_OPSPACKED_SINGLE'/uk,cpu/event=0x11,umask=0x1,name='SIMD_FP_256.PACKED_SINGLE'/uk,cpu/event=0x11,umask=0x2,name='SIMD_FP_256.PACKED_DOUBLE'/uk,cpu/event=k=0x20,name='FP_COMP_OPS_EXE.SSE_SCALAR_SINGLE'/uk,cpu/event=0x10,umask=0x80,name='FP_COMP_OPS_EXE.SSE_SCALAR_DOUBLE'/uk,cpu/event=0x10,umask=0x1,name_OPS_EXE.X87'/uk,cpu/event=0xb1,umask=0x1,name='UOPS_EXECUTED.THREAD'/uk,cpu/event=0xc2,umask=0x2,name='UOPS_RETIRED.RETIRE_SLOTS'/uk /opt/intel/vtune_2020.1.0.607630/bin64/amplxe-perf-sync sync tsc
0 S root 4341 4340 0 80 0 - 5344 ia32_s 14:56 pts/3 00:00:00 /opt/intel/vtune_profiler_2020.1.0.607630/bin64/amplxe-perf-sync sync tsc
0 S root 5097 2877 0 80 0 - 5383 pipe_w 15:03 pts/1 00:00:00 grep --color=auto vtune

 

root@sonicwall-virtual-machine:~/sonicos-base# strace -p 4292
strace: Process 4292 attached
futex(0x7fff6f747178, FUTEX_WAIT_PRIVATE, 0, NULLstrace: Process 4292 detached
<detached ...>
root@sonicwall-virtual-machine:~/sonicos-base#
root@sonicwall-virtual-machine:~/sonicos-base# strace -p 4320
strace: Process 4320 attached
futex(0x1a77734, FUTEX_WAIT_PRIVATE, 0, NULLstrace: Process 4320 detached
<detached ...>

 

root@sonicwall-virtual-machine:~/sonicos-base# strace -p 4340
strace: Process 4340 attached
restart_syscall(<... resuming interrupted poll ...>) = 0
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100) = 0 (Timeout)
wait4(4341, 0x7ffd9ef3d0cc, WNOHANG, NULL) = 0
poll([{fd=1918, events=POLLIN}], 1, 100strace: Process 4340 detached
<detached ...>

 

root@sonicwall-virtual-machine:~/sonicos-base# strace -p 4341
strace: Process 4341 attached
pause(strace: Process 4341 detached
<detached ...>

 

0 Kudos
ArunJ_Intel
Moderator
1,242 Views

Hi Fangyin,


We were able to reproduce the issue in ubuntu virtual machines. We are forwarding this to SME for further verification


Thanks

Arun


0 Kudos
Kevin_O_Intel1
Employee
1,170 Views

Are you able to run from the beginning... ie not attach? 

Can you send us some additional information? The vtune result directory.

You have the option of running a hardware collection as follows:

vtune -collect hotspots sampling-mode=hw app

This uses a different collection mechanism

 

 

0 Kudos
Fangyin
Beginner
1,160 Views

i didn't run my app from beginning, because my app is nearly the deadloop and it can't stop except crash. The other thing is need to do some preparation before run my app, so we start the app in one shell script.

Due to my app is special, so i want to start my app first and then use the target-pid to attach my app and use the duration to collect a few time performance data.  I make sure my app include the debug information and not strip the symbols, but VTune CLI isn't work for this.

i notice that you remind me to use the parameter sampling-mode=hw to collect the hotspots, yes it can get the performance data but i think the report is not expected.

 

sampling-mode

User-Mode Sampling(sw) mode use for: profiles longer than a few seconds,
profiling a single process or a process-tree, profiling Python and Intel
runtimes. Hardware Event-Based Sampling(hw) mode use for: profiles shorter
than a few seconds, profiling all processes on a system, including kernel.

Default value: sw
Possible values: sw hw

 

From the VTune help document, i just want to profiling my app not the whole system.

Please see the attach file for vtune result directory.

0 Kudos
Kevin_O_Intel1
Employee
1,077 Views

You said the attach pid did not work using the command-line... can you tell me what happenned?

Also, you can also launch a script that does setup if this works for your app.

If you do use the HW collector it will profile the system but you have the option to filter by process


0 Kudos
Reply