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

Use tasks in Attach-to-Process mode?

Hagen_G_
Beginner
510 Views

Hi,

I have recently tried the VTune tasks API and am quite happy with it, but I don't understand why it is restricted to the launch-process mode. For my work it would absolutely make sense to use it also in the attach-to-process mode (which I usually use).

Regards,

Hagen

0 Kudos
4 Replies
David_A_Intel1
Employee
510 Views

Hi!

Great question!  It has to do with the dynamic loading that is implemented so that your application can run with or *without* VTune Amplifier present.  If VTune Amplifier does not start the process, then the DLL does not load the actual API routines and instead links in stubs.  Thus, when you attach, there is nothing to report via the APIs.  If, however, VTune Amplifier is present, then the actual code is linked in and data is provided to VTune Amplifier during the run.  It is a tricky procedure that works well for the way it was designed.  However, it was not designed to support attaching.

We have received this feature request in the past, so I will add your voice to it and see if the development team can pick it up in a future release.

Thanks for your post!

0 Kudos
Peter_W_Intel
Employee
510 Views

This is hard to implement in my view, the reason is when the application is starting - itt domain and handle string for tasks and sub-tasks are created, but VTune didn't get notification. I write a simple test case - you can see sub-tasks string are marked, if and only if you use VTune to launch the application.

# gcc -g -O0 task_api_test.c -I/opt/intel/vtune_amplifier_xe_2015/include /opt/intel/vtune_amplifier_xe_2015/lib64/libittnotify.a -lpthread -ldl -o task_api_test

# amplxe-cl -c concurrency -knob enable-user-tasks=true -duration 10 -target-pid 30108 ; case 1, no task info marked

# amplxe-cl -c concurrency -knob enable-user-tasks=true -duration 10 -- ./task_api_test;  case 2, ctrl-C to stop collection, you can get sub-task info

 

 

 

0 Kudos
Hagen_G_
Beginner
510 Views

Hi Peter,

I don't say that the current VTune implementation should be able to correctly work with tasks in attach-to-process mode. But I think there is no technical reason why this feature cannot be implemented.

Of course one would possibly need to overthink the way how the user application and VTune communicate or when certain information is exchanged or initialized.

@MrAnderson: Collecting user's voices to get an overview which features are needed most is a good method - we do the same in our company :-)

0 Kudos
Peter_W_Intel
Employee
510 Views

Hagen G. wrote:

Hi Peter,

I don't say that the current VTune implementation should be able to correctly work with tasks in attach-to-process mode. But I think there is no technical reason why this feature cannot be implemented.

Of course one would possibly need to overthink the way how the user application and VTune communicate or when certain information is exchanged or initialized.

@MrAnderson: Collecting user's voices to get an overview which features are needed most is a good method - we do the same in our company :-)

Hi Hagen,

You're right! We need to learn more from our customers including feedbacks, feature requests and ideas. I didn't say it is impossible to implement - just said it is hard to do. It means that we might take more efforts to achieve the goal.

Back to this case, I think even VTune didn't start up but application was running, app with Task API can record domain creation, task handle string - then VTune warmed up (attach running process), will exchange infomation with application to know what happened before...so task begin/end region can be recognized.

It's my thought, not sure if it can be accepted by developer.

0 Kudos
Reply