"Sampling API Error" when trying to pause/resume sampling
I am trying to use __itt_pause() and __itt_resume() to filter out certain parts of my code which I do not want sampled. I am running "Lightweight Hotspots" in Amplifier XE 2011 in Visual Studio 2008. When I run my code I get lots of printouts to console including these types of messages
... The sampling collection resumed. The sampling collection paused. Sampling API Error: resume sampling collection failed. Sampling API Error: pause sampling collection failed. The sampling collection resumed. The sampling collection paused. ...
1. Why am I getting the "Sampling API Error"? I saw another thread (http://software.intel.com/en-us/forums/showthread.php?t=78961&o=a&s=lr) that indicated there may be issues with frequent collection switching (though no definitive answer was given in the end). 2. Why is the API printing to console at all (even when no error)??? This would just slow down the program's execution, no?
This problem may be observed in test code as simple as the following test2.cpp