Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Don't log a warning for CORPROF_E_PROFILER_CANCEL_ACTIVATION #6550

Merged
merged 1 commit into from
Jan 17, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,8 @@ HRESULT STDMETHODCALLTYPE CorProfilerClassFactory::QueryInterface(REFIID riid, v
this->AddRef();

// We try to load the class factory of all target cor profilers.
if (FAILED(m_dispatcher->LoadClassFactory(riid)))
{
Log::Warn("Error loading all cor profiler class factories.");
}

// Errors are already logged in the dispatcher.
m_dispatcher->LoadClassFactory(riid);
return S_OK;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -164,8 +164,15 @@ namespace datadog::shared::nativeloader
HRESULT result = m_continuousProfilerInstance->LoadClassFactory(riid);
if (FAILED(result))
{
Log::Warn("DynamicDispatcherImpl::LoadClassFactory: Error trying to load continuous profiler class factory in: ",
m_continuousProfilerInstance->GetFilePath());
if (result == CORPROF_E_PROFILER_CANCEL_ACTIVATION)
{
Log::Info("The continuous profiler is disabled");
}
else
{
Log::Warn("DynamicDispatcherImpl::LoadClassFactory: Error trying to load continuous profiler class factory in: ",
m_continuousProfilerInstance->GetFilePath());
}

// If we cannot load the class factory we release the instance.
m_continuousProfilerInstance.release();
Expand All @@ -178,7 +185,14 @@ namespace datadog::shared::nativeloader
HRESULT result = m_tracerInstance->LoadClassFactory(riid);
if (FAILED(result))
{
Log::Warn("DynamicDispatcherImpl::LoadClassFactory: Error trying to load tracer class factory in: ", m_tracerInstance->GetFilePath());
if (result == CORPROF_E_PROFILER_CANCEL_ACTIVATION)
{
Log::Info("The tracer is disabled");
}
else
{
Log::Warn("DynamicDispatcherImpl::LoadClassFactory: Error trying to load tracer class factory in: ", m_tracerInstance->GetFilePath());
}

// If we cannot load the class factory we release the instance.
m_tracerInstance.release();
Expand Down Expand Up @@ -211,7 +225,7 @@ namespace datadog::shared::nativeloader
HRESULT result = m_continuousProfilerInstance->LoadInstance(pUnkOuter, riid);
if (FAILED(result))
{
Log::Warn("DynamicDispatcherImpl::LoadInstance: Error trying to load the continuous profiler instance in: ",
Log::Warn("DynamicDispatcherImpl::LoadInstance: Error trying to load the continuous profiler instance in: ",
m_continuousProfilerInstance->GetFilePath());

// If we cannot load the class factory we release the instance.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,14 @@ namespace datadog::shared::nativeloader
}
else
{
Log::Warn("DynamicInstanceImpl::LoadClassFactory: Error getting IClassFactory from: ", m_mainLibrary.GetFilePath());
if (res == CORPROF_E_PROFILER_CANCEL_ACTIVATION)
{
Log::Info("DynamicInstanceImpl::LoadClassFactory: The IClassFactory from ", m_mainLibrary.GetFilePath(), " is disabled");
}
else
{
Log::Warn("DynamicInstanceImpl::LoadClassFactory: Error getting IClassFactory from: ", m_mainLibrary.GetFilePath());
}
}

Log::Debug("DynamicInstanceImpl::LoadClassFactory: ", res);
Expand Down
Loading