Skip to content

Commit f256525

Browse files
committed
add more debug logs
1 parent ffce2c7 commit f256525

File tree

2 files changed

+18
-3
lines changed

2 files changed

+18
-3
lines changed

profiler/src/ProfilerEngine/Datadog.Profiler.Native/CorProfilerCallback.cpp

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,7 @@ IClrLifetime* CorProfilerCallback::GetClrLifetime() const
7777

7878
void CorProfilerCallback::SetStackSamplerEnabled(bool enabled)
7979
{
80+
Log::Debug("CorProfilerCallback::SetStackSamplerEnabled: ", enabled);
8081
if (enabled)
8182
{
8283
_pStackSamplerLoopManager->Start();
@@ -91,29 +92,37 @@ void CorProfilerCallback::SetAllocationTrackingEnabled(bool enabled)
9192
{
9293
if (_pClrEventsParser)
9394
{
95+
Log::Debug("CorProfilerCallback::SetAllocationTrackingEnabled: ", enabled);
9496
_pClrEventsParser->SetAllocationTrackingEnabled(enabled);
9597
}
9698
else
9799
{
98-
Log::Debug("SetAllocationTrackingEnabled: trying to enable/disable while it was not configured");
100+
Log::Debug("CorProfilerCallback::SetAllocationTrackingEnabled: trying to enable/disable while it was not configured (PYROSCOPE_PROFILING_ALLOCATION_ENABLED)");
99101
}
100102
}
101103

102104
void CorProfilerCallback::SetContentionTrackingEnabled(bool enabled)
103105
{
104106
if (_pClrEventsParser)
105107
{
108+
Log::Debug("CorProfilerCallback::SetContentionTrackingEnabled: ", enabled);
106109
_pClrEventsParser->SetContentionTrackingEnabled(enabled);
107110
}
108111
else
109112
{
110-
Log::Debug("SetContentionTrackingEnabled: trying to enable/disable while it was not configured");
113+
Log::Debug("CorProfilerCallback::SetContentionTrackingEnabled: trying to enable/disable while it was not configured (PYROSCOPE_PROFILING_CONTENTION_ENABLED)");
111114
}
112115
}
113116

114117
void CorProfilerCallback::SetExceptionTrackingEnabled(bool enabled)
115118
{
116-
_exceptionTrackingEnabled = enabled;
119+
if (_pExceptionsProvider != nullptr)
120+
{
121+
Log::Debug("CorProfilerCallback::SetExceptionTrackingEnabled: ", enabled);
122+
_exceptionTrackingEnabled = enabled;
123+
} else {
124+
Log::Debug("CorProfilerCallback::SetExceptionTrackingEnabled: trying to enable/disable while it was not configured (PYROSCOPE_PROFILING_EXCEPTION_ENABLED)");
125+
}
117126
}
118127

119128
std::shared_ptr<PyroscopePprofSink> CorProfilerCallback::GetPyroscopePprofSink() {

profiler/src/ProfilerEngine/Datadog.Profiler.Native/StackSamplerLoopManager.cpp

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,12 @@ bool StackSamplerLoopManager::Start()
9191
{
9292
return true;
9393
}
94+
95+
if (_pWallTimeCollector == nullptr && _pCpuTimeCollector == nullptr)
96+
{
97+
Log::Warn("StackSamplerLoopManager::Start cpu & wall disabled - not starting");
98+
return true;
99+
}
94100
_isWatcherShutdownRequested = false;
95101
this->RunStackSampling();
96102
this->RunWatcher();

0 commit comments

Comments
 (0)