{
SamplingSharedState state = {};
state.stackWillBeChanged = true;
+ bool needPrintWarning = false;
m_profiler.GetCommonTrace().InterruptSampling(
state,
{},
- [](ThreadInfo &thrInfo, SamplingSharedState &state)
+ [&needPrintWarning](ThreadInfo &thrInfo, SamplingSharedState &state)
{
- thrInfo.eventChannel.Pop();
+ // AArch64 CoreCLR versions till 5.0 don't have CodeGen::genProfilingEnterCallback and CodeGen::genProfilingLeaveCallback
+ // implemented, CoreCLR will not call EnterNaked3(), LeaveNaked3() and TailcallNaked3(). As result, we don't have full callstack.
+ // Note, ICorProfilerInfo3::SetEnterLeaveFunctionHooks3() don't provide any errors connected to issue above.
+ if (thrInfo.eventChannel.GetStackSize() > 0)
+ thrInfo.eventChannel.Pop();
+ else
+ needPrintWarning = true;
+
if (thrInfo.maxRestoreIpIdx > 0)
{
--thrInfo.maxRestoreIpIdx;
state.stackWillBeChanged = false;
}
);
+ if (needPrintWarning)
+ LOG().Warn() << "More callstack pop requests, than data was pushed.";
}
UINT_PTR ExecutionTrace::FunctionIDMap(