mirror of
https://github.com/opencv/opencv.git
synced 2025-06-09 10:40:46 +08:00
Merge pull request #15761 from alalek:core_trace_itt_parameter
This commit is contained in:
commit
d8ab83600b
@ -196,14 +196,27 @@ static __itt_domain* domain = NULL;
|
|||||||
|
|
||||||
static bool isITTEnabled()
|
static bool isITTEnabled()
|
||||||
{
|
{
|
||||||
static bool isInitialized = false;
|
static volatile bool isInitialized = false;
|
||||||
static bool isEnabled = false;
|
static bool isEnabled = false;
|
||||||
if (!isInitialized)
|
if (!isInitialized)
|
||||||
{
|
{
|
||||||
isEnabled = !!(__itt_api_version());
|
cv::AutoLock lock(cv::getInitializationMutex());
|
||||||
CV_LOG_ITT("ITT is " << (isEnabled ? "enabled" : "disabled"));
|
if (!isInitialized)
|
||||||
domain = __itt_domain_create("OpenCVTrace");
|
{
|
||||||
isInitialized = true;
|
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;
|
return isEnabled;
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user