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

Starting and stopping profiling

peter_silie
Beginner
346 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
346 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.

0 Kudos
Mark_D_Intel
Employee
346 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
0 Kudos
Mark_D_Intel
Employee
346 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
0 Kudos
Reply