mirror of
https://github.com/intel/compute-runtime.git
synced 2025-12-29 09:03:14 +08:00
feature: Implement Process entry/exit event with xe
Related-To: NEO-9671 Signed-off-by: Jitendra Sharma <jitendra.sharma@intel.com>
This commit is contained in:
committed by
Compute-Runtime-Automation
parent
ab1ffea592
commit
adef8fbc8d
@@ -231,6 +231,14 @@ void DebugSessionLinuxXe::handleEvent(drm_xe_eudebug_event *event) {
|
||||
|
||||
if (event->flags & DRM_XE_EUDEBUG_EVENT_CREATE) {
|
||||
UNRECOVERABLE_IF(clientHandleToConnection.find(execQueue->client_handle) == clientHandleToConnection.end());
|
||||
|
||||
if (!processEntryEventGenerated) {
|
||||
zet_debug_event_t debugEvent = {};
|
||||
debugEvent.type = ZET_DEBUG_EVENT_TYPE_PROCESS_ENTRY;
|
||||
pushApiEvent(debugEvent);
|
||||
processEntryEventGenerated = true;
|
||||
}
|
||||
|
||||
clientHandleToConnection[execQueue->client_handle]->execQueues[execQueue->exec_queue_handle].vmHandle = execQueue->vm_handle;
|
||||
clientHandleToConnection[execQueue->client_handle]->execQueues[execQueue->exec_queue_handle].engineClass = execQueue->engine_class;
|
||||
for (uint16_t idx = 0; idx < execQueue->width; idx++) {
|
||||
@@ -243,6 +251,21 @@ void DebugSessionLinuxXe::handleEvent(drm_xe_eudebug_event *event) {
|
||||
clientHandleToConnection[execQueue->client_handle]->lrcHandleToVmHandle.erase(execQueue->lrc_handle[idx]);
|
||||
}
|
||||
clientHandleToConnection[execQueue->client_handle]->execQueues.erase(execQueue->exec_queue_handle);
|
||||
{
|
||||
bool lastExecQueue = true;
|
||||
for (const auto &connection : clientHandleToConnection) {
|
||||
if (!connection.second->execQueues.empty()) {
|
||||
lastExecQueue = false;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (lastExecQueue) {
|
||||
zet_debug_event_t debugEvent = {};
|
||||
debugEvent.type = ZET_DEBUG_EVENT_TYPE_PROCESS_EXIT;
|
||||
pushApiEvent(debugEvent);
|
||||
processEntryEventGenerated = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
PRINT_DEBUGGER_INFO_LOG("DRM_XE_EUDEBUG_IOCTL_READ_EVENT type: DRM_XE_EUDEBUG_EVENT_EXEC_QUEUE flags = %u len = %lu client_handle = %llu\
|
||||
|
||||
@@ -164,6 +164,7 @@ struct DebugSessionLinuxXe : DebugSessionLinux {
|
||||
|
||||
ze_result_t readEventImp(drm_xe_eudebug_event *drmDebugEvent);
|
||||
int ioctl(unsigned long request, void *arg);
|
||||
std::atomic<bool> processEntryEventGenerated = false;
|
||||
};
|
||||
|
||||
} // namespace L0
|
||||
|
||||
Reference in New Issue
Block a user