fix: Fix debugger module load before eventsToAck updated

This fixes an uncommon race condition in processing vmBinds in debugger
where occasionally a VMBind may go unacked.

Related-to: NEO-12866

Signed-off-by: Brandon Yates <brandon.yates@intel.com>
This commit is contained in:
Brandon Yates
2024-10-02 20:40:05 +00:00
committed by Compute-Runtime-Automation
parent 43cf7abf65
commit be295ef9a0
4 changed files with 20 additions and 2 deletions

View File

@@ -484,7 +484,6 @@ void DebugSessionLinuxXe::handleVmBind(VmBindData &vmBindData) {
debugEvent.info.module.moduleEnd = reinterpret_cast<uint64_t>(elfMetadata.data.get()) + elfMetadata.metadata.len;
debugEvent.flags = ZET_DEBUG_EVENT_FLAG_NEED_ACK;
pushApiEvent(debugEvent, metaDataEntry.metadata.metadata_handle);
{
std::lock_guard<std::mutex> lock(asyncThreadMutex);
if (vmBindData.vmBind.flags & DRM_XE_EUDEBUG_EVENT_VM_BIND_FLAG_UFENCE) {
@@ -495,6 +494,7 @@ void DebugSessionLinuxXe::handleVmBind(VmBindData &vmBindData) {
}
}
}
pushApiEvent(debugEvent, metaDataEntry.metadata.metadata_handle);
}
if (shouldAckEvent && (vmBindData.vmBindUfence.base.flags & DRM_XE_EUDEBUG_EVENT_NEED_ACK)) {