Analyzers
Community support for Analyzers (Intel VTune™ Profiler, Intel Advisor, Intel Inspector)
Announcements
The Intel sign-in experience has changed to support enhanced security controls. If you sign in, click here for more information.
4819 Discussions

Starting and stopping profiling

peter_silie
Beginner
203 Views
Hi, collecting information using Thread Profiler is sometimes pretty time consuming. Is there a way to start and stop profiling from within the code using certain function calls such that only relevant parts are considered? Thank you very much in advance.

0 Kudos
3 Replies
Vladimir_T_Intel
Moderator
203 Views

In my opinion, there is no sense in such functionality since Tread Profiler is intended to analyze the treading model of the whole application, i.e. from the life beginning of the main thread to its death. If you restrict the analysis to the certain functions, the important threading events could be unmanageably missed and the results become useless.

Mark_D_Intel
Employee
203 Views
The __itt_pause and __itt_resume calls should do what you want. Look in the help under "API Support -> APIs to Control Data Collection" for more information.

You could also lower the instrumentation level for modules that you are not interested in, but as Vladimir points out, then you run the risk of missing threading API's.

Mark
Mark_D_Intel
Employee
203 Views
It can be useful to restrict detailed analysis to certain parts of the program. (Note that the pause/resume APIs restrict the analysis in time, not to particular functions - calling __itt_pause on on thread suspends analysis for all the threads.) A typically example would be a program with multiple phases, and the user is only interested in a single phase - by pausing the analysis during the uninteresting phases, TP doesn't incur the overhead of tracking all the thread synchronization in those phases. (Synchronization interactions between the phases would be missed, but those might be known already, either through the structure of the program or from runs of TP covering the whole program).

Mark
Reply