Commit 6ec5ae02 authored by Alexander Alekhin's avatar Alexander Alekhin Committed by Alexander Alekhin

core(trace): add ITT control parameter

- OPENCV_TRACE_ITT_ENABLE
parent 1864b64f
......@@ -196,14 +196,27 @@ static __itt_domain* domain = NULL;
static bool isITTEnabled()
{
static bool isInitialized = false;
static volatile bool isInitialized = false;
static bool isEnabled = false;
if (!isInitialized)
{
isEnabled = !!(__itt_api_version());
CV_LOG_ITT("ITT is " << (isEnabled ? "enabled" : "disabled"));
domain = __itt_domain_create("OpenCVTrace");
isInitialized = true;
cv::AutoLock lock(cv::getInitializationMutex());
if (!isInitialized)
{
bool param_traceITTEnable = utils::getConfigurationParameterBool("OPENCV_TRACE_ITT_ENABLE", true);
if (param_traceITTEnable)
{
isEnabled = !!(__itt_api_version());
CV_LOG_ITT("ITT is " << (isEnabled ? "enabled" : "disabled"));
domain = __itt_domain_create("OpenCVTrace");
}
else
{
CV_LOG_ITT("ITT is disabled through OpenCV parameter");
isEnabled = false;
}
isInitialized = true;
}
}
return isEnabled;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment