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

VTune `__itt_resume()` and `__itt_pause()` do nothing

guymo
Novice
1,921 Views

 

 

Hi,

I'm working in the Intel DevCloud with VTune connected through VSCode

( as described here: https://www.intel.com/content/www/us/en/docs/vtune-profiler/cookbook/2023-0/using-vtune-server-with-vs-code-intel-devcloud.html )

In my code I'm using  `__itt_resume()` and `__itt_pause()` as in this example:

 

include <ittnotify.h>

int main(int argc, char* argv[])
{
  // Do initialization work here
  __itt_resume();
 	// Do profiling work here
  __itt_pause();
  // Do finalization work here
  return 0;
}

 

I set up my environment as in this guide:

https://www.intel.com/content/www/us/en/docs/vtune-profiler/user-guide/2024-1/configuring-your-build-system.html

The problem is that when I run the profiler in paused mode the exectuion finishes but all of the analysis results are 0 except of elapsed time.

guymo_0-1711818664330.png

My compile flags are:

 

g++ -std=c++14 -g -mavx512vl  -c -I../common -I/opt/intel/oneapi/vtune/2024.1/sdk/include -O3 -fopenmp -mcmodel=medium ft.cpp
g++ -std=c++14 -g -mavx512vl -O3 -fopenmp -mcmodel=medium -o ../bin/ft.B ft.o  -lm -lpthread -littnotify -ldl -L/opt/intel/oneapi/vtune/2024.1/sdk/lib64

 

 I also tried setting the env variables:

 

export INTEL_LIBITTNOTIFY64=/opt/intel/oneapi/vtune/2024.1/lib64/runtime/libittnotify_collector.so
export INTEL_LIBITTNOTIFY32=/opt/intel/oneapi/vtune/2024.1/lib32/runtime/libittnotify_collector.so

 

(I'm not sure if I did this correctly, a clarification about how and where is should be done would help)

I need help figuring this out

Thank you

Labels (1)
0 Kudos
8 Replies
yuzhang3_intel
Moderator
1,910 Views

__itt_resume( )/__itt_pause( ) are just used to control the data collection. You can focus on the code area analysis you have an interest in. 

You need to  start the application run with collection paused, like below:

$ vtune -collect hotspots  --start-paused  -- your path/binary

 

From the VTune data below, you can see all data started to collect until the binary goes to the API, __itt_resume( ) and data stopped when the __itt_pause( ) is ended.

yuzhang3_intel_0-1712019486360.png

https://www.intel.com/content/www/us/en/docs/vtune-profiler/user-guide/2024-1/collection-control-api.html

 

But from your post above, it looks like there is no data and metrics shown in the VTune data, you need to check VTune works first w/o ITT API.

0 Kudos
guymo
Novice
1,871 Views

That's exactly my problem.

VTune works fine when I don't use the API,

But when I try starting paused and calling __itt_resume( ) then I get nothing recorded

0 Kudos
yuzhang3_intel
Moderator
1,863 Views

Could you share your VTune data?

0 Kudos
guymo
Novice
1,859 Views

I now tried running the same code once in `Performance Snapshot` mode and once in `Hotspots` mode.

In `Performance Snapshot` I got the same results as in the original post showing 0 collected data.

In `Hotspots` I actually got result similar to yours, showing me the paused section with the collected data afterwards.

I don't understand why would `Performance Snapshot` won't work with the ITT api?

Thank you

0 Kudos
yuzhang3_intel
Moderator
1,828 Views

Did you check if the VTune drivers are all working?

0 Kudos
guymo
Novice
1,692 Views

How can I test if the VTune drivers are working?

0 Kudos
yuzhang3_intel
Moderator
1,685 Views

Enter VTune driver source path, like /opt/intel/oneapi/vtune/latest/sepdk/src , run ./insmod-sep -q to check driver.

pax driver is loaded and owned by group "vtune" with file permissions "660".
socperf3 driver is loaded and owned by group "vtune" with file permissions "660".
sep5 driver is loaded and owned by group "vtune" with file permissions "660".

socwatch2_15 driver is loaded and owned by group "vtune" with file permissions "660".

vtsspp driver is loaded and owned by group "vtune" with file permissions "660".

 

Run vtune-self-checker.sh to check VTune environment:

/opt/intel/oneapi/vtune/latest/bin64$ vtune-self-checker.sh

0 Kudos
Koz
Beginner
960 Views

Are there any updates for this issue?  I see the same issue as the original poster.

The sampling drivers are installed and vtune-self-checker.sh passes.

If I start VTune paused and try to resume with __itt_resume() then it says collection never resumed, but this only happens for performance_snapshot.  It works for other collection types.

0 Kudos
Reply