diff --git a/level_zero/tools/source/debug/linux/prelim/debug_session.cpp b/level_zero/tools/source/debug/linux/prelim/debug_session.cpp index b930fa1c4f..d5cbe7af70 100644 --- a/level_zero/tools/source/debug/linux/prelim/debug_session.cpp +++ b/level_zero/tools/source/debug/linux/prelim/debug_session.cpp @@ -37,7 +37,7 @@ namespace L0 { DebugSession *createDebugSessionHelper(const zet_debug_config_t &config, Device *device, int debugFd, void *params); -DebugSessionLinux::DebugSessionLinux(const zet_debug_config_t &config, Device *device, int debugFd, void *params) : DebugSessionImp(config, device), fd(debugFd) { +DebugSessionLinuxi915::DebugSessionLinuxi915(const zet_debug_config_t &config, Device *device, int debugFd, void *params) : DebugSessionImp(config, device), fd(debugFd) { ioctlHandler.reset(new IoctlHandler); if (params) { @@ -52,7 +52,7 @@ DebugSessionLinux::DebugSessionLinux(const zet_debug_config_t &config, Device *d euControlInterruptSeqno[i] = invalidHandle; } }; -DebugSessionLinux::~DebugSessionLinux() { +DebugSessionLinuxi915::~DebugSessionLinuxi915() { closeAsyncThread(); closeInternalEventsThread(); for (auto &session : tileSessions) { @@ -90,7 +90,7 @@ DebugSession *DebugSession::create(const zet_debug_config_t &config, Device *dev auto reason = DrmHelper::getErrno(device); PRINT_DEBUGGER_ERROR_LOG("PRELIM_DRM_IOCTL_I915_DEBUGGER_OPEN failed: open.pid: %d, open.events: %d, retCode: %d, errno: %d\n", open.pid, open.events, debugFd, reason); - result = DebugSessionLinux::translateDebuggerOpenErrno(reason); + result = DebugSessionLinuxi915::translateDebuggerOpenErrno(reason); } } else { result = ZE_RESULT_ERROR_UNSUPPORTED_FEATURE; @@ -98,7 +98,7 @@ DebugSession *DebugSession::create(const zet_debug_config_t &config, Device *dev return nullptr; } -ze_result_t DebugSessionLinux::translateDebuggerOpenErrno(int error) { +ze_result_t DebugSessionLinuxi915::translateDebuggerOpenErrno(int error) { ze_result_t result = ZE_RESULT_ERROR_UNKNOWN; switch (error) { @@ -115,11 +115,11 @@ ze_result_t DebugSessionLinux::translateDebuggerOpenErrno(int error) { return result; } -int DebugSessionLinux::ioctl(unsigned long request, void *arg) { +int DebugSessionLinuxi915::ioctl(unsigned long request, void *arg) { return ioctlHandler->ioctl(fd, request, arg); } -ze_result_t DebugSessionLinux::readGpuMemory(uint64_t vmHandle, char *output, size_t size, uint64_t gpuVa) { +ze_result_t DebugSessionLinuxi915::readGpuMemory(uint64_t vmHandle, char *output, size_t size, uint64_t gpuVa) { prelim_drm_i915_debug_vm_open vmOpen = { .client_handle = static_cast(clientHandle), .handle = static_cast(vmHandle), @@ -182,7 +182,7 @@ ze_result_t DebugSessionLinux::readGpuMemory(uint64_t vmHandle, char *output, si return (retVal == 0) ? ZE_RESULT_SUCCESS : ZE_RESULT_ERROR_UNKNOWN; } -ze_result_t DebugSessionLinux::writeGpuMemory(uint64_t vmHandle, const char *input, size_t size, uint64_t gpuVa) { +ze_result_t DebugSessionLinuxi915::writeGpuMemory(uint64_t vmHandle, const char *input, size_t size, uint64_t gpuVa) { prelim_drm_i915_debug_vm_open vmOpen = { .client_handle = static_cast(clientHandle), .handle = static_cast(vmHandle), @@ -245,7 +245,7 @@ ze_result_t DebugSessionLinux::writeGpuMemory(uint64_t vmHandle, const char *inp return (retVal == 0) ? ZE_RESULT_SUCCESS : ZE_RESULT_ERROR_UNKNOWN; } -ze_result_t DebugSessionLinux::initialize() { +ze_result_t DebugSessionLinuxi915::initialize() { struct pollfd pollFd = { .fd = this->fd, .events = POLLIN, @@ -305,7 +305,7 @@ ze_result_t DebugSessionLinux::initialize() { return ZE_RESULT_NOT_READY; } -void DebugSessionLinux::createTileSessionsIfEnabled() { +void DebugSessionLinuxi915::createTileSessionsIfEnabled() { auto numTiles = connectedDevice->getNEODevice()->getNumSubDevices(); if (numTiles > 0 && tileAttachEnabled) { tileSessions.resize(numTiles); @@ -318,14 +318,14 @@ void DebugSessionLinux::createTileSessionsIfEnabled() { } } -TileDebugSessionLinux *DebugSessionLinux::createTileSession(const zet_debug_config_t &config, Device *device, DebugSessionImp *rootDebugSession) { - auto tileSession = new TileDebugSessionLinux(config, device, rootDebugSession); +TileDebugSessionLinuxi915 *DebugSessionLinuxi915::createTileSession(const zet_debug_config_t &config, Device *device, DebugSessionImp *rootDebugSession) { + auto tileSession = new TileDebugSessionLinuxi915(config, device, rootDebugSession); tileSession->initialize(); return tileSession; } -void *DebugSessionLinux::asyncThreadFunction(void *arg) { - DebugSessionLinux *self = reinterpret_cast(arg); +void *DebugSessionLinuxi915::asyncThreadFunction(void *arg) { + DebugSessionLinuxi915 *self = reinterpret_cast(arg); PRINT_DEBUGGER_INFO_LOG("Debugger async thread start\n", ""); while (self->asyncThread.threadActive) { @@ -333,8 +333,8 @@ void *DebugSessionLinux::asyncThreadFunction(void *arg) { if (self->tileSessionsEnabled) { for (size_t tileIndex = 0; tileIndex < self->tileSessions.size(); tileIndex++) { - static_cast(self->tileSessions[tileIndex].first)->generateEventsAndResumeStoppedThreads(); - static_cast(self->tileSessions[tileIndex].first)->sendInterrupts(); + static_cast(self->tileSessions[tileIndex].first)->generateEventsAndResumeStoppedThreads(); + static_cast(self->tileSessions[tileIndex].first)->sendInterrupts(); } } else { self->generateEventsAndResumeStoppedThreads(); @@ -347,8 +347,8 @@ void *DebugSessionLinux::asyncThreadFunction(void *arg) { return nullptr; } -void *DebugSessionLinux::readInternalEventsThreadFunction(void *arg) { - DebugSessionLinux *self = reinterpret_cast(arg); +void *DebugSessionLinuxi915::readInternalEventsThreadFunction(void *arg) { + DebugSessionLinuxi915 *self = reinterpret_cast(arg); PRINT_DEBUGGER_INFO_LOG("Debugger internal event thread started\n", ""); self->internalThreadHasStarted = true; @@ -361,16 +361,16 @@ void *DebugSessionLinux::readInternalEventsThreadFunction(void *arg) { return nullptr; } -void DebugSessionLinux::startAsyncThread() { +void DebugSessionLinuxi915::startAsyncThread() { asyncThread.thread = NEO::Thread::create(asyncThreadFunction, reinterpret_cast(this)); } -void DebugSessionLinux::closeAsyncThread() { +void DebugSessionLinuxi915::closeAsyncThread() { asyncThread.close(); internalEventThread.close(); } -bool DebugSessionLinux::closeFd() { +bool DebugSessionLinuxi915::closeFd() { if (fd == 0) { return false; } @@ -385,7 +385,7 @@ bool DebugSessionLinux::closeFd() { return true; } -std::unique_ptr DebugSessionLinux::getInternalEvent() { +std::unique_ptr DebugSessionLinuxi915::getInternalEvent() { std::unique_ptr eventMemory; { @@ -403,7 +403,7 @@ std::unique_ptr DebugSessionLinux::getInternalEvent() { return eventMemory; } -void DebugSessionLinux::handleEventsAsync() { +void DebugSessionLinuxi915::handleEventsAsync() { auto eventMemory = getInternalEvent(); if (eventMemory != nullptr) { auto debugEvent = reinterpret_cast(eventMemory.get()); @@ -415,7 +415,7 @@ void DebugSessionLinux::handleEventsAsync() { } } -void DebugSessionLinux::readInternalEventsAsync() { +void DebugSessionLinuxi915::readInternalEventsAsync() { struct pollfd pollFd = { .fd = fd, @@ -438,8 +438,8 @@ void DebugSessionLinux::readInternalEventsAsync() { if (tileSessionsEnabled) { auto numTiles = connectedDevice->getNEODevice()->getNumSubDevices(); for (uint32_t tileIndex = 0; tileIndex < numTiles; tileIndex++) { - static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent); - static_cast(tileSessions[tileIndex].first)->detached = true; + static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent); + static_cast(tileSessions[tileIndex].first)->detached = true; } } else { pushApiEvent(debugEvent); @@ -474,7 +474,7 @@ void DebugSessionLinux::readInternalEventsAsync() { } } -bool DebugSessionLinux::closeConnection() { +bool DebugSessionLinuxi915::closeConnection() { closeAsyncThread(); closeInternalEventsThread(); @@ -492,7 +492,7 @@ bool DebugSessionLinux::closeConnection() { return closeFd(); } -void DebugSessionLinux::handleEvent(prelim_drm_i915_debug_event *event) { +void DebugSessionLinuxi915::handleEvent(prelim_drm_i915_debug_event *event) { auto type = event->type; PRINT_DEBUGGER_INFO_LOG("PRELIM_I915_DEBUG_IOCTL_READ_EVENT type = %lu flags = %d seqno = %llu size = %llu", @@ -560,7 +560,7 @@ void DebugSessionLinux::handleEvent(prelim_drm_i915_debug_event *event) { debugEvent.type = ZET_DEBUG_EVENT_TYPE_PROCESS_EXIT; if (tileSessionsEnabled) { - auto tileSession = reinterpret_cast(tileSessions[deviceIndex].first); + auto tileSession = reinterpret_cast(tileSessions[deviceIndex].first); tileSession->processExit(); tileSession->pushApiEvent(debugEvent); } else if (uuidL0CommandQueueHandleToDevice.size() == 0) { @@ -605,7 +605,7 @@ void DebugSessionLinux::handleEvent(prelim_drm_i915_debug_event *event) { if (tileSessionsEnabled) { UNRECOVERABLE_IF(uuidL0CommandQueueHandleToDevice.find(uuid->handle) != uuidL0CommandQueueHandleToDevice.end()); - auto tileSession = static_cast(tileSessions[deviceIndex].first); + auto tileSession = static_cast(tileSessions[deviceIndex].first); tileSession->processEntry(); tileSession->pushApiEvent(debugEvent); } else if (uuidL0CommandQueueHandleToDevice.size() == 0) { @@ -742,7 +742,7 @@ void DebugSessionLinux::handleEvent(prelim_drm_i915_debug_event *event) { } } -void DebugSessionLinux::processPendingVmBindEvents() { +void DebugSessionLinuxi915::processPendingVmBindEvents() { size_t processedEvents = 0; for (size_t index = 0; index < pendingVmBindEvents.size(); index++) { auto debugEvent = reinterpret_cast(pendingVmBindEvents[index].get()); @@ -756,7 +756,7 @@ void DebugSessionLinux::processPendingVmBindEvents() { } } -bool DebugSessionLinux::checkAllEventsCollected() { +bool DebugSessionLinuxi915::checkAllEventsCollected() { bool allEventsCollected = false; bool clientConnected = (this->clientHandle != invalidClientHandle); if (clientConnected) { @@ -768,7 +768,7 @@ bool DebugSessionLinux::checkAllEventsCollected() { return allEventsCollected; } -bool DebugSessionLinux::readModuleDebugArea() { +bool DebugSessionLinuxi915::readModuleDebugArea() { auto vm = clientHandleToConnection[clientHandle]->vmToModuleDebugAreaBindInfo.begin()->first; auto gpuVa = clientHandleToConnection[clientHandle]->vmToModuleDebugAreaBindInfo.begin()->second.gpuVa; @@ -783,7 +783,7 @@ bool DebugSessionLinux::readModuleDebugArea() { return true; } -void DebugSessionLinux::readStateSaveAreaHeader() { +void DebugSessionLinuxi915::readStateSaveAreaHeader() { if (clientHandle == invalidClientHandle) { return; } @@ -813,7 +813,7 @@ void DebugSessionLinux::readStateSaveAreaHeader() { } } -ze_result_t DebugSessionLinux::readEventImp(prelim_drm_i915_debug_event *drmDebugEvent) { +ze_result_t DebugSessionLinuxi915::readEventImp(prelim_drm_i915_debug_event *drmDebugEvent) { auto ret = ioctl(PRELIM_I915_DEBUG_IOCTL_READ_EVENT, drmDebugEvent); if (ret != 0) { PRINT_DEBUGGER_ERROR_LOG("PRELIM_I915_DEBUG_IOCTL_READ_EVENT failed: retCode: %d errno = %d\n", ret, errno); @@ -825,7 +825,7 @@ ze_result_t DebugSessionLinux::readEventImp(prelim_drm_i915_debug_event *drmDebu return ZE_RESULT_SUCCESS; } -bool DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *vmBind) { +bool DebugSessionLinuxi915::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *vmBind) { PRINT_DEBUGGER_INFO_LOG("PRELIM_I915_DEBUG_IOCTL_READ_EVENT type: PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND flags = %d size = %llu client_handle = %llu vm_handle = %llu va_start = %p va_lenght = %llu num_uuids = %lu\n", (int)vmBind->base.flags, (uint64_t)vmBind->base.size, (uint64_t)vmBind->client_handle, (uint64_t)vmBind->vm_handle, (void *)vmBind->va_start, (uint64_t)vmBind->va_length, (uint32_t)vmBind->num_uuids); @@ -982,9 +982,9 @@ bool DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *v debugEvent.flags = apiEventNeedsAck ? ZET_DEBUG_EVENT_FLAG_NEED_ACK : 0; if (tileSessionsEnabled) { - auto tileAttached = static_cast(tileSessions[tileIndex].first)->insertModule(debugEvent.info.module); + auto tileAttached = static_cast(tileSessions[tileIndex].first)->insertModule(debugEvent.info.module); if (tileAttached) { - static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent); + static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent); } } else { @@ -1034,8 +1034,8 @@ bool DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *v if (perKernelModules) { if (tileSessionsEnabled) { - static_cast(tileSessions[tileIndex].first)->removeModule(debugEvent.info.module); - static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent); + static_cast(tileSessions[tileIndex].first)->removeModule(debugEvent.info.module); + static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent); } else { bool notifyEvent = true; if (isa->deviceBitfield.count() > 1) { @@ -1095,14 +1095,14 @@ bool DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *v shouldAckEvent = false; } } else { - auto tileAttached = static_cast(tileSessions[tileIndex].first)->insertModule(debugEvent.info.module); + auto tileAttached = static_cast(tileSessions[tileIndex].first)->insertModule(debugEvent.info.module); if (tileAttached) { if (vmBind->base.flags & PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK) { debugEvent.flags = ZET_DEBUG_EVENT_FLAG_NEED_ACK; module.ackEvents[tileIndex].push_back(vmBind->base); } - static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent, vmBind->uuids[uuidIter]); + static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent, vmBind->uuids[uuidIter]); shouldAckEvent = false; } } @@ -1135,9 +1135,9 @@ bool DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *v shouldAckEvent = false; } } else { - auto tileAttached = static_cast(tileSessions[tileIndex].first)->insertModule(debugEvent.info.module); + auto tileAttached = static_cast(tileSessions[tileIndex].first)->insertModule(debugEvent.info.module); if (tileAttached) { - static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent, vmBind->uuids[uuidIter]); + static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent, vmBind->uuids[uuidIter]); shouldAckEvent = false; } } @@ -1148,7 +1148,7 @@ bool DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *v shouldAckEvent = false; } - if (tileSessionsEnabled && !static_cast(tileSessions[tileIndex].first)->isAttached) { + if (tileSessionsEnabled && !static_cast(tileSessions[tileIndex].first)->isAttached) { shouldAckEvent = true; } if (!shouldAckEvent && (vmBind->base.flags & PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK)) { @@ -1175,10 +1175,10 @@ bool DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *v if (tileSessionsEnabled) { - auto tileAttached = static_cast(tileSessions[tileIndex].first)->removeModule(debugEvent.info.module); + auto tileAttached = static_cast(tileSessions[tileIndex].first)->removeModule(debugEvent.info.module); if (tileAttached) { - static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent, vmBind->uuids[uuidIter]); + static_cast(tileSessions[tileIndex].first)->pushApiEvent(debugEvent, vmBind->uuids[uuidIter]); } } else { @@ -1212,7 +1212,7 @@ bool DebugSessionLinux::handleVmBindEvent(prelim_drm_i915_debug_event_vm_bind *v return true; } -void DebugSessionLinux::handleContextParamEvent(prelim_drm_i915_debug_event_context_param *contextParam) { +void DebugSessionLinuxi915::handleContextParamEvent(prelim_drm_i915_debug_event_context_param *contextParam) { PRINT_DEBUGGER_INFO_LOG("PRELIM_I915_DEBUG_IOCTL_READ_EVENT type: PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM flags = %d size = %llu client_handle = %llu ctx_handle = %llu\n", (int)contextParam->base.flags, (uint64_t)contextParam->base.size, (uint64_t)contextParam->client_handle, (uint64_t)contextParam->ctx_handle); @@ -1260,7 +1260,7 @@ void DebugSessionLinux::handleContextParamEvent(prelim_drm_i915_debug_event_cont } } -uint64_t DebugSessionLinux::getVmHandleFromClientAndlrcHandle(uint64_t clientHandle, uint64_t lrcHandle) { +uint64_t DebugSessionLinuxi915::getVmHandleFromClientAndlrcHandle(uint64_t clientHandle, uint64_t lrcHandle) { if (clientHandleToConnection.find(clientHandle) == clientHandleToConnection.end()) { return invalidHandle; @@ -1279,7 +1279,7 @@ uint64_t DebugSessionLinux::getVmHandleFromClientAndlrcHandle(uint64_t clientHan return clientConnection->contextsCreated[contextHandle].vm; } -void DebugSessionLinux::handleAttentionEvent(prelim_drm_i915_debug_event_eu_attention *attention) { +void DebugSessionLinuxi915::handleAttentionEvent(prelim_drm_i915_debug_event_eu_attention *attention) { NEO::EngineClassInstance engineClassInstance = {attention->ci.engine_class, attention->ci.engine_instance}; auto tileIndex = DrmHelper::getEngineTileIndex(connectedDevice, engineClassInstance); if (interruptSent && attention->base.seqno <= euControlInterruptSeqno[tileIndex]) { @@ -1329,7 +1329,7 @@ void DebugSessionLinux::handleAttentionEvent(prelim_drm_i915_debug_event_eu_atte std::unique_lock lock; if (tileSessionsEnabled) { - lock = std::unique_lock(static_cast(tileSessions[tileIndex].first)->threadStateMutex); + lock = std::unique_lock(static_cast(tileSessions[tileIndex].first)->threadStateMutex); } else { lock = std::unique_lock(threadStateMutex); } @@ -1353,7 +1353,7 @@ void DebugSessionLinux::handleAttentionEvent(prelim_drm_i915_debug_event_eu_atte PRINT_DEBUGGER_THREAD_LOG("ATTENTION event for thread: %s\n", EuThread::toString(threadId).c_str()); if (tileSessionsEnabled) { - static_cast(tileSessions[tileIndex].first)->addThreadToNewlyStoppedFromRaisedAttention(threadId, vmHandle, stateSaveAreaMemory.data()); + static_cast(tileSessions[tileIndex].first)->addThreadToNewlyStoppedFromRaisedAttention(threadId, vmHandle, stateSaveAreaMemory.data()); } else { addThreadToNewlyStoppedFromRaisedAttention(threadId, vmHandle, stateSaveAreaMemory.data()); } @@ -1362,13 +1362,13 @@ void DebugSessionLinux::handleAttentionEvent(prelim_drm_i915_debug_event_eu_atte } if (tileSessionsEnabled) { - static_cast(tileSessions[tileIndex].first)->checkTriggerEventsForAttention(); + static_cast(tileSessions[tileIndex].first)->checkTriggerEventsForAttention(); } else { checkTriggerEventsForAttention(); } } -void DebugSessionLinux::handlePageFaultEvent(prelim_drm_i915_debug_event_page_fault *pf) { +void DebugSessionLinuxi915::handlePageFaultEvent(prelim_drm_i915_debug_event_page_fault *pf) { NEO::EngineClassInstance engineClassInstance = {pf->ci.engine_class, pf->ci.engine_instance}; auto tileIndex = DrmHelper::getEngineTileIndex(connectedDevice, engineClassInstance); @@ -1415,7 +1415,7 @@ void DebugSessionLinux::handlePageFaultEvent(prelim_drm_i915_debug_event_page_fa std::unique_lock lock; if (tileSessionsEnabled) { - lock = std::unique_lock(static_cast(tileSessions[tileIndex].first)->threadStateMutex); + lock = std::unique_lock(static_cast(tileSessions[tileIndex].first)->threadStateMutex); } else { lock = std::unique_lock(threadStateMutex); } @@ -1426,7 +1426,7 @@ void DebugSessionLinux::handlePageFaultEvent(prelim_drm_i915_debug_event_page_fa } for (auto &threadId : stoppedThreads) { if (tileSessionsEnabled) { - static_cast(tileSessions[tileIndex].first)->addThreadToNewlyStoppedFromRaisedAttention(threadId, vmHandle, stateSaveAreaMemory.data()); + static_cast(tileSessions[tileIndex].first)->addThreadToNewlyStoppedFromRaisedAttention(threadId, vmHandle, stateSaveAreaMemory.data()); } else { addThreadToNewlyStoppedFromRaisedAttention(threadId, vmHandle, stateSaveAreaMemory.data()); } @@ -1434,14 +1434,14 @@ void DebugSessionLinux::handlePageFaultEvent(prelim_drm_i915_debug_event_page_fa } if (tileSessionsEnabled) { - static_cast(tileSessions[tileIndex].first)->checkTriggerEventsForAttention(); + static_cast(tileSessions[tileIndex].first)->checkTriggerEventsForAttention(); } else { checkTriggerEventsForAttention(); } return; } -void DebugSessionLinux::handleEnginesEvent(prelim_drm_i915_debug_event_engines *engines) { +void DebugSessionLinuxi915::handleEnginesEvent(prelim_drm_i915_debug_event_engines *engines) { PRINT_DEBUGGER_INFO_LOG("ENGINES event: client_handle = %llu, ctx_handle = %llu, num_engines = %llu %s\n", (uint64_t)engines->client_handle, (uint64_t)engines->ctx_handle, @@ -1470,7 +1470,7 @@ void DebugSessionLinux::handleEnginesEvent(prelim_drm_i915_debug_event_engines * } } -void DebugSessionLinux::extractUuidData(uint64_t client, const UuidData &uuidData) { +void DebugSessionLinuxi915::extractUuidData(uint64_t client, const UuidData &uuidData) { if (uuidData.classIndex == NEO::DrmResourceClass::SbaTrackingBuffer || uuidData.classIndex == NEO::DrmResourceClass::ModuleHeapDebugArea || uuidData.classIndex == NEO::DrmResourceClass::ContextSaveArea) { @@ -1499,7 +1499,7 @@ void DebugSessionLinux::extractUuidData(uint64_t client, const UuidData &uuidDat } } -uint64_t DebugSessionLinux::extractVaFromUuidString(std::string &uuid) { +uint64_t DebugSessionLinuxi915::extractVaFromUuidString(std::string &uuid) { const char uuidString[] = "%04" SCNx64 "-%012" SCNx64; auto subString = uuid.substr(19); @@ -1510,7 +1510,7 @@ uint64_t DebugSessionLinux::extractVaFromUuidString(std::string &uuid) { return parts[0]; } -int DebugSessionLinux::threadControl(const std::vector &threads, uint32_t tile, ThreadControlCmd threadCmd, std::unique_ptr &bitmaskOut, size_t &bitmaskSizeOut) { +int DebugSessionLinuxi915::threadControl(const std::vector &threads, uint32_t tile, ThreadControlCmd threadCmd, std::unique_ptr &bitmaskOut, size_t &bitmaskSizeOut) { auto hwInfo = connectedDevice->getHwInfo(); auto classInstance = DrmHelper::getEngineInstance(connectedDevice, tile, hwInfo.capabilityTable.defaultEngineType); @@ -1584,7 +1584,7 @@ int DebugSessionLinux::threadControl(const std::vector &thre return euControlRetVal; } -void DebugSessionLinux::checkStoppedThreadsAndGenerateEvents(const std::vector &threads, uint64_t memoryHandle, uint32_t deviceIndex) { +void DebugSessionLinuxi915::checkStoppedThreadsAndGenerateEvents(const std::vector &threads, uint64_t memoryHandle, uint32_t deviceIndex) { std::vector threadsWithAttention; std::vector stoppedThreadsToReport; @@ -1635,7 +1635,7 @@ void DebugSessionLinux::checkStoppedThreadsAndGenerateEvents(const std::vector &threads, uint32_t deviceIndex) { +ze_result_t DebugSessionLinuxi915::resumeImp(const std::vector &threads, uint32_t deviceIndex) { std::unique_ptr bitmask; size_t bitmaskSize; @@ -1644,7 +1644,7 @@ ze_result_t DebugSessionLinux::resumeImp(const std::vector & return result == 0 ? ZE_RESULT_SUCCESS : ZE_RESULT_ERROR_NOT_AVAILABLE; } -ze_result_t DebugSessionLinux::interruptImp(uint32_t deviceIndex) { +ze_result_t DebugSessionLinuxi915::interruptImp(uint32_t deviceIndex) { std::unique_ptr bitmask; size_t bitmaskSize; @@ -1653,7 +1653,7 @@ ze_result_t DebugSessionLinux::interruptImp(uint32_t deviceIndex) { return result == 0 ? ZE_RESULT_SUCCESS : ZE_RESULT_ERROR_NOT_AVAILABLE; } -ze_result_t DebugSessionLinux::getISAVMHandle(uint32_t deviceIndex, const zet_debug_memory_space_desc_t *desc, size_t size, uint64_t &vmHandle) { +ze_result_t DebugSessionLinuxi915::getISAVMHandle(uint32_t deviceIndex, const zet_debug_memory_space_desc_t *desc, size_t size, uint64_t &vmHandle) { auto gmmHelper = connectedDevice->getNEODevice()->getGmmHelper(); auto accessVA = gmmHelper->decanonize(desc->address); auto &isaMap = clientHandleToConnection[clientHandle]->isaMap[deviceIndex]; @@ -1681,7 +1681,7 @@ ze_result_t DebugSessionLinux::getISAVMHandle(uint32_t deviceIndex, const zet_de return status; } -bool DebugSessionLinux::getIsaInfoForAllInstances(NEO::DeviceBitfield deviceBitfield, const zet_debug_memory_space_desc_t *desc, size_t size, uint64_t vmHandles[], ze_result_t &status) { +bool DebugSessionLinuxi915::getIsaInfoForAllInstances(NEO::DeviceBitfield deviceBitfield, const zet_debug_memory_space_desc_t *desc, size_t size, uint64_t vmHandles[], ze_result_t &status) { auto gmmHelper = connectedDevice->getNEODevice()->getGmmHelper(); auto accessVA = gmmHelper->decanonize(desc->address); @@ -1730,7 +1730,7 @@ bool DebugSessionLinux::getIsaInfoForAllInstances(NEO::DeviceBitfield deviceBitf return isaFound > 0; } -void DebugSessionLinux::printContextVms() { +void DebugSessionLinuxi915::printContextVms() { if (NEO::DebugManager.flags.DebuggerLogBitmask.get() & NEO::DebugVariables::DEBUGGER_LOG_BITMASK::LOG_INFO) { PRINT_DEBUGGER_LOG(stdout, "\nINFO: Context - VM map: ", ""); for (size_t i = 0; i < clientHandleToConnection[clientHandle]->contextsCreated.size(); i++) { @@ -1740,7 +1740,7 @@ void DebugSessionLinux::printContextVms() { } } -bool DebugSessionLinux::tryReadElf(const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer, ze_result_t &status) { +bool DebugSessionLinuxi915::tryReadElf(const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer, ze_result_t &status) { const char *elfData = nullptr; uint64_t offset = 0; @@ -1758,7 +1758,7 @@ bool DebugSessionLinux::tryReadElf(const zet_debug_memory_space_desc_t *desc, si return false; } -ze_result_t DebugSessionLinux::getElfOffset(const zet_debug_memory_space_desc_t *desc, size_t size, const char *&elfData, uint64_t &offset) { +ze_result_t DebugSessionLinuxi915::getElfOffset(const zet_debug_memory_space_desc_t *desc, size_t size, const char *&elfData, uint64_t &offset) { auto &elfMap = clientHandleToConnection[clientHandle]->elfMap; auto accessVA = desc->address; ze_result_t status = ZE_RESULT_ERROR_UNINITIALIZED; @@ -1787,8 +1787,8 @@ ze_result_t DebugSessionLinux::getElfOffset(const zet_debug_memory_space_desc_t return status; } -ze_result_t DebugSessionLinux::readElfSpace(const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer, - const char *&elfData, const uint64_t offset) { +ze_result_t DebugSessionLinuxi915::readElfSpace(const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer, + const char *&elfData, const uint64_t offset) { int retVal = -1; elfData += offset; @@ -1796,7 +1796,7 @@ ze_result_t DebugSessionLinux::readElfSpace(const zet_debug_memory_space_desc_t return (retVal == 0) ? ZE_RESULT_SUCCESS : ZE_RESULT_ERROR_UNKNOWN; } -ze_result_t DebugSessionLinux::readMemory(ze_device_thread_t thread, const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer) { +ze_result_t DebugSessionLinuxi915::readMemory(ze_device_thread_t thread, const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer) { ze_result_t status = validateThreadAndDescForMemoryAccess(thread, desc); if (status != ZE_RESULT_SUCCESS) { return status; @@ -1812,7 +1812,7 @@ ze_result_t DebugSessionLinux::readMemory(ze_device_thread_t thread, const zet_d return status; } -ze_result_t DebugSessionLinux::readDefaultMemory(ze_device_thread_t thread, const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer) { +ze_result_t DebugSessionLinuxi915::readDefaultMemory(ze_device_thread_t thread, const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer) { ze_result_t status = ZE_RESULT_SUCCESS; bool isa = tryReadIsa(connectedDevice->getNEODevice()->getDeviceBitfield(), desc, size, buffer, status); @@ -1838,7 +1838,7 @@ ze_result_t DebugSessionLinux::readDefaultMemory(ze_device_thread_t thread, cons return readGpuMemory(vmHandle, static_cast(buffer), size, desc->address); } -ze_result_t DebugSessionLinux::writeMemory(ze_device_thread_t thread, const zet_debug_memory_space_desc_t *desc, size_t size, const void *buffer) { +ze_result_t DebugSessionLinuxi915::writeMemory(ze_device_thread_t thread, const zet_debug_memory_space_desc_t *desc, size_t size, const void *buffer) { ze_result_t status = validateThreadAndDescForMemoryAccess(thread, desc); if (status != ZE_RESULT_SUCCESS) { return status; @@ -1854,7 +1854,7 @@ ze_result_t DebugSessionLinux::writeMemory(ze_device_thread_t thread, const zet_ return status; } -ze_result_t DebugSessionLinux::writeDefaultMemory(ze_device_thread_t thread, const zet_debug_memory_space_desc_t *desc, size_t size, const void *buffer) { +ze_result_t DebugSessionLinuxi915::writeDefaultMemory(ze_device_thread_t thread, const zet_debug_memory_space_desc_t *desc, size_t size, const void *buffer) { ze_result_t status = ZE_RESULT_SUCCESS; auto deviceBitfield = connectedDevice->getNEODevice()->getDeviceBitfield(); @@ -1877,15 +1877,15 @@ ze_result_t DebugSessionLinux::writeDefaultMemory(ze_device_thread_t thread, con return writeGpuMemory(threadVmHandle, static_cast(buffer), size, desc->address); } -bool DebugSessionLinux::tryWriteIsa(NEO::DeviceBitfield deviceBitfield, const zet_debug_memory_space_desc_t *desc, size_t size, const void *buffer, ze_result_t &status) { +bool DebugSessionLinuxi915::tryWriteIsa(NEO::DeviceBitfield deviceBitfield, const zet_debug_memory_space_desc_t *desc, size_t size, const void *buffer, ze_result_t &status) { return tryAccessIsa(deviceBitfield, desc, size, const_cast(buffer), true, status); } -bool DebugSessionLinux::tryReadIsa(NEO::DeviceBitfield deviceBitfield, const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer, ze_result_t &status) { +bool DebugSessionLinuxi915::tryReadIsa(NEO::DeviceBitfield deviceBitfield, const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer, ze_result_t &status) { return tryAccessIsa(deviceBitfield, desc, size, buffer, false, status); } -bool DebugSessionLinux::tryAccessIsa(NEO::DeviceBitfield deviceBitfield, const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer, bool write, ze_result_t &status) { +bool DebugSessionLinuxi915::tryAccessIsa(NEO::DeviceBitfield deviceBitfield, const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer, bool write, ze_result_t &status) { status = ZE_RESULT_ERROR_NOT_AVAILABLE; uint64_t vmHandle[NEO::EngineLimits::maxHandleCount] = {invalidHandle}; uint32_t deviceIndex = Math::getMinLsbSet(static_cast(deviceBitfield.to_ulong())); @@ -1961,7 +1961,7 @@ bool DebugSessionLinux::tryAccessIsa(NEO::DeviceBitfield deviceBitfield, const z return isaAccess; } -ze_result_t DebugSessionLinux::accessDefaultMemForThreadAll(const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer, bool write) { +ze_result_t DebugSessionLinuxi915::accessDefaultMemForThreadAll(const zet_debug_memory_space_desc_t *desc, size_t size, void *buffer, bool write) { auto status = ZE_RESULT_ERROR_UNINITIALIZED; std::vector allVms; @@ -1984,7 +1984,7 @@ ze_result_t DebugSessionLinux::accessDefaultMemForThreadAll(const zet_debug_memo return status; } -bool DebugSessionLinux::ackIsaEvents(uint32_t deviceIndex, uint64_t isaVa) { +bool DebugSessionLinuxi915::ackIsaEvents(uint32_t deviceIndex, uint64_t isaVa) { std::lock_guard lock(asyncThreadMutex); auto connection = clientHandleToConnection[clientHandle].get(); @@ -2015,7 +2015,7 @@ bool DebugSessionLinux::ackIsaEvents(uint32_t deviceIndex, uint64_t isaVa) { return false; } -bool DebugSessionLinux::ackModuleEvents(uint32_t deviceIndex, uint64_t moduleUuidHandle) { +bool DebugSessionLinuxi915::ackModuleEvents(uint32_t deviceIndex, uint64_t moduleUuidHandle) { std::lock_guard lock(asyncThreadMutex); auto connection = clientHandleToConnection[clientHandle].get(); @@ -2041,7 +2041,7 @@ bool DebugSessionLinux::ackModuleEvents(uint32_t deviceIndex, uint64_t moduleUui return false; } -void DebugSessionLinux::cleanRootSessionAfterDetach(uint32_t deviceIndex) { +void DebugSessionLinuxi915::cleanRootSessionAfterDetach(uint32_t deviceIndex) { auto connection = clientHandleToConnection[clientHandle].get(); for (const auto &isa : connection->isaMap[deviceIndex]) { @@ -2064,7 +2064,7 @@ void DebugSessionLinux::cleanRootSessionAfterDetach(uint32_t deviceIndex) { } } -ze_result_t DebugSessionLinux::acknowledgeEvent(const zet_debug_event_t *event) { +ze_result_t DebugSessionLinuxi915::acknowledgeEvent(const zet_debug_event_t *event) { const zet_debug_event_t apiEventToAck = *event; { @@ -2107,7 +2107,7 @@ ze_result_t DebugSessionLinux::acknowledgeEvent(const zet_debug_event_t *event) return ZE_RESULT_ERROR_UNINITIALIZED; } -ze_result_t DebugSessionLinux::readSbaBuffer(EuThread::ThreadId threadId, NEO::SbaTrackedAddresses &sbaBuffer) { +ze_result_t DebugSessionLinuxi915::readSbaBuffer(EuThread::ThreadId threadId, NEO::SbaTrackedAddresses &sbaBuffer) { auto vmHandle = allThreads[threadId]->getMemoryHandle(); if (vmHandle == invalidHandle) { @@ -2122,7 +2122,7 @@ ze_result_t DebugSessionLinux::readSbaBuffer(EuThread::ThreadId threadId, NEO::S return readGpuMemory(vmHandle, reinterpret_cast(&sbaBuffer), sizeof(sbaBuffer), gpuVa); } -uint64_t DebugSessionLinux::getSbaBufferGpuVa(uint64_t memoryHandle) { +uint64_t DebugSessionLinuxi915::getSbaBufferGpuVa(uint64_t memoryHandle) { std::lock_guard lock(asyncThreadMutex); auto bindInfo = clientHandleToConnection[clientHandle]->vmToStateBaseAreaBindInfo.find(memoryHandle); if (bindInfo == clientHandleToConnection[clientHandle]->vmToStateBaseAreaBindInfo.end()) { @@ -2132,7 +2132,7 @@ uint64_t DebugSessionLinux::getSbaBufferGpuVa(uint64_t memoryHandle) { return bindInfo->second.gpuVa; } -uint64_t DebugSessionLinux::getContextStateSaveAreaGpuVa(uint64_t memoryHandle) { +uint64_t DebugSessionLinuxi915::getContextStateSaveAreaGpuVa(uint64_t memoryHandle) { std::lock_guard lock(asyncThreadMutex); auto bindInfo = clientHandleToConnection[clientHandle]->vmToContextStateSaveAreaBindInfo.find(memoryHandle); if (bindInfo == clientHandleToConnection[clientHandle]->vmToContextStateSaveAreaBindInfo.end()) { @@ -2142,7 +2142,7 @@ uint64_t DebugSessionLinux::getContextStateSaveAreaGpuVa(uint64_t memoryHandle) return bindInfo->second.gpuVa; } -size_t DebugSessionLinux::getContextStateSaveAreaSize(uint64_t memoryHandle) { +size_t DebugSessionLinuxi915::getContextStateSaveAreaSize(uint64_t memoryHandle) { std::lock_guard lock(asyncThreadMutex); if (clientHandleToConnection[clientHandle]->contextStateSaveAreaSize != 0) { return clientHandleToConnection[clientHandle]->contextStateSaveAreaSize; @@ -2156,7 +2156,7 @@ size_t DebugSessionLinux::getContextStateSaveAreaSize(uint64_t memoryHandle) { return clientHandleToConnection[clientHandle]->contextStateSaveAreaSize; } -void TileDebugSessionLinux::readStateSaveAreaHeader() { +void TileDebugSessionLinuxi915::readStateSaveAreaHeader() { const auto header = rootDebugSession->getStateSaveAreaHeader(); if (header) { @@ -2166,31 +2166,31 @@ void TileDebugSessionLinux::readStateSaveAreaHeader() { } }; -bool TileDebugSessionLinux::insertModule(zet_debug_event_info_module_t module) { +bool TileDebugSessionLinuxi915::insertModule(zet_debug_event_info_module_t module) { std::lock_guard lock(asyncThreadMutex); modules.insert({module.load, module}); return isAttached; } -bool TileDebugSessionLinux::removeModule(zet_debug_event_info_module_t module) { +bool TileDebugSessionLinuxi915::removeModule(zet_debug_event_info_module_t module) { std::lock_guard lock(asyncThreadMutex); modules.erase(module.load); return isAttached; } -bool TileDebugSessionLinux::processEntry() { +bool TileDebugSessionLinuxi915::processEntry() { std::lock_guard lock(asyncThreadMutex); processEntryState = true; return isAttached; } -bool TileDebugSessionLinux::processExit() { +bool TileDebugSessionLinuxi915::processExit() { std::lock_guard lock(asyncThreadMutex); processEntryState = false; return isAttached; } -void TileDebugSessionLinux::attachTile() { +void TileDebugSessionLinuxi915::attachTile() { std::lock_guard lock(asyncThreadMutex); // clear apiEvents queue @@ -2224,7 +2224,7 @@ void TileDebugSessionLinux::attachTile() { isAttached = true; } -void TileDebugSessionLinux::detachTile() { +void TileDebugSessionLinuxi915::detachTile() { std::vector moduleUuids; { std::lock_guard lock(asyncThreadMutex); diff --git a/level_zero/tools/source/debug/linux/prelim/debug_session.h b/level_zero/tools/source/debug/linux/prelim/debug_session.h index e0b83153a8..5e80569070 100644 --- a/level_zero/tools/source/debug/linux/prelim/debug_session.h +++ b/level_zero/tools/source/debug/linux/prelim/debug_session.h @@ -28,14 +28,14 @@ struct EngineClassInstance; } // namespace NEO namespace L0 { -struct TileDebugSessionLinux; +struct TileDebugSessionLinuxi915; -struct DebugSessionLinux : DebugSessionImp { +struct DebugSessionLinuxi915 : DebugSessionImp { - friend struct TileDebugSessionLinux; + friend struct TileDebugSessionLinuxi915; - ~DebugSessionLinux() override; - DebugSessionLinux(const zet_debug_config_t &config, Device *device, int debugFd, void *params); + ~DebugSessionLinuxi915() override; + DebugSessionLinuxi915(const zet_debug_config_t &config, Device *device, int debugFd, void *params); ze_result_t initialize() override; @@ -212,7 +212,7 @@ struct DebugSessionLinux : DebugSessionImp { } MOCKABLE_VIRTUAL void createTileSessionsIfEnabled(); - MOCKABLE_VIRTUAL TileDebugSessionLinux *createTileSession(const zet_debug_config_t &config, Device *device, DebugSessionImp *rootDebugSession); + MOCKABLE_VIRTUAL TileDebugSessionLinuxi915 *createTileSession(const zet_debug_config_t &config, Device *device, DebugSessionImp *rootDebugSession); static void *asyncThreadFunction(void *arg); static void *readInternalEventsThreadFunction(void *arg); @@ -377,13 +377,13 @@ struct DebugSessionLinux : DebugSessionImp { // true - blocking on fence - do not auto-ack events }; -struct TileDebugSessionLinux : DebugSessionLinux { - TileDebugSessionLinux(zet_debug_config_t config, Device *device, DebugSessionImp *rootDebugSession) : DebugSessionLinux(config, device, 0, nullptr), - rootDebugSession(reinterpret_cast(rootDebugSession)) { +struct TileDebugSessionLinuxi915 : DebugSessionLinuxi915 { + TileDebugSessionLinuxi915(zet_debug_config_t config, Device *device, DebugSessionImp *rootDebugSession) : DebugSessionLinuxi915(config, device, 0, nullptr), + rootDebugSession(reinterpret_cast(rootDebugSession)) { tileIndex = Math::log2(static_cast(connectedDevice->getNEODevice()->getDeviceBitfield().to_ulong())); } - ~TileDebugSessionLinux() override = default; + ~TileDebugSessionLinuxi915() override = default; bool closeConnection() override { return true; } ze_result_t initialize() override { @@ -461,7 +461,7 @@ struct TileDebugSessionLinux : DebugSessionLinux { return rootDebugSession->interruptImp(this->tileIndex); } - DebugSessionLinux *rootDebugSession = nullptr; + DebugSessionLinuxi915 *rootDebugSession = nullptr; uint32_t tileIndex = std::numeric_limits::max(); bool processEntryState = false; diff --git a/level_zero/tools/source/debug/linux/prelim/debug_session_linux_helper.cpp b/level_zero/tools/source/debug/linux/prelim/debug_session_linux_helper.cpp index d253b857d6..06728b7087 100644 --- a/level_zero/tools/source/debug/linux/prelim/debug_session_linux_helper.cpp +++ b/level_zero/tools/source/debug/linux/prelim/debug_session_linux_helper.cpp @@ -1,5 +1,5 @@ /* - * Copyright (C) 2022 Intel Corporation + * Copyright (C) 2022-2023 Intel Corporation * * SPDX-License-Identifier: MIT * @@ -10,7 +10,7 @@ namespace L0 { DebugSession *createDebugSessionHelper(const zet_debug_config_t &config, Device *device, int debugFd, void *params) { - return new DebugSessionLinux(config, device, debugFd, params); + return new DebugSessionLinuxi915(config, device, debugFd, params); } } // namespace L0 diff --git a/level_zero/tools/test/unit_tests/sources/debug/linux/debug_session_fixtures_linux.cpp b/level_zero/tools/test/unit_tests/sources/debug/linux/debug_session_fixtures_linux.cpp index 0b28072e28..bf0baae672 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/linux/debug_session_fixtures_linux.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/linux/debug_session_fixtures_linux.cpp @@ -73,8 +73,8 @@ void DebugApiLinuxMultiDeviceFixture::setUp() { rootDeviceEnvironment.osInterface->setDriverModel(std::unique_ptr(mockDrm)); } -TileDebugSessionLinux *MockDebugSessionLinux::createTileSession(const zet_debug_config_t &config, L0::Device *device, L0::DebugSessionImp *rootDebugSession) { - auto tileSession = new MockTileDebugSessionLinux(config, device, rootDebugSession); +TileDebugSessionLinuxi915 *MockDebugSessionLinuxi915::createTileSession(const zet_debug_config_t &config, L0::Device *device, L0::DebugSessionImp *rootDebugSession) { + auto tileSession = new MockTileDebugSessionLinuxi915(config, device, rootDebugSession); tileSession->initialize(); return tileSession; } diff --git a/level_zero/tools/test/unit_tests/sources/debug/linux/debug_session_fixtures_linux.h b/level_zero/tools/test/unit_tests/sources/debug/linux/debug_session_fixtures_linux.h index 435d527af8..98be3b038b 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/linux/debug_session_fixtures_linux.h +++ b/level_zero/tools/test/unit_tests/sources/debug/linux/debug_session_fixtures_linux.h @@ -34,7 +34,7 @@ namespace ult { using typeOfUUID = std::decay::type; -struct MockIoctlHandler : public L0::DebugSessionLinux::IoctlHandler { +struct MockIoctlHandler : public L0::DebugSessionLinuxi915::IoctlHandler { using EventPair = std::pair; using EventQueue = std::queue; @@ -248,7 +248,7 @@ struct MockIoctlHandler : public L0::DebugSessionLinux::IoctlHandler { uint32_t ackCount = 0; }; -struct MockDebugSessionLinux : public L0::DebugSessionLinux { +struct MockDebugSessionLinuxi915 : public L0::DebugSessionLinuxi915 { using L0::DebugSessionImp::allThreads; using L0::DebugSessionImp::apiEvents; using L0::DebugSessionImp::attachTile; @@ -267,62 +267,62 @@ struct MockDebugSessionLinux : public L0::DebugSessionLinux { using L0::DebugSessionImp::tileSessionsEnabled; using L0::DebugSessionImp::triggerEvents; - using L0::DebugSessionLinux::asyncThread; - using L0::DebugSessionLinux::blockOnFenceMode; - using L0::DebugSessionLinux::checkAllEventsCollected; - using L0::DebugSessionLinux::checkStoppedThreadsAndGenerateEvents; - using L0::DebugSessionLinux::clientHandle; - using L0::DebugSessionLinux::clientHandleClosed; - using L0::DebugSessionLinux::clientHandleToConnection; - using L0::DebugSessionLinux::closeAsyncThread; - using L0::DebugSessionLinux::closeInternalEventsThread; - using L0::DebugSessionLinux::createTileSessionsIfEnabled; - using L0::DebugSessionLinux::debugArea; - using L0::DebugSessionLinux::euControlInterruptSeqno; - using L0::DebugSessionLinux::eventsToAck; - using L0::DebugSessionLinux::extractVaFromUuidString; - using L0::DebugSessionLinux::fd; - using L0::DebugSessionLinux::getContextStateSaveAreaGpuVa; - using L0::DebugSessionLinux::getContextStateSaveAreaSize; - using L0::DebugSessionLinux::getIsaInfoForAllInstances; - using L0::DebugSessionLinux::getISAVMHandle; - using L0::DebugSessionLinux::getRegisterSetProperties; - using L0::DebugSessionLinux::getSbaBufferGpuVa; - using L0::DebugSessionLinux::getStateSaveAreaHeader; - using L0::DebugSessionLinux::handleEvent; - using L0::DebugSessionLinux::handleEventsAsync; - using L0::DebugSessionLinux::handleVmBindEvent; - using L0::DebugSessionLinux::internalEventQueue; - using L0::DebugSessionLinux::internalEventThread; - using L0::DebugSessionLinux::interruptImp; - using L0::DebugSessionLinux::ioctl; - using L0::DebugSessionLinux::ioctlHandler; - using L0::DebugSessionLinux::newlyStoppedThreads; - using L0::DebugSessionLinux::pendingInterrupts; - using L0::DebugSessionLinux::pendingVmBindEvents; - using L0::DebugSessionLinux::printContextVms; - using L0::DebugSessionLinux::pushApiEvent; - using L0::DebugSessionLinux::readEventImp; - using L0::DebugSessionLinux::readGpuMemory; - using L0::DebugSessionLinux::readInternalEventsAsync; - using L0::DebugSessionLinux::readModuleDebugArea; - using L0::DebugSessionLinux::readSbaBuffer; - using L0::DebugSessionLinux::readStateSaveAreaHeader; - using L0::DebugSessionLinux::startAsyncThread; - using L0::DebugSessionLinux::threadControl; - using L0::DebugSessionLinux::ThreadControlCmd; - using L0::DebugSessionLinux::typeToRegsetDesc; - using L0::DebugSessionLinux::typeToRegsetFlags; - using L0::DebugSessionLinux::uuidL0CommandQueueHandleToDevice; - using L0::DebugSessionLinux::writeGpuMemory; + using L0::DebugSessionLinuxi915::asyncThread; + using L0::DebugSessionLinuxi915::blockOnFenceMode; + using L0::DebugSessionLinuxi915::checkAllEventsCollected; + using L0::DebugSessionLinuxi915::checkStoppedThreadsAndGenerateEvents; + using L0::DebugSessionLinuxi915::clientHandle; + using L0::DebugSessionLinuxi915::clientHandleClosed; + using L0::DebugSessionLinuxi915::clientHandleToConnection; + using L0::DebugSessionLinuxi915::closeAsyncThread; + using L0::DebugSessionLinuxi915::closeInternalEventsThread; + using L0::DebugSessionLinuxi915::createTileSessionsIfEnabled; + using L0::DebugSessionLinuxi915::debugArea; + using L0::DebugSessionLinuxi915::euControlInterruptSeqno; + using L0::DebugSessionLinuxi915::eventsToAck; + using L0::DebugSessionLinuxi915::extractVaFromUuidString; + using L0::DebugSessionLinuxi915::fd; + using L0::DebugSessionLinuxi915::getContextStateSaveAreaGpuVa; + using L0::DebugSessionLinuxi915::getContextStateSaveAreaSize; + using L0::DebugSessionLinuxi915::getIsaInfoForAllInstances; + using L0::DebugSessionLinuxi915::getISAVMHandle; + using L0::DebugSessionLinuxi915::getRegisterSetProperties; + using L0::DebugSessionLinuxi915::getSbaBufferGpuVa; + using L0::DebugSessionLinuxi915::getStateSaveAreaHeader; + using L0::DebugSessionLinuxi915::handleEvent; + using L0::DebugSessionLinuxi915::handleEventsAsync; + using L0::DebugSessionLinuxi915::handleVmBindEvent; + using L0::DebugSessionLinuxi915::internalEventQueue; + using L0::DebugSessionLinuxi915::internalEventThread; + using L0::DebugSessionLinuxi915::interruptImp; + using L0::DebugSessionLinuxi915::ioctl; + using L0::DebugSessionLinuxi915::ioctlHandler; + using L0::DebugSessionLinuxi915::newlyStoppedThreads; + using L0::DebugSessionLinuxi915::pendingInterrupts; + using L0::DebugSessionLinuxi915::pendingVmBindEvents; + using L0::DebugSessionLinuxi915::printContextVms; + using L0::DebugSessionLinuxi915::pushApiEvent; + using L0::DebugSessionLinuxi915::readEventImp; + using L0::DebugSessionLinuxi915::readGpuMemory; + using L0::DebugSessionLinuxi915::readInternalEventsAsync; + using L0::DebugSessionLinuxi915::readModuleDebugArea; + using L0::DebugSessionLinuxi915::readSbaBuffer; + using L0::DebugSessionLinuxi915::readStateSaveAreaHeader; + using L0::DebugSessionLinuxi915::startAsyncThread; + using L0::DebugSessionLinuxi915::threadControl; + using L0::DebugSessionLinuxi915::ThreadControlCmd; + using L0::DebugSessionLinuxi915::typeToRegsetDesc; + using L0::DebugSessionLinuxi915::typeToRegsetFlags; + using L0::DebugSessionLinuxi915::uuidL0CommandQueueHandleToDevice; + using L0::DebugSessionLinuxi915::writeGpuMemory; - MockDebugSessionLinux(const zet_debug_config_t &config, L0::Device *device, int debugFd, void *params) : DebugSessionLinux(config, device, debugFd, params) { + MockDebugSessionLinuxi915(const zet_debug_config_t &config, L0::Device *device, int debugFd, void *params) : DebugSessionLinuxi915(config, device, debugFd, params) { clientHandleToConnection[mockClientHandle].reset(new ClientConnection); clientHandle = mockClientHandle; createEuThreads(); } - MockDebugSessionLinux(const zet_debug_config_t &config, L0::Device *device, int debugFd) : MockDebugSessionLinux(config, device, debugFd, nullptr) {} + MockDebugSessionLinuxi915(const zet_debug_config_t &config, L0::Device *device, int debugFd) : MockDebugSessionLinuxi915(config, device, debugFd, nullptr) {} ze_result_t initialize() override { if (initializeRetVal != ZE_RESULT_FORCE_UINT32) { @@ -335,7 +335,7 @@ struct MockDebugSessionLinux : public L0::DebugSessionLinux { clientHandle = mockClientHandle; return initializeRetVal; } - return DebugSessionLinux::initialize(); + return DebugSessionLinuxi915::initialize(); } std::unordered_map> &getClassHandleToIndex() { @@ -346,46 +346,46 @@ struct MockDebugSessionLinux : public L0::DebugSessionLinux { if (returnTimeDiff != -1) { return returnTimeDiff; } - return L0::DebugSessionLinux::getTimeDifferenceMilliseconds(time); + return L0::DebugSessionLinuxi915::getTimeDifferenceMilliseconds(time); } int threadControl(const std::vector &threads, uint32_t tile, ThreadControlCmd threadCmd, std::unique_ptr &bitmask, size_t &bitmaskSize) override { numThreadsPassedToThreadControl = threads.size(); - return L0::DebugSessionLinux::threadControl(threads, tile, threadCmd, bitmask, bitmaskSize); + return L0::DebugSessionLinuxi915::threadControl(threads, tile, threadCmd, bitmask, bitmaskSize); } ze_result_t readRegisters(ze_device_thread_t thread, uint32_t type, uint32_t start, uint32_t count, void *pRegisterValues) override { readRegistersCallCount++; - return L0::DebugSessionLinux::readRegisters(thread, type, start, count, pRegisterValues); + return L0::DebugSessionLinuxi915::readRegisters(thread, type, start, count, pRegisterValues); } ze_result_t writeRegisters(ze_device_thread_t thread, uint32_t type, uint32_t start, uint32_t count, void *pRegisterValues) override { writeRegistersCallCount++; writeRegistersReg = type; - return L0::DebugSessionLinux::writeRegisters(thread, type, start, count, pRegisterValues); + return L0::DebugSessionLinuxi915::writeRegisters(thread, type, start, count, pRegisterValues); } ze_result_t resumeImp(const std::vector &threads, uint32_t deviceIndex) override { resumedThreads.push_back(threads); resumedDevices.push_back(deviceIndex); - return L0::DebugSessionLinux::resumeImp(threads, deviceIndex); + return L0::DebugSessionLinuxi915::resumeImp(threads, deviceIndex); } ze_result_t interruptImp(uint32_t deviceIndex) override { interruptedDevice = deviceIndex; - return L0::DebugSessionLinux::interruptImp(deviceIndex); + return L0::DebugSessionLinuxi915::interruptImp(deviceIndex); } void handleEvent(prelim_drm_i915_debug_event *event) override { handleEventCalledCount++; - L0::DebugSessionLinux::handleEvent(event); + L0::DebugSessionLinuxi915::handleEvent(event); } bool areRequestedThreadsStopped(ze_device_thread_t thread) override { if (allThreadsStopped) { return allThreadsStopped; } - return L0::DebugSessionLinux::areRequestedThreadsStopped(thread); + return L0::DebugSessionLinuxi915::areRequestedThreadsStopped(thread); } void ensureThreadStopped(ze_device_thread_t thread) { @@ -428,7 +428,7 @@ struct MockDebugSessionLinux : public L0::DebugSessionLinux { if (skipWriteResumeCommand) { return true; } - return L0::DebugSessionLinux::writeResumeCommand(threadIds); + return L0::DebugSessionLinuxi915::writeResumeCommand(threadIds); } bool checkThreadIsResumed(const EuThread::ThreadId &threadID) override { @@ -436,14 +436,14 @@ struct MockDebugSessionLinux : public L0::DebugSessionLinux { if (skipcheckThreadIsResumed) { return true; } - return L0::DebugSessionLinux::checkThreadIsResumed(threadID); + return L0::DebugSessionLinuxi915::checkThreadIsResumed(threadID); } float getThreadStartLimitTime() override { if (threadStartLimit >= 0.0) { return threadStartLimit; } - return L0::DebugSessionLinux::getThreadStartLimitTime(); + return L0::DebugSessionLinuxi915::getThreadStartLimitTime(); } void startInternalEventsThread() override { @@ -454,7 +454,7 @@ struct MockDebugSessionLinux : public L0::DebugSessionLinux { if (failInternalEventsThreadStart) { return; } - return DebugSessionLinux::startInternalEventsThread(); + return DebugSessionLinuxi915::startInternalEventsThread(); } std::unique_ptr getInternalEvent() override { @@ -462,17 +462,17 @@ struct MockDebugSessionLinux : public L0::DebugSessionLinux { if (synchronousInternalEventRead) { readInternalEventsAsync(); } - return DebugSessionLinux::getInternalEvent(); + return DebugSessionLinuxi915::getInternalEvent(); } void processPendingVmBindEvents() override { processPendingVmBindEventsCalled++; - return DebugSessionLinux::processPendingVmBindEvents(); + return DebugSessionLinuxi915::processPendingVmBindEvents(); } void checkStoppedThreadsAndGenerateEvents(const std::vector &threads, uint64_t memoryHandle, uint32_t deviceIndex) override { checkStoppedThreadsAndGenerateEventsCallCount++; - return DebugSessionLinux::checkStoppedThreadsAndGenerateEvents(threads, memoryHandle, deviceIndex); + return DebugSessionLinuxi915::checkStoppedThreadsAndGenerateEvents(threads, memoryHandle, deviceIndex); } void addThreadToNewlyStoppedFromRaisedAttention(EuThread::ThreadId threadId, uint64_t memoryHandle, const void *stateSaveArea) override { @@ -482,10 +482,10 @@ struct MockDebugSessionLinux : public L0::DebugSessionLinux { void cleanRootSessionAfterDetach(uint32_t deviceIndex) override { cleanRootSessionAfterDetachCallCount++; - return DebugSessionLinux::cleanRootSessionAfterDetach(deviceIndex); + return DebugSessionLinuxi915::cleanRootSessionAfterDetach(deviceIndex); } - TileDebugSessionLinux *createTileSession(const zet_debug_config_t &config, L0::Device *device, L0::DebugSessionImp *rootDebugSession) override; + TileDebugSessionLinuxi915 *createTileSession(const zet_debug_config_t &config, L0::Device *device, L0::DebugSessionImp *rootDebugSession) override; ze_result_t initializeRetVal = ZE_RESULT_FORCE_UINT32; bool allThreadsStopped = false; @@ -520,11 +520,11 @@ struct MockDebugSessionLinux : public L0::DebugSessionLinux { float threadStartLimit = -1.0; }; -struct MockAsyncThreadDebugSessionLinux : public MockDebugSessionLinux { - using MockDebugSessionLinux::MockDebugSessionLinux; +struct MockAsyncThreadDebugSessionLinuxi915 : public MockDebugSessionLinuxi915 { + using MockDebugSessionLinuxi915::MockDebugSessionLinuxi915; static void *mockAsyncThreadFunction(void *arg) { - DebugSessionLinux::asyncThreadFunction(arg); - reinterpret_cast(arg)->asyncThreadFinished = true; + DebugSessionLinuxi915::asyncThreadFunction(arg); + reinterpret_cast(arg)->asyncThreadFinished = true; return nullptr; } @@ -535,7 +535,7 @@ struct MockAsyncThreadDebugSessionLinux : public MockDebugSessionLinux { std::atomic asyncThreadFinished{false}; }; -struct MockTileDebugSessionLinux : TileDebugSessionLinux { +struct MockTileDebugSessionLinuxi915 : TileDebugSessionLinuxi915 { using DebugSession::allThreads; using DebugSessionImp::apiEvents; using DebugSessionImp::checkTriggerEventsForAttention; @@ -547,24 +547,24 @@ struct MockTileDebugSessionLinux : TileDebugSessionLinux { using DebugSessionImp::sipSupportsSlm; using DebugSessionImp::stateSaveAreaHeader; using DebugSessionImp::triggerEvents; - using DebugSessionLinux::detached; - using DebugSessionLinux::ioctl; - using DebugSessionLinux::pushApiEvent; - using TileDebugSessionLinux::cleanRootSessionAfterDetach; - using TileDebugSessionLinux::getAllMemoryHandles; - using TileDebugSessionLinux::getContextStateSaveAreaGpuVa; - using TileDebugSessionLinux::getContextStateSaveAreaSize; - using TileDebugSessionLinux::getSbaBufferGpuVa; - using TileDebugSessionLinux::isAttached; - using TileDebugSessionLinux::modules; - using TileDebugSessionLinux::processEntryState; - using TileDebugSessionLinux::readGpuMemory; - using TileDebugSessionLinux::readModuleDebugArea; - using TileDebugSessionLinux::readSbaBuffer; - using TileDebugSessionLinux::readStateSaveAreaHeader; - using TileDebugSessionLinux::startAsyncThread; - using TileDebugSessionLinux::TileDebugSessionLinux; - using TileDebugSessionLinux::writeGpuMemory; + using DebugSessionLinuxi915::detached; + using DebugSessionLinuxi915::ioctl; + using DebugSessionLinuxi915::pushApiEvent; + using TileDebugSessionLinuxi915::cleanRootSessionAfterDetach; + using TileDebugSessionLinuxi915::getAllMemoryHandles; + using TileDebugSessionLinuxi915::getContextStateSaveAreaGpuVa; + using TileDebugSessionLinuxi915::getContextStateSaveAreaSize; + using TileDebugSessionLinuxi915::getSbaBufferGpuVa; + using TileDebugSessionLinuxi915::isAttached; + using TileDebugSessionLinuxi915::modules; + using TileDebugSessionLinuxi915::processEntryState; + using TileDebugSessionLinuxi915::readGpuMemory; + using TileDebugSessionLinuxi915::readModuleDebugArea; + using TileDebugSessionLinuxi915::readSbaBuffer; + using TileDebugSessionLinuxi915::readStateSaveAreaHeader; + using TileDebugSessionLinuxi915::startAsyncThread; + using TileDebugSessionLinuxi915::TileDebugSessionLinuxi915; + using TileDebugSessionLinuxi915::writeGpuMemory; void ensureThreadStopped(ze_device_thread_t thread, uint64_t vmHandle) { auto threadId = convertToThreadId(thread); @@ -591,14 +591,14 @@ struct MockTileDebugSessionLinux : TileDebugSessionLinux { } return true; } - return L0::DebugSessionLinux::readSystemRoutineIdent(thread, vmHandle, srIdent); + return L0::DebugSessionLinuxi915::readSystemRoutineIdent(thread, vmHandle, srIdent); } int64_t getTimeDifferenceMilliseconds(std::chrono::high_resolution_clock::time_point time) override { if (returnTimeDiff != -1) { return returnTimeDiff; } - return L0::DebugSessionLinux::getTimeDifferenceMilliseconds(time); + return L0::DebugSessionLinuxi915::getTimeDifferenceMilliseconds(time); } int writeResumeResult = -1; @@ -626,19 +626,19 @@ struct DebugApiPageFaultEventFixture : public DebugApiLinuxFixture { zet_debug_config_t config = {}; config.pid = 0x1234; - sessionMock = std::make_unique(config, device, 10); + sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto handler = new MockIoctlHandler; sessionMock->ioctlHandler.reset(handler); SIP::version version = {2, 0, 0}; initStateSaveArea(sessionMock->stateSaveAreaHeader, version, device); handler->setPreadMemory(sessionMock->stateSaveAreaHeader.data(), sessionMock->stateSaveAreaHeader.size(), 0x1000); - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; - DebugSessionLinux::BindInfo cssaInfo = {0x1000, sessionMock->stateSaveAreaHeader.size()}; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + DebugSessionLinuxi915::BindInfo cssaInfo = {0x1000, sessionMock->stateSaveAreaHeader.size()}; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; } void tearDown() { @@ -646,7 +646,7 @@ struct DebugApiPageFaultEventFixture : public DebugApiLinuxFixture { } void buildPfi915Event() { - buildPfi915Event(MockDebugSessionLinux::mockClientHandle); + buildPfi915Event(MockDebugSessionLinuxi915::mockClientHandle); } void buildPfi915Event(uint64_t clientHandle) { prelim_drm_i915_debug_event_page_fault pf = {}; @@ -669,7 +669,7 @@ struct DebugApiPageFaultEventFixture : public DebugApiLinuxFixture { size_t bitmaskSize = 256; uint8_t data[sizeof(prelim_drm_i915_debug_event_page_fault) + (256 * 3)]; std::unique_ptr bitmaskBefore, bitmaskAfter, bitmaskResolved; - std::unique_ptr sessionMock; + std::unique_ptr sessionMock; uint64_t ctxHandle = 2; uint64_t vmHandle = 7; uint64_t lrcHandle = 8; @@ -687,16 +687,16 @@ struct DebugApiLinuxMultiDeviceFixture : public MultipleDevicesWithCustomHwInfo static constexpr uint8_t bufferSize = 16; }; -struct MockDebugSessionLinuxHelper { +struct MockDebugSessionLinuxi915Helper { - void setupSessionClassHandlesAndUuidMap(MockDebugSessionLinux *session) { - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[sbaClassHandle] = {"SBA AREA", static_cast(NEO::DrmResourceClass::SbaTrackingBuffer)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[moduleDebugClassHandle] = {"DEBUG AREA", static_cast(NEO::DrmResourceClass::ModuleHeapDebugArea)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[contextSaveClassHandle] = {"CONTEXT SAVE AREA", static_cast(NEO::DrmResourceClass::ContextSaveArea)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[isaClassHandle] = {"ISA", static_cast(NEO::DrmResourceClass::Isa)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[elfClassHandle] = {"ELF", static_cast(NEO::DrmResourceClass::Elf)}; + void setupSessionClassHandlesAndUuidMap(MockDebugSessionLinuxi915 *session) { + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[sbaClassHandle] = {"SBA AREA", static_cast(NEO::DrmResourceClass::SbaTrackingBuffer)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[moduleDebugClassHandle] = {"DEBUG AREA", static_cast(NEO::DrmResourceClass::ModuleHeapDebugArea)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[contextSaveClassHandle] = {"CONTEXT SAVE AREA", static_cast(NEO::DrmResourceClass::ContextSaveArea)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[isaClassHandle] = {"ISA", static_cast(NEO::DrmResourceClass::Isa)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[elfClassHandle] = {"ELF", static_cast(NEO::DrmResourceClass::Elf)}; - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -706,7 +706,7 @@ struct MockDebugSessionLinuxHelper { auto deviceBitfield = static_cast(bitfield.to_ulong()); memcpy(isaUuidData.data.get(), &deviceBitfield, sizeof(deviceBitfield)); - DebugSessionLinux::UuidData elfUuidData = { + DebugSessionLinuxi915::UuidData elfUuidData = { .handle = elfUUID, .classHandle = elfClassHandle, .classIndex = NEO::DrmResourceClass::Elf, @@ -714,40 +714,40 @@ struct MockDebugSessionLinuxHelper { .dataSize = elfSize}; memcpy(elfUuidData.data.get(), "ELF", sizeof("ELF")); - DebugSessionLinux::UuidData cookieUuidData = { + DebugSessionLinuxi915::UuidData cookieUuidData = { .handle = cookieUUID, .classHandle = isaUUID, .classIndex = NEO::DrmResourceClass::MaxSize, }; - DebugSessionLinux::UuidData sbaUuidData = { + DebugSessionLinuxi915::UuidData sbaUuidData = { .handle = sbaUUID, .classHandle = sbaClassHandle, .classIndex = NEO::DrmResourceClass::SbaTrackingBuffer, .data = nullptr, .dataSize = 0}; - DebugSessionLinux::UuidData debugAreaUuidData = { + DebugSessionLinuxi915::UuidData debugAreaUuidData = { .handle = debugAreaUUID, .classHandle = moduleDebugClassHandle, .classIndex = NEO::DrmResourceClass::ModuleHeapDebugArea, .data = nullptr, .dataSize = 0}; - DebugSessionLinux::UuidData stateSaveUuidData = { + DebugSessionLinuxi915::UuidData stateSaveUuidData = { .handle = stateSaveUUID, .classHandle = contextSaveClassHandle, .classIndex = NEO::DrmResourceClass::ContextSaveArea, .data = nullptr, .dataSize = 0}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(isaUUID, std::move(isaUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(elfUUID, std::move(elfUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(cookieUUID, std::move(cookieUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(sbaUUID, std::move(sbaUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(debugAreaUUID, std::move(debugAreaUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(stateSaveUUID, std::move(stateSaveUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(isaUUID, std::move(isaUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(elfUUID, std::move(elfUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(cookieUUID, std::move(cookieUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(sbaUUID, std::move(sbaUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(debugAreaUUID, std::move(debugAreaUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(stateSaveUUID, std::move(stateSaveUuidData)); - DebugSessionLinux::UuidData zebinModuleUuidData = { + DebugSessionLinuxi915::UuidData zebinModuleUuidData = { .handle = zebinModuleUUID, .classHandle = zebinModuleClassHandle, .classIndex = NEO::DrmResourceClass::L0ZebinModule, @@ -755,18 +755,18 @@ struct MockDebugSessionLinuxHelper { .dataSize = sizeof(kernelCount)}; memcpy(zebinModuleUuidData.data.get(), &kernelCount, sizeof(kernelCount)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = 2; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr = elfVa; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = 2; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr = elfVa; } - void setupVmToTile(MockDebugSessionLinux *session) { - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[vm0] = 0; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[vm1] = 1; + void setupVmToTile(MockDebugSessionLinuxi915 *session) { + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[vm0] = 0; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[vm1] = 1; } - void addIsaVmBindEvent(MockDebugSessionLinux *session, uint64_t vm, bool ack, bool create) { + void addIsaVmBindEvent(MockDebugSessionLinuxi915 *session, uint64_t vm, bool ack, bool create) { uint64_t vmBindIsaData[(sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID) + sizeof(uint64_t)) / sizeof(uint64_t)]; prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); @@ -782,7 +782,7 @@ struct MockDebugSessionLinuxHelper { } vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 20u; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vm; @@ -800,7 +800,7 @@ struct MockDebugSessionLinuxHelper { session->handleEvent(&vmBindIsa->base); } - void addZebinVmBindEvent(MockDebugSessionLinux *session, uint64_t vm, bool ack, bool create, uint64_t kernelIndex, uint32_t zebinModuleId) { + void addZebinVmBindEvent(MockDebugSessionLinuxi915 *session, uint64_t vm, bool ack, bool create, uint64_t kernelIndex, uint32_t zebinModuleId) { uint64_t vmBindIsaData[(sizeof(prelim_drm_i915_debug_event_vm_bind) + 4 * sizeof(typeOfUUID) + sizeof(uint64_t)) / sizeof(uint64_t)]; prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); @@ -817,21 +817,21 @@ struct MockDebugSessionLinuxHelper { vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 4 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 10; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; if (zebinModuleId == 0) { vmBindIsa->va_start = kernelIndex == 0 ? isaGpuVa : isaGpuVa + isaSize; } else { vmBindIsa->va_start = kernelIndex == 0 ? isaGpuVa * 4 : isaGpuVa * 4 + isaSize; - DebugSessionLinux::UuidData zebinModuleUuidData = { + DebugSessionLinuxi915::UuidData zebinModuleUuidData = { .handle = zebinModuleUUID1, .classHandle = zebinModuleClassHandle, .classIndex = NEO::DrmResourceClass::L0ZebinModule, .data = std::make_unique(sizeof(kernelCount)), .dataSize = sizeof(kernelCount)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(zebinModuleUUID1, std::move(zebinModuleUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID1].segmentCount = kernelCount; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(zebinModuleUUID1, std::move(zebinModuleUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID1].segmentCount = kernelCount; } vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vm; @@ -847,7 +847,7 @@ struct MockDebugSessionLinuxHelper { session->handleEvent(&vmBindIsa->base); } - void addZebinVmBindEvent(MockDebugSessionLinux *session, uint64_t vm, bool ack, bool create, uint64_t kernelIndex) { + void addZebinVmBindEvent(MockDebugSessionLinuxi915 *session, uint64_t vm, bool ack, bool create, uint64_t kernelIndex) { return addZebinVmBindEvent(session, vm, ack, create, kernelIndex, 0); } diff --git a/level_zero/tools/test/unit_tests/sources/debug/linux/test_debug_api_linux.cpp b/level_zero/tools/test/unit_tests/sources/debug/linux/test_debug_api_linux.cpp index 2c82d92682..4598c7aa99 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/linux/test_debug_api_linux.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/linux/test_debug_api_linux.cpp @@ -63,7 +63,7 @@ namespace ult { extern CreateDebugSessionHelperFunc createDebugSessionFunc; TEST(IoctlHandler, GivenHandlerWhenPreadCalledThenSysCallIsCalled) { - L0::DebugSessionLinux::IoctlHandler handler; + L0::DebugSessionLinuxi915::IoctlHandler handler; NEO::SysCalls::preadFuncCalled = 0; auto retVal = handler.pread(0, nullptr, 0, 0); @@ -73,7 +73,7 @@ TEST(IoctlHandler, GivenHandlerWhenPreadCalledThenSysCallIsCalled) { } TEST(IoctlHandler, GivenHandlerWhenPwriteCalledThenSysCallIsCalled) { - L0::DebugSessionLinux::IoctlHandler handler; + L0::DebugSessionLinuxi915::IoctlHandler handler; NEO::SysCalls::pwriteFuncCalled = 0; auto retVal = handler.pwrite(0, nullptr, 0, 0); @@ -83,7 +83,7 @@ TEST(IoctlHandler, GivenHandlerWhenPwriteCalledThenSysCallIsCalled) { } TEST(IoctlHandler, GivenHandlerWhenMmapAndMunmapCalledThenRedirectedToSysCall) { - L0::DebugSessionLinux::IoctlHandler handler; + L0::DebugSessionLinuxi915::IoctlHandler handler; NEO::SysCalls::mmapFuncCalled = 0; NEO::SysCalls::munmapFuncCalled = 0; auto mappedPtr = handler.mmap(0, 0, 0, 0, 0, 0); @@ -115,7 +115,7 @@ TEST(IoctlHandler, GivenHandlerWhenEuControlIoctlFailsWithEBUSYThenIoctlIsNotCal return 0; }; - L0::DebugSessionLinux::IoctlHandler handler; + L0::DebugSessionLinuxi915::IoctlHandler handler; auto result = handler.ioctl(0, PRELIM_I915_DEBUG_IOCTL_EU_CONTROL, &ioctlCount); EXPECT_EQ(-1, result); @@ -142,18 +142,18 @@ TEST(IoctlHandler, GivenHandlerWhenEuControlIoctlFailsWithEAGAINOrEINTRThenIoctl return 0; }; - L0::DebugSessionLinux::IoctlHandler handler; + L0::DebugSessionLinuxi915::IoctlHandler handler; auto result = handler.ioctl(0, PRELIM_I915_DEBUG_IOCTL_EU_CONTROL, &ioctlCount); EXPECT_EQ(0, result); EXPECT_EQ(3, ioctlCount); } -TEST(DebugSessionLinuxTest, GivenDebugSessionWhenExtractingCpuVaFromUuidThenCorrectCpuVaReturned) { +TEST(DebugSessionLinuxi915Test, GivenDebugSessionWhenExtractingCpuVaFromUuidThenCorrectCpuVaReturned) { zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, nullptr, 10); + auto sessionMock = std::make_unique(config, nullptr, 10); std::string uuid = "00000000-0000-0000-0000-5500044f4000"; auto va = sessionMock->extractVaFromUuidString(uuid); @@ -168,7 +168,7 @@ TEST(DebugSessionLinuxTest, GivenDebugSessionWhenExtractingCpuVaFromUuidThenCorr EXPECT_EQ(epxectedVa, va); } -TEST(DebugSessionLinuxTest, WhenConvertingThreadIDsForDeviceWithSingleSliceThenSubsliceIsCorrectlyRemapped) { +TEST(DebugSessionLinuxi915Test, WhenConvertingThreadIDsForDeviceWithSingleSliceThenSubsliceIsCorrectlyRemapped) { auto hwInfo = *NEO::defaultHwInfo.get(); hwInfo.gtSystemInfo.SliceCount = 1; @@ -191,7 +191,7 @@ TEST(DebugSessionLinuxTest, WhenConvertingThreadIDsForDeviceWithSingleSliceThenS Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); - auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); + auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); ASSERT_NE(nullptr, sessionMock); ze_device_thread_t thread = {UINT32_MAX, 1, 0, 0}; @@ -213,7 +213,7 @@ TEST(DebugSessionLinuxTest, WhenConvertingThreadIDsForDeviceWithSingleSliceThenS EXPECT_EQ(0u, physicalThread.thread); } -TEST(DebugSessionLinuxTest, WhenConvertingThreadIDsForDeviceWithMultipleSlicesThenSubsliceIsNotRemapped) { +TEST(DebugSessionLinuxi915Test, WhenConvertingThreadIDsForDeviceWithMultipleSlicesThenSubsliceIsNotRemapped) { auto hwInfo = *NEO::defaultHwInfo.get(); hwInfo.gtSystemInfo.SliceCount = 8; @@ -236,7 +236,7 @@ TEST(DebugSessionLinuxTest, WhenConvertingThreadIDsForDeviceWithMultipleSlicesTh Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); - auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); + auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); ASSERT_NE(nullptr, sessionMock); ze_device_thread_t thread = {UINT32_MAX, 1, 0, 0}; @@ -258,7 +258,7 @@ TEST(DebugSessionLinuxTest, WhenConvertingThreadIDsForDeviceWithMultipleSlicesTh EXPECT_EQ(0u, physicalThread.thread); } -TEST(DebugSessionLinuxTest, GivenDeviceWithSingleSliceWhenCallingAreRequestedThreadsStoppedForSliceAllThenCorrectValuesAreReturned) { +TEST(DebugSessionLinuxi915Test, GivenDeviceWithSingleSliceWhenCallingAreRequestedThreadsStoppedForSliceAllThenCorrectValuesAreReturned) { auto hwInfo = *NEO::defaultHwInfo.get(); hwInfo.gtSystemInfo.SliceCount = 1; @@ -277,7 +277,7 @@ TEST(DebugSessionLinuxTest, GivenDeviceWithSingleSliceWhenCallingAreRequestedThr neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(mockDrm)); Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); - auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); + auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); ASSERT_NE(nullptr, sessionMock); ze_device_thread_t thread = {UINT32_MAX, 0, 0, 0}; @@ -299,9 +299,9 @@ TEST(DebugSessionLinuxTest, GivenDeviceWithSingleSliceWhenCallingAreRequestedThr EXPECT_TRUE(stopped); } -TEST(DebugSessionLinuxTest, WhenEnqueueApiEventCalledThenEventPushed) { - auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, nullptr, 10); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; +TEST(DebugSessionLinuxi915Test, WhenEnqueueApiEventCalledThenEventPushed) { + auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, nullptr, 10); + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; zet_debug_event_t debugEvent = {}; sessionMock->enqueueApiEvent(debugEvent); @@ -309,14 +309,14 @@ TEST(DebugSessionLinuxTest, WhenEnqueueApiEventCalledThenEventPushed) { EXPECT_EQ(1u, sessionMock->apiEvents.size()); } -TEST(DebugSessionLinuxTest, GivenLogsEnabledWhenPrintContextVmsCalledThenMapIsPrinted) { +TEST(DebugSessionLinuxi915Test, GivenLogsEnabledWhenPrintContextVmsCalledThenMapIsPrinted) { DebugManagerStateRestore restorer; NEO::DebugManager.flags.DebuggerLogBitmask.set(255); - auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, nullptr, 10); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, nullptr, 10); + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; - DebugSessionLinux::ContextParams param = {}; + DebugSessionLinuxi915::ContextParams param = {}; sessionMock->clientHandleToConnection[sessionMock->clientHandle]->contextsCreated[0] = param; sessionMock->clientHandleToConnection[sessionMock->clientHandle]->contextsCreated[1] = param; @@ -339,14 +339,14 @@ TEST(DebugSessionLinuxTest, GivenLogsEnabledWhenPrintContextVmsCalledThenMapIsPr EXPECT_TRUE(hasSubstr(map, std::string("Context = 1 : 2"))); } -TEST(DebugSessionLinuxTest, GivenLogsDisabledWhenPrintContextVmsCalledThenMapIsiNotPrinted) { +TEST(DebugSessionLinuxi915Test, GivenLogsDisabledWhenPrintContextVmsCalledThenMapIsiNotPrinted) { DebugManagerStateRestore restorer; NEO::DebugManager.flags.DebuggerLogBitmask.set(0); - auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, nullptr, 10); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, nullptr, 10); + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; - DebugSessionLinux::ContextParams param = {}; + DebugSessionLinuxi915::ContextParams param = {}; sessionMock->clientHandleToConnection[sessionMock->clientHandle]->contextsCreated[0] = param; sessionMock->clientHandleToConnection[sessionMock->clientHandle]->contextsCreated[1] = param; @@ -367,18 +367,18 @@ TEST(DebugSessionLinuxTest, GivenLogsDisabledWhenPrintContextVmsCalledThenMapIsi EXPECT_TRUE(map.empty()); } -TEST(DebugSessionLinuxTest, GivenNullptrEventWhenReadingEventThenErrorNullptrReturned) { +TEST(DebugSessionLinuxi915Test, GivenNullptrEventWhenReadingEventThenErrorNullptrReturned) { zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, nullptr, 10); + auto session = std::make_unique(config, nullptr, 10); ASSERT_NE(nullptr, session); auto result = session->readEvent(10, nullptr); EXPECT_EQ(ZE_RESULT_ERROR_INVALID_NULL_POINTER, result); } -TEST(DebugSessionLinuxTest, GivenRootDebugSessionWhenCreateTileSessionCalledThenSessionIsCreated) { +TEST(DebugSessionLinuxi915Test, GivenRootDebugSessionWhenCreateTileSessionCalledThenSessionIsCreated) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); @@ -388,19 +388,19 @@ TEST(DebugSessionLinuxTest, GivenRootDebugSessionWhenCreateTileSessionCalledThen Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); - struct DebugSession : public DebugSessionLinux { - using DebugSessionLinux::createTileSession; - using DebugSessionLinux::DebugSessionLinux; + struct DebugSession : public DebugSessionLinuxi915 { + using DebugSessionLinuxi915::createTileSession; + using DebugSessionLinuxi915::DebugSessionLinuxi915; }; auto session = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10, nullptr); ASSERT_NE(nullptr, session); - std::unique_ptr tileSession = std::unique_ptr{session->createTileSession(zet_debug_config_t{0x1234}, &deviceImp, nullptr)}; + std::unique_ptr tileSession = std::unique_ptr{session->createTileSession(zet_debug_config_t{0x1234}, &deviceImp, nullptr)}; EXPECT_NE(nullptr, tileSession); } -TEST(DebugSessionLinuxTest, GivenRootLinuxSessionWhenCallingTileSepcificFunctionsThenUnrecoverableIsCalled) { +TEST(DebugSessionLinuxi915Test, GivenRootLinuxSessionWhenCallingTileSepcificFunctionsThenUnrecoverableIsCalled) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); @@ -410,14 +410,14 @@ TEST(DebugSessionLinuxTest, GivenRootLinuxSessionWhenCallingTileSepcificFunction Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); - auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); + auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); ASSERT_NE(nullptr, sessionMock); EXPECT_THROW(sessionMock->attachTile(), std::exception); EXPECT_THROW(sessionMock->detachTile(), std::exception); } -TEST(DebugSessionLinuxTest, GivenContextStateSaveAreaBindInfoWhenGettingCSSASizeThenSizeIsSaved) { +TEST(DebugSessionLinuxi915Test, GivenContextStateSaveAreaBindInfoWhenGettingCSSASizeThenSizeIsSaved) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); @@ -427,36 +427,36 @@ TEST(DebugSessionLinuxTest, GivenContextStateSaveAreaBindInfoWhenGettingCSSASize Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); - auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); + auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; EXPECT_EQ(0u, sessionMock->getContextStateSaveAreaGpuVa(5)); EXPECT_EQ(0u, sessionMock->getContextStateSaveAreaSize(5)); - DebugSessionLinux::BindInfo cssaInfo = {0x1234000, 0x400}; + DebugSessionLinuxi915::BindInfo cssaInfo = {0x1234000, 0x400}; sessionMock->clientHandleToConnection[sessionMock->clientHandle]->vmToContextStateSaveAreaBindInfo[5] = cssaInfo; EXPECT_EQ(0x1234000u, sessionMock->getContextStateSaveAreaGpuVa(5)); EXPECT_EQ(0x400u, sessionMock->getContextStateSaveAreaSize(5)); - DebugSessionLinux::BindInfo cssaInfo2 = {0x5678000, 0x12000}; + DebugSessionLinuxi915::BindInfo cssaInfo2 = {0x5678000, 0x12000}; sessionMock->clientHandleToConnection[sessionMock->clientHandle]->vmToContextStateSaveAreaBindInfo[5] = cssaInfo2; EXPECT_EQ(0x5678000u, sessionMock->getContextStateSaveAreaGpuVa(5)); EXPECT_EQ(0x400u, sessionMock->getContextStateSaveAreaSize(5)); } -using DebugSessionLinuxFenceMode = Test; +using DebugSessionLinuxi915FenceMode = Test; -TEST_F(DebugSessionLinuxFenceMode, GivenDebuggerOpenVersionGreaterEqual3WhenDebugSessionCreatedThanBlockingOnFenceModeIsSet) { +TEST_F(DebugSessionLinuxi915FenceMode, GivenDebuggerOpenVersionGreaterEqual3WhenDebugSessionCreatedThanBlockingOnFenceModeIsSet) { zet_debug_config_t config = {}; config.pid = 0x1234; VariableBackup mockCreateDebugSessionBackup(&L0::ult::createDebugSessionFunc, [](const zet_debug_config_t &config, L0::Device *device, int debugFd, void *params) -> DebugSession * { - auto session = new MockDebugSessionLinux(config, device, debugFd, params); + auto session = new MockDebugSessionLinuxi915(config, device, debugFd, params); session->initializeRetVal = ZE_RESULT_SUCCESS; return session; }); @@ -466,7 +466,7 @@ TEST_F(DebugSessionLinuxFenceMode, GivenDebuggerOpenVersionGreaterEqual3WhenDebu ze_result_t result = ZE_RESULT_SUCCESS; auto session = std::unique_ptr(DebugSession::create(config, device, result, false)); - MockDebugSessionLinux *linuxSession = static_cast(session.get()); + MockDebugSessionLinuxi915 *linuxSession = static_cast(session.get()); EXPECT_TRUE(linuxSession->blockOnFenceMode); } @@ -479,7 +479,7 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerOpenVersion1AndSuccessfulInitializationWh ze_result_t result = ZE_RESULT_SUCCESS; VariableBackup mockCreateDebugSessionBackup(&L0::ult::createDebugSessionFunc, [](const zet_debug_config_t &config, L0::Device *device, int debugFd, void *params) -> DebugSession * { - auto session = new MockDebugSessionLinux(config, device, debugFd, params); + auto session = new MockDebugSessionLinuxi915(config, device, debugFd, params); session->initializeRetVal = ZE_RESULT_SUCCESS; return session; }); @@ -494,7 +494,7 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerOpenVersion1AndSuccessfulInitializationWh EXPECT_NE(nullptr, session); EXPECT_EQ(ZE_RESULT_SUCCESS, result); - MockDebugSessionLinux *linuxSession = static_cast(session.get()); + MockDebugSessionLinuxi915 *linuxSession = static_cast(session.get()); EXPECT_FALSE(linuxSession->blockOnFenceMode); } @@ -528,14 +528,14 @@ TEST_F(DebugApiLinuxTest, WhenCallingResumeThenProperIoctlsAreCalled) { zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); SIP::version version = {2, 0, 0}; initStateSaveArea(sessionMock->stateSaveAreaHeader, version, device); auto handler = new MockIoctlHandler; sessionMock->ioctlHandler.reset(handler); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; sessionMock->clientHandleToConnection[sessionMock->clientHandle]->vmToContextStateSaveAreaBindInfo[1u] = {0x1000, 0x1000}; zet_debug_session_handle_t session = sessionMock->toHandle(); @@ -555,14 +555,14 @@ TEST_F(DebugApiLinuxTest, GivenStoppedThreadWhenCallingResumeThenStoppedThreadsA zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); SIP::version version = {2, 0, 0}; initStateSaveArea(sessionMock->stateSaveAreaHeader, version, device); auto handler = new MockIoctlHandler; sessionMock->ioctlHandler.reset(handler); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; sessionMock->clientHandleToConnection[sessionMock->clientHandle]->vmToContextStateSaveAreaBindInfo[1u] = {0x1000, 0x1000}; ze_device_thread_t thread = {}; @@ -578,13 +578,13 @@ TEST_F(DebugApiLinuxTest, GivenStoppedThreadWhenCallingResumeThenStoppedThreadsA } TEST_F(DebugApiLinuxTest, GivenUnknownEventWhenAcknowledgeEventCalledThenErrorUninitializedIsReturned) { - auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; sessionMock->ioctlHandler.reset(handler); zet_debug_session_handle_t session = sessionMock->toHandle(); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; zet_debug_event_t debugEvent = {}; // No events to acknowledge @@ -611,14 +611,14 @@ TEST_F(DebugApiLinuxTest, GivenUnknownEventWhenAcknowledgeEventCalledThenErrorUn } TEST_F(DebugApiLinuxTest, GivenEventRequiringAckWhenAcknowledgeEventCalledThenSuccessIsReturned) { - auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto sessionMock = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; sessionMock->ioctlHandler.reset(handler); zet_debug_session_handle_t session = sessionMock->toHandle(); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t isaGpuVa = 0x345000; uint64_t isaSize = 0x2000; @@ -634,10 +634,10 @@ TEST_F(DebugApiLinuxTest, GivenEventRequiringAckWhenAcknowledgeEventCalledThenSu eventToAck.flags = PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; eventToAck.size = sizeof(prelim_drm_i915_debug_event); - auto isa = std::make_unique(); + auto isa = std::make_unique(); isa->bindInfo = {isaGpuVa, isaSize}; isa->vmHandle = 3; - isa->elfUuidHandle = DebugSessionLinux::invalidHandle; + isa->elfUuidHandle = DebugSessionLinuxi915::invalidHandle; isa->moduleBegin = 0; isa->moduleEnd = 0; @@ -693,16 +693,16 @@ TEST_F(DebugApiLinuxTest, GivenClientAndMatchingUuidEventsWhenReadingEventsThenP zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; prelim_drm_i915_debug_event_client clientCreate = {}; clientCreate.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CLIENT; clientCreate.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; clientCreate.base.size = sizeof(prelim_drm_i915_debug_event_client); - clientCreate.handle = MockDebugSessionLinux::mockClientHandle; + clientCreate.handle = MockDebugSessionLinuxi915::mockClientHandle; auto uuidName = NEO::uuidL0CommandQueueName; auto uuidNameSize = strlen(uuidName); @@ -712,12 +712,12 @@ TEST_F(DebugApiLinuxTest, GivenClientAndMatchingUuidEventsWhenReadingEventsThenP uuid.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuid.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuid.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuid.handle = 2; uuid.payload_size = uuidNameSize; prelim_drm_i915_debug_read_uuid readUuid = {}; - readUuid.client_handle = MockDebugSessionLinux::mockClientHandle; + readUuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; memcpy(readUuid.uuid, uuidHash, strlen(uuidHash)); readUuid.payload_ptr = reinterpret_cast(uuidName); readUuid.payload_size = uuid.payload_size; @@ -745,9 +745,9 @@ TEST_F(DebugApiLinuxTest, GivenValidClassNameUuidWhenHandlingEventThenClientHand zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; auto uuidName = NEO::classNamesToUuid[0].first; auto uuidNameSize = strlen(uuidName); @@ -757,7 +757,7 @@ TEST_F(DebugApiLinuxTest, GivenValidClassNameUuidWhenHandlingEventThenClientHand uuid.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuid.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuid.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuid.handle = 2; uuid.payload_size = uuidNameSize; @@ -772,7 +772,7 @@ TEST_F(DebugApiLinuxTest, GivenValidClassNameUuidWhenHandlingEventThenClientHand session->ioctlHandler.reset(handler); session->handleEvent(&uuid.base); - EXPECT_EQ(MockDebugSessionLinux::mockClientHandle, session->clientHandle); + EXPECT_EQ(MockDebugSessionLinuxi915::mockClientHandle, session->clientHandle); EXPECT_EQ(1, handler->ioctlCalled); } @@ -780,9 +780,9 @@ TEST_F(DebugApiLinuxTest, GivenUuidCommandQueueCreatedHandledThenProcessEntryEve zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; auto uuidName = NEO::uuidL0CommandQueueName; auto uuidNameSize = strlen(uuidName); @@ -792,7 +792,7 @@ TEST_F(DebugApiLinuxTest, GivenUuidCommandQueueCreatedHandledThenProcessEntryEve uuid.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuid.base.flags = 0; uuid.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuid.handle = 2; uuid.payload_size = uuidNameSize; @@ -807,7 +807,7 @@ TEST_F(DebugApiLinuxTest, GivenUuidCommandQueueCreatedHandledThenProcessEntryEve session->ioctlHandler.reset(handler); session->handleEvent(&uuid.base); - EXPECT_EQ(DebugSessionLinux::invalidClientHandle, session->clientHandle); + EXPECT_EQ(DebugSessionLinuxi915::invalidClientHandle, session->clientHandle); EXPECT_EQ(0, handler->ioctlCalled); EXPECT_EQ(0u, session->apiEvents.size()); @@ -826,12 +826,12 @@ TEST_F(DebugApiLinuxTest, GivenUuidCommandQueueCreatedHandledThenProcessEntryEve EXPECT_EQ(2, handler->ioctlCalled); EXPECT_EQ(0u, session->apiEvents.size()); - session->clientHandle = DebugSessionLinux::invalidClientHandle; - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; handler->returnUuid = &readUuid; session->handleEvent(&uuid.base); EXPECT_EQ(1u, session->apiEvents.size()); - EXPECT_EQ(MockDebugSessionLinux::mockClientHandle, session->clientHandle); + EXPECT_EQ(MockDebugSessionLinuxi915::mockClientHandle, session->clientHandle); EXPECT_EQ(3, handler->ioctlCalled); EXPECT_EQ(0u, session->uuidL0CommandQueueHandleToDevice[2]); @@ -839,12 +839,12 @@ TEST_F(DebugApiLinuxTest, GivenUuidCommandQueueCreatedHandledThenProcessEntryEve auto event = session->apiEvents.front(); EXPECT_EQ(ZET_DEBUG_EVENT_TYPE_PROCESS_ENTRY, event.type); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; handler->returnUuid = &readUuid; session->handleEvent(&uuid.base); EXPECT_EQ(1u, session->apiEvents.size()); - EXPECT_EQ(MockDebugSessionLinux::mockClientHandle, session->clientHandle); + EXPECT_EQ(MockDebugSessionLinuxi915::mockClientHandle, session->clientHandle); EXPECT_EQ(4, handler->ioctlCalled); } @@ -852,15 +852,15 @@ TEST_F(DebugApiLinuxTest, GivenUuidCommandQueueWhenQueuesOnToSubdevicesCreatedAn zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; prelim_drm_i915_debug_event_uuid uuid = {}; uuid.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuid.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuid.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuid.handle = 2; uuid.payload_size = sizeof(NEO::DebuggerL0::CommandQueueNotification); @@ -929,9 +929,9 @@ TEST_F(DebugApiLinuxTest, GivenCommandQueueDestroyedWhenHandlingEventThenExitEve zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidHandle; + session->clientHandle = DebugSessionLinuxi915::invalidHandle; const uint64_t validUuidCmdQHandle = 5u; session->uuidL0CommandQueueHandleToDevice[validUuidCmdQHandle] = 0; @@ -944,7 +944,7 @@ TEST_F(DebugApiLinuxTest, GivenCommandQueueDestroyedWhenHandlingEventThenExitEve auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandleToConnection[10u].reset(new L0::DebugSessionLinux::ClientConnection); + session->clientHandleToConnection[10u].reset(new L0::DebugSessionLinuxi915::ClientConnection); session->handleEvent(&uuid.base); EXPECT_EQ(0u, session->apiEvents.size()); @@ -968,7 +968,7 @@ TEST_F(DebugApiLinuxTest, GivenDestroyClientForClientNotSavedWhenHandlingEventTh zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); session->clientHandle = 1; @@ -981,7 +981,7 @@ TEST_F(DebugApiLinuxTest, GivenDestroyClientForClientNotSavedWhenHandlingEventTh auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandleToConnection[10u].reset(new L0::DebugSessionLinux::ClientConnection); + session->clientHandleToConnection[10u].reset(new L0::DebugSessionLinuxi915::ClientConnection); session->handleEvent(&clientDestroy.base); EXPECT_EQ(0u, session->apiEvents.size()); @@ -992,8 +992,8 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenReadingEventThenResultNotReadyIsR config.pid = 0x1234; Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); - auto mockSession = new MockDebugSessionLinux(config, &deviceImp, 10); - mockSession->clientHandle = MockDebugSessionLinux::mockClientHandle; + auto mockSession = new MockDebugSessionLinuxi915(config, &deviceImp, 10); + mockSession->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; deviceImp.debugSession.reset(mockSession); zet_debug_session_handle_t session = deviceImp.debugSession->toHandle(); @@ -1084,7 +1084,7 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenClosingConnectionThenSysCallClose zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); EXPECT_NE(nullptr, session); @@ -1106,7 +1106,7 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenDestroyedThenSysCallCloseOnFdIsCa zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); EXPECT_NE(nullptr, session); NEO::SysCalls::closeFuncCalled = 0; @@ -1124,7 +1124,7 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWithFdEqualZeroWhenClosingConnectionT zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 0); + auto session = std::make_unique(config, device, 0); EXPECT_NE(nullptr, session); @@ -1149,7 +1149,7 @@ TEST_F(DebugApiLinuxTest, GivenPrintDebugMessagesWhenDebugSessionClosesConnectio ::testing::internal::CaptureStderr(); - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); EXPECT_NE(nullptr, session); @@ -1173,7 +1173,7 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenCallingIoctlThenIoctlHandlerIsInv zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); EXPECT_NE(nullptr, session); auto handler = new MockIoctlHandler; @@ -1187,7 +1187,7 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenIoctlFailsThenErrorIsReturned) { zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); EXPECT_NE(nullptr, session); auto ret = session->ioctl(-1, nullptr); @@ -1210,7 +1210,7 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenIoctlIsCalledThenItIsForwardedToS zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); EXPECT_NE(nullptr, session); auto ret = session->ioctl(10, nullptr); @@ -1221,18 +1221,18 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenCallingPollThenDefaultHandlerRedi zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); EXPECT_EQ(0, session->ioctlHandler->poll(nullptr, 0, 0)); } TEST_F(DebugApiLinuxTest, WhenCallingReadOrWriteGpuMemoryThenVmOpenIoctlIsCalled) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; for (int i = 0; i < 2; i++) { @@ -1250,7 +1250,7 @@ TEST_F(DebugApiLinuxTest, WhenCallingReadOrWriteGpuMemoryThenVmOpenIoctlIsCalled EXPECT_EQ(static_cast(PRELIM_I915_DEBUG_VM_OPEN_READ_WRITE), handler->vmOpen.flags); } - EXPECT_EQ(MockDebugSessionLinux::mockClientHandle, handler->vmOpen.client_handle); + EXPECT_EQ(MockDebugSessionLinuxi915::mockClientHandle, handler->vmOpen.client_handle); EXPECT_EQ(static_cast(7), handler->vmOpen.handle); EXPECT_EQ(0, retVal); @@ -1262,12 +1262,12 @@ TEST_F(DebugApiLinuxTest, WhenCallingReadOrWriteGpuMemoryThenVmOpenIoctlIsCalled } TEST_F(DebugApiLinuxTest, WhenCallingReadOrWriteGpuMemoryThenGpuAddressIsDecanonized) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; @@ -1287,12 +1287,12 @@ TEST_F(DebugApiLinuxTest, WhenCallingReadOrWriteGpuMemoryThenGpuAddressIsDecanon } TEST_F(DebugApiLinuxTest, WhenCallingReadGpuMemoryThenMemoryIsRead) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; @@ -1312,12 +1312,12 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerMmapMemoryAccessTrueWhenCallingReadGpuMem DebugManagerStateRestore restorer; NEO::DebugManager.flags.EnableDebuggerMmapMemoryAccess.set(true); - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; char output[bufferSize]; auto retVal = session->readGpuMemory(7, output, bufferSize, 0x23000); @@ -1336,12 +1336,12 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerMmapMemoryAccessFalseWhenCallingReadGpuMe DebugManagerStateRestore restorer; NEO::DebugManager.flags.EnableDebuggerMmapMemoryAccess.set(false); - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; handler->preadRetVal = bufferSize; // 16 bytes to read @@ -1371,12 +1371,12 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerMmapMemoryAccessFalseWhenPreadFailsThenEr DebugManagerStateRestore restorer; NEO::DebugManager.flags.EnableDebuggerMmapMemoryAccess.set(false); - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; handler->preadRetVal = -1; // fail @@ -1400,12 +1400,12 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerMmapMemoryAccessFalseWhenPreadFailsThenEr } TEST_F(DebugApiLinuxTest, WhenCallingWriteGpuMemoryThenMemoryIsWritten) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; @@ -1422,12 +1422,12 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerMmapMemoryAccessTrueWhenCallingWriteGpuMe DebugManagerStateRestore restorer; NEO::DebugManager.flags.EnableDebuggerMmapMemoryAccess.set(true); - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; char buffer[bufferSize]; memset(buffer, 'O', bufferSize); @@ -1442,12 +1442,12 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerMmapMemoryAccessFalseWhenCallingWriteGpuM DebugManagerStateRestore restorer; NEO::DebugManager.flags.EnableDebuggerMmapMemoryAccess.set(false); - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; handler->pwriteRetVal = bufferSize; @@ -1474,12 +1474,12 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerMmapMemoryAccessTrueWhenMmapFailesThenRea DebugManagerStateRestore restorer; NEO::DebugManager.flags.EnableDebuggerMmapMemoryAccess.set(true); - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; handler->mmapFail = true; char buffer[bufferSize]; @@ -1496,12 +1496,12 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerMmapMemoryAccessFalseWhenWhenPwriteFailsT DebugManagerStateRestore restorer; NEO::DebugManager.flags.EnableDebuggerMmapMemoryAccess.set(false); - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; handler->pwriteRetVal = -1; // fail @@ -1523,11 +1523,11 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerMmapMemoryAccessFalseWhenWhenPwriteFailsT } TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryForISAThenMemoryIsRead) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; ze_device_thread_t thread; thread.slice = UINT32_MAX; @@ -1546,10 +1546,10 @@ TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryForISAThenMemoryIsRead) { uint64_t isaGpuVa = 0x345000; uint64_t isaSize = 0x2000; - auto isa = std::make_unique(); + auto isa = std::make_unique(); isa->bindInfo = {isaGpuVa, isaSize}; isa->vmHandle = 3; - isa->elfUuidHandle = DebugSessionLinux::invalidHandle; + isa->elfUuidHandle = DebugSessionLinuxi915::invalidHandle; isa->moduleBegin = 0; isa->moduleEnd = 0; @@ -1580,18 +1580,18 @@ TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryForISAThenMemoryIsRead) { } TEST_F(DebugApiLinuxTest, GivenCanonizedAddressWhenGettingIsaVmHandleThenCorrectVmIsReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; const uint64_t isaGpuVa = device->getHwInfo().capabilityTable.gpuAddressSpace - 0x3000; const uint64_t isaSize = 0x2000; auto gmmHelper = neoDevice->getGmmHelper(); - auto isa = std::make_unique(); + auto isa = std::make_unique(); isa->bindInfo = {isaGpuVa, isaSize}; isa->vmHandle = 3; - isa->elfUuidHandle = DebugSessionLinux::invalidHandle; + isa->elfUuidHandle = DebugSessionLinuxi915::invalidHandle; isa->moduleBegin = 0; isa->moduleEnd = 0; @@ -1614,11 +1614,11 @@ TEST_F(DebugApiLinuxTest, GivenCanonizedAddressWhenGettingIsaVmHandleThenCorrect } TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryForELFThenMemoryIsRead) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; ze_device_thread_t thread; thread.slice = UINT32_MAX; @@ -1667,11 +1667,11 @@ TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryForELFThenMemoryIsRead) { } TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryforAllThreadsOnDefaultMemoryThenMemoryIsRead) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; ze_device_thread_t thread; thread.slice = UINT32_MAX; @@ -1703,11 +1703,11 @@ TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryforAllThreadsOnDefaultMemoryThenM } TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryforASingleThreadThenMemoryIsRead) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; @@ -1743,11 +1743,11 @@ TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryforASingleThreadThenMemoryIsRead) } TEST_F(DebugApiLinuxTest, GivenInvalidAddressWhenCallingReadMemoryThenErrorIsReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; @@ -1775,20 +1775,20 @@ TEST_F(DebugApiLinuxTest, GivenInvalidAddressWhenCallingReadMemoryThenErrorIsRet } TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryForISAForExpectedFailureCasesThenErrorIsReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto &isaMap = session->clientHandleToConnection[session->clientHandle]->isaMap[0]; uint64_t isaGpuVa = 0x345000; uint64_t isaSize = 0x2000; - auto isa = std::make_unique(); + auto isa = std::make_unique(); isa->bindInfo = {isaGpuVa, isaSize}; isa->vmHandle = 3; - isa->elfUuidHandle = DebugSessionLinux::invalidHandle; + isa->elfUuidHandle = DebugSessionLinuxi915::invalidHandle; isa->moduleBegin = 0; isa->moduleEnd = 0; isaMap[isaGpuVa] = std::move(isa); @@ -1873,11 +1873,11 @@ TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryForISAForExpectedFailureCasesThen } TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryForElfForExpectedFailureCasesThenErrorIsReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; ze_device_thread_t thread; thread.slice = UINT32_MAX; @@ -1912,11 +1912,11 @@ TEST_F(DebugApiLinuxTest, WhenCallingReadMemoryForElfForExpectedFailureCasesThen EXPECT_EQ(ZE_RESULT_ERROR_INVALID_ARGUMENT, retVal); } TEST_F(DebugApiLinuxTest, WhenCallingWriteMemoryForISAThenMemoryIsWritten) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; ze_device_thread_t thread; thread.slice = UINT32_MAX; @@ -1935,10 +1935,10 @@ TEST_F(DebugApiLinuxTest, WhenCallingWriteMemoryForISAThenMemoryIsWritten) { uint64_t isaGpuVa = 0x345000; uint64_t isaSize = 0x2000; - auto isa = std::make_unique(); + auto isa = std::make_unique(); isa->bindInfo = {isaGpuVa, isaSize}; isa->vmHandle = 3; - isa->elfUuidHandle = DebugSessionLinux::invalidHandle; + isa->elfUuidHandle = DebugSessionLinuxi915::invalidHandle; isa->moduleBegin = 0; isa->moduleEnd = 0; @@ -1967,11 +1967,11 @@ TEST_F(DebugApiLinuxTest, WhenCallingWriteMemoryForISAThenMemoryIsWritten) { } TEST_F(DebugApiLinuxTest, WhenCallingWriteMemoryForAllThreadsOnDefaultMemoryThenMemoryIsWritten) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; ze_device_thread_t thread; thread.slice = UINT32_MAX; @@ -2004,21 +2004,21 @@ TEST_F(DebugApiLinuxTest, WhenCallingWriteMemoryForAllThreadsOnDefaultMemoryThen } TEST_F(DebugApiLinuxTest, WhenCallingWriteMemoryForASignleThreadThenMemoryIsWritten) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; prelim_drm_i915_debug_event_vm vmEvent = {}; vmEvent.base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM; vmEvent.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmEvent.base.size = sizeof(prelim_drm_i915_debug_event_vm); - vmEvent.client_handle = MockDebugSessionLinux::mockClientHandle; + vmEvent.client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmEvent.handle = 4; session->handleEvent(&vmEvent.base); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmIds.size()); session->allThreadsStopped = true; @@ -2049,11 +2049,11 @@ TEST_F(DebugApiLinuxTest, WhenCallingWriteMemoryForASignleThreadThenMemoryIsWrit } TEST_F(DebugApiLinuxTest, GivenInvalidAddressWhenCallingWriteMemoryThenErrorIsReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; @@ -2078,20 +2078,20 @@ TEST_F(DebugApiLinuxTest, GivenInvalidAddressWhenCallingWriteMemoryThenErrorIsRe } TEST_F(DebugApiLinuxTest, WhenCallingWriteMemoryForExpectedFailureCasesThenErrorIsReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto &isaMap = session->clientHandleToConnection[session->clientHandle]->isaMap[0]; uint64_t isaGpuVa = 0x345000; uint64_t isaSize = 0x2000; - auto isa = std::make_unique(); + auto isa = std::make_unique(); isa->bindInfo = {isaGpuVa, isaSize}; isa->vmHandle = 3; - isa->elfUuidHandle = DebugSessionLinux::invalidHandle; + isa->elfUuidHandle = DebugSessionLinuxi915::invalidHandle; isa->moduleBegin = 0; isa->moduleEnd = 0; isaMap[isaGpuVa] = std::move(isa); @@ -2171,19 +2171,19 @@ TEST_F(DebugApiLinuxTest, WhenCallingWriteMemoryForExpectedFailureCasesThenError } TEST_F(DebugApiLinuxTest, GivenErrorFromVmOpenWhenCallingReadGpuMemoryThenCloseIsNotCalledAndErrorReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; handler->vmOpenRetVal = -30; char output[bufferSize]; auto retVal = session->readGpuMemory(7, output, bufferSize, 0x23000); - EXPECT_EQ(MockDebugSessionLinux::mockClientHandle, handler->vmOpen.client_handle); + EXPECT_EQ(MockDebugSessionLinuxi915::mockClientHandle, handler->vmOpen.client_handle); EXPECT_EQ(static_cast(7), handler->vmOpen.handle); EXPECT_EQ(static_cast(PRELIM_I915_DEBUG_VM_OPEN_READ_ONLY), handler->vmOpen.flags); @@ -2192,12 +2192,12 @@ TEST_F(DebugApiLinuxTest, GivenErrorFromVmOpenWhenCallingReadGpuMemoryThenCloseI } TEST_F(DebugApiLinuxTest, GivenErrorFromVmOpenWhenCallingWriteGpuMemoryThenCloseIsNotCalledAndErrorReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; handler->vmOpenRetVal = -30; @@ -2209,12 +2209,12 @@ TEST_F(DebugApiLinuxTest, GivenErrorFromVmOpenWhenCallingWriteGpuMemoryThenClose } TEST_F(DebugApiLinuxTest, GivenErrorFromMmapWhenCallingReadGpuMemoryThenCloseIsCalledAndErrnoErrorIsReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; errno = EACCES; @@ -2222,18 +2222,18 @@ TEST_F(DebugApiLinuxTest, GivenErrorFromMmapWhenCallingReadGpuMemoryThenCloseIsC char output[bufferSize]; auto retVal = session->readGpuMemory(7, output, bufferSize, 0x23000); - EXPECT_EQ(MockDebugSessionLinux::mockClientHandle, handler->vmOpen.client_handle); + EXPECT_EQ(MockDebugSessionLinuxi915::mockClientHandle, handler->vmOpen.client_handle); EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, retVal); EXPECT_EQ(1u, NEO::SysCalls::closeFuncCalled); } TEST_F(DebugApiLinuxTest, GivenErrorFromMmapWhenCallingWriteGpuMemoryThenCloseIsCalledAndErrnoErrorIsReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; NEO::SysCalls::closeFuncCalled = 0; errno = EACCES; @@ -2241,7 +2241,7 @@ TEST_F(DebugApiLinuxTest, GivenErrorFromMmapWhenCallingWriteGpuMemoryThenCloseIs char buffer[bufferSize]; auto retVal = session->writeGpuMemory(7, buffer, bufferSize, 0x23000); - EXPECT_EQ(MockDebugSessionLinux::mockClientHandle, handler->vmOpen.client_handle); + EXPECT_EQ(MockDebugSessionLinuxi915::mockClientHandle, handler->vmOpen.client_handle); EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, retVal); EXPECT_EQ(1u, NEO::SysCalls::closeFuncCalled); @@ -2267,7 +2267,7 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenPollReturnsZeroThenNotReadyIsRetu mockDrm->baseErrno = false; mockDrm->errnoRetVal = 0; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; @@ -2287,7 +2287,7 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenInternalEventsThreadIsNotStartedO mockDrm->baseErrno = false; mockDrm->errnoRetVal = 0; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; @@ -2313,13 +2313,13 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenClientHandleIsInvalidDuringInitia zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; handler->debugEventRetVal = -1; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::invalidClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::invalidClientHandle; ze_result_t result = session->initialize(); EXPECT_EQ(ZE_RESULT_NOT_READY, result); @@ -2335,7 +2335,7 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerLogsWhenReadEventFailsDuringInitializatio ::testing::internal::CaptureStderr(); - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; @@ -2362,15 +2362,15 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerLogsWhenReadEventFailsDuringInitializatio } TEST_F(DebugApiLinuxTest, GivenBindInfoForVmHandleWhenReadingModuleDebugAreaThenGpuMemoryIsRead) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t vmHandle = 6; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToModuleDebugAreaBindInfo[vmHandle] = {0x1234000, 0x1000}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToModuleDebugAreaBindInfo[vmHandle] = {0x1234000, 0x1000}; DebugAreaHeader debugArea; debugArea.reserved1 = 1; @@ -2391,7 +2391,7 @@ TEST_F(DebugApiLinuxTest, GivenBindInfoForVmHandleWhenReadingModuleDebugAreaThen } else { EXPECT_EQ(1, handler->preadCalled); } - EXPECT_EQ(MockDebugSessionLinux::mockClientHandle, handler->vmOpen.client_handle); + EXPECT_EQ(MockDebugSessionLinuxi915::mockClientHandle, handler->vmOpen.client_handle); EXPECT_EQ(vmHandle, handler->vmOpen.handle); EXPECT_EQ(static_cast(PRELIM_I915_DEBUG_VM_OPEN_READ_ONLY), handler->vmOpen.flags); @@ -2401,15 +2401,15 @@ TEST_F(DebugApiLinuxTest, GivenBindInfoForVmHandleWhenReadingModuleDebugAreaThen } TEST_F(DebugApiLinuxTest, GivenBindInfoForVmHandleWhenReadingModuleDebugAreaReturnsIncorrectDataThenFailIsReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t vmHandle = 6; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToModuleDebugAreaBindInfo[vmHandle] = {0x1234000, 0x1000}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToModuleDebugAreaBindInfo[vmHandle] = {0x1234000, 0x1000}; std::vector dummy; dummy.resize(sizeof(DebugAreaHeader)); @@ -2432,7 +2432,7 @@ TEST_F(DebugApiLinuxTest, GivenBindInfoForVmHandleWhenReadingModuleDebugAreaRetu } TEST_F(DebugApiLinuxTest, GivenBindInfoForVmHandleWhenReadingStateSaveAreaThenGpuMemoryIsRead) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; @@ -2442,10 +2442,10 @@ TEST_F(DebugApiLinuxTest, GivenBindInfoForVmHandleWhenReadingStateSaveAreaThenGp handler->setPreadMemory(stateSaveAreaHeader.data(), stateSaveAreaHeader.size(), 0x1000); session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t vmHandle = 6; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {0x1000, sizeof(SIP::StateSaveAreaHeader)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {0x1000, sizeof(SIP::StateSaveAreaHeader)}; session->readStateSaveAreaHeader(); @@ -2455,13 +2455,13 @@ TEST_F(DebugApiLinuxTest, GivenBindInfoForVmHandleWhenReadingStateSaveAreaThenGp } else { EXPECT_EQ(1, handler->preadCalled); } - EXPECT_EQ(MockDebugSessionLinux::mockClientHandle, handler->vmOpen.client_handle); + EXPECT_EQ(MockDebugSessionLinuxi915::mockClientHandle, handler->vmOpen.client_handle); EXPECT_EQ(vmHandle, handler->vmOpen.handle); EXPECT_EQ(static_cast(PRELIM_I915_DEBUG_VM_OPEN_READ_ONLY), handler->vmOpen.flags); } TEST_F(DebugApiLinuxTest, GivenSizeTooSmallWhenReadingStateSaveAreThenMemoryIsNotRead) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; @@ -2469,12 +2469,12 @@ TEST_F(DebugApiLinuxTest, GivenSizeTooSmallWhenReadingStateSaveAreThenMemoryIsNo handler->mmapRet = stateSaveAreaHeader.data(); session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; handler->vmOpen.handle = 0u; handler->vmOpen.flags = 0u; uint64_t vmHandle = 6; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {0x1000, sizeof(SIP::StateSaveAreaHeader) - 4}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {0x1000, sizeof(SIP::StateSaveAreaHeader) - 4}; session->readStateSaveAreaHeader(); @@ -2486,16 +2486,16 @@ TEST_F(DebugApiLinuxTest, GivenSizeTooSmallWhenReadingStateSaveAreThenMemoryIsNo } TEST_F(DebugApiLinuxTest, GivenErrorInVmOpenWhenReadingModuleDebugAreaThenGpuMemoryIsNotReadAndFalseReturned) { - auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); + auto session = std::make_unique(zet_debug_config_t{0x1234}, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; handler->vmOpenRetVal = -19; uint64_t vmHandle = 6; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToModuleDebugAreaBindInfo[vmHandle] = {0x1234000, 0x1000}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToModuleDebugAreaBindInfo[vmHandle] = {0x1234000, 0x1000}; DebugAreaHeader debugArea; debugArea.reserved1 = 1; @@ -2515,7 +2515,7 @@ TEST_F(DebugApiLinuxTest, GivenInOrderClientVmContextUuidAndModuleDebugAreaEvent zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); session->synchronousInternalEventRead = true; @@ -2533,7 +2533,7 @@ TEST_F(DebugApiLinuxTest, GivenInOrderClientVmContextUuidAndModuleDebugAreaEvent vm->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM; vm->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vm->base.size = sizeof(prelim_drm_i915_debug_event_vm); - vm->client_handle = MockDebugSessionLinux::mockClientHandle; + vm->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vm->handle = vmId; prelim_drm_i915_debug_event_context context = {}; @@ -2541,14 +2541,14 @@ TEST_F(DebugApiLinuxTest, GivenInOrderClientVmContextUuidAndModuleDebugAreaEvent context.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT; context.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; context.base.size = sizeof(prelim_drm_i915_debug_event_context); - context.client_handle = MockDebugSessionLinux::mockClientHandle; + context.client_handle = MockDebugSessionLinuxi915::mockClientHandle; context.handle = 3; prelim_drm_i915_debug_event_context_param contextParamEvent = {}; contextParamEvent.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; contextParamEvent.base.size = sizeof(prelim_drm_i915_debug_event_context_param); - contextParamEvent.client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent.client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent.ctx_handle = context.handle; contextParamEvent.param = {.ctx_id = static_cast(context.handle), .size = 8, .param = I915_CONTEXT_PARAM_VM, .value = vmId}; @@ -2559,7 +2559,7 @@ TEST_F(DebugApiLinuxTest, GivenInOrderClientVmContextUuidAndModuleDebugAreaEvent contextParamEvent2->base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent2->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; contextParamEvent2->base.size = size; - contextParamEvent2->client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent2->client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent2->ctx_handle = context.handle; auto offset = offsetof(prelim_drm_i915_debug_event_context_param, param); @@ -2589,13 +2589,13 @@ TEST_F(DebugApiLinuxTest, GivenInOrderClientVmContextUuidAndModuleDebugAreaEvent uuid.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuid.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuid.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuid.handle = 2; uuid.class_handle = PRELIM_I915_UUID_CLASS_STRING; uuid.payload_size = uuidNameSize; prelim_drm_i915_debug_read_uuid readUuid = {}; - readUuid.client_handle = MockDebugSessionLinux::mockClientHandle; + readUuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; memcpy(readUuid.uuid, uuidHash.data(), uuidHash.size()); readUuid.payload_ptr = reinterpret_cast(uuidName); readUuid.payload_size = uuid.payload_size; @@ -2606,7 +2606,7 @@ TEST_F(DebugApiLinuxTest, GivenInOrderClientVmContextUuidAndModuleDebugAreaEvent uuidDebugArea.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuidDebugArea.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuidDebugArea.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuidDebugArea.client_handle = MockDebugSessionLinux::mockClientHandle; + uuidDebugArea.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuidDebugArea.handle = 3; uuidDebugArea.class_handle = 2; @@ -2617,7 +2617,7 @@ TEST_F(DebugApiLinuxTest, GivenInOrderClientVmContextUuidAndModuleDebugAreaEvent vmBindDebugArea->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindDebugArea->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindDebugArea->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + sizeof(typeOfUUID); - vmBindDebugArea->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindDebugArea->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindDebugArea->va_start = moduleDebugAddress; vmBindDebugArea->va_length = 0x1000; vmBindDebugArea->vm_handle = vmId; @@ -2666,7 +2666,7 @@ TEST_F(DebugApiLinuxTest, GivenOutOfOrderClientVmContextUuidAndModuleDebugAreaEv zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); session->synchronousInternalEventRead = true; @@ -2684,7 +2684,7 @@ TEST_F(DebugApiLinuxTest, GivenOutOfOrderClientVmContextUuidAndModuleDebugAreaEv vm->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM; vm->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vm->base.size = sizeof(prelim_drm_i915_debug_event_vm); - vm->client_handle = MockDebugSessionLinux::mockClientHandle; + vm->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vm->handle = vmId; prelim_drm_i915_debug_event_context context = {}; @@ -2692,14 +2692,14 @@ TEST_F(DebugApiLinuxTest, GivenOutOfOrderClientVmContextUuidAndModuleDebugAreaEv context.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT; context.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; context.base.size = sizeof(prelim_drm_i915_debug_event_context); - context.client_handle = MockDebugSessionLinux::mockClientHandle; + context.client_handle = MockDebugSessionLinuxi915::mockClientHandle; context.handle = 3; prelim_drm_i915_debug_event_context_param contextParamEvent = {}; contextParamEvent.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; contextParamEvent.base.size = sizeof(prelim_drm_i915_debug_event_context_param); - contextParamEvent.client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent.client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent.ctx_handle = context.handle; contextParamEvent.param = {.ctx_id = static_cast(context.handle), .size = 8, .param = I915_CONTEXT_PARAM_VM, .value = vmId}; @@ -2710,7 +2710,7 @@ TEST_F(DebugApiLinuxTest, GivenOutOfOrderClientVmContextUuidAndModuleDebugAreaEv contextParamEvent2->base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent2->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; contextParamEvent2->base.size = size; - contextParamEvent2->client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent2->client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent2->ctx_handle = context.handle; auto offset = offsetof(prelim_drm_i915_debug_event_context_param, param); @@ -2740,13 +2740,13 @@ TEST_F(DebugApiLinuxTest, GivenOutOfOrderClientVmContextUuidAndModuleDebugAreaEv uuid.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuid.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuid.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuid.handle = 2; uuid.class_handle = PRELIM_I915_UUID_CLASS_STRING; uuid.payload_size = uuidNameSize; prelim_drm_i915_debug_read_uuid readUuid = {}; - readUuid.client_handle = MockDebugSessionLinux::mockClientHandle; + readUuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; memcpy(readUuid.uuid, uuidHash.data(), uuidHash.size()); readUuid.payload_ptr = reinterpret_cast(uuidName); readUuid.payload_size = uuid.payload_size; @@ -2757,7 +2757,7 @@ TEST_F(DebugApiLinuxTest, GivenOutOfOrderClientVmContextUuidAndModuleDebugAreaEv uuidDebugArea.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuidDebugArea.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuidDebugArea.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuidDebugArea.client_handle = MockDebugSessionLinux::mockClientHandle; + uuidDebugArea.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuidDebugArea.handle = 3; uuidDebugArea.class_handle = 2; @@ -2768,7 +2768,7 @@ TEST_F(DebugApiLinuxTest, GivenOutOfOrderClientVmContextUuidAndModuleDebugAreaEv vmBindDebugArea->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindDebugArea->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindDebugArea->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + sizeof(typeOfUUID); - vmBindDebugArea->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindDebugArea->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindDebugArea->va_start = moduleDebugAddress; vmBindDebugArea->va_length = 0x1000; vmBindDebugArea->vm_handle = vmId; @@ -2820,7 +2820,7 @@ TEST_F(DebugApiLinuxTest, GivenAllNecessaryEventsWhenIncorrectModuleDebugAreaRea zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); session->synchronousInternalEventRead = true; @@ -2839,7 +2839,7 @@ TEST_F(DebugApiLinuxTest, GivenAllNecessaryEventsWhenIncorrectModuleDebugAreaRea vm->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM; vm->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vm->base.size = sizeof(prelim_drm_i915_debug_event_vm); - vm->client_handle = MockDebugSessionLinux::mockClientHandle; + vm->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vm->handle = vmId; prelim_drm_i915_debug_event_context context = {}; @@ -2847,14 +2847,14 @@ TEST_F(DebugApiLinuxTest, GivenAllNecessaryEventsWhenIncorrectModuleDebugAreaRea context.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT; context.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; context.base.size = sizeof(prelim_drm_i915_debug_event_context); - context.client_handle = MockDebugSessionLinux::mockClientHandle; + context.client_handle = MockDebugSessionLinuxi915::mockClientHandle; context.handle = 3; prelim_drm_i915_debug_event_context_param contextParamEvent = {}; contextParamEvent.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; contextParamEvent.base.size = sizeof(prelim_drm_i915_debug_event_context_param); - contextParamEvent.client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent.client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent.ctx_handle = context.handle; contextParamEvent.param = {.ctx_id = static_cast(context.handle), .size = 8, .param = I915_CONTEXT_PARAM_VM, .value = vmId}; @@ -2865,7 +2865,7 @@ TEST_F(DebugApiLinuxTest, GivenAllNecessaryEventsWhenIncorrectModuleDebugAreaRea contextParamEvent2->base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent2->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; contextParamEvent2->base.size = size; - contextParamEvent2->client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent2->client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent2->ctx_handle = context.handle; auto offset = offsetof(prelim_drm_i915_debug_event_context_param, param); @@ -2895,13 +2895,13 @@ TEST_F(DebugApiLinuxTest, GivenAllNecessaryEventsWhenIncorrectModuleDebugAreaRea uuid.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuid.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuid.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuid.handle = 2; uuid.class_handle = PRELIM_I915_UUID_CLASS_STRING; uuid.payload_size = uuidNameSize; prelim_drm_i915_debug_read_uuid readUuid = {}; - readUuid.client_handle = MockDebugSessionLinux::mockClientHandle; + readUuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; memcpy(readUuid.uuid, uuidHash.data(), uuidHash.size()); readUuid.payload_ptr = reinterpret_cast(uuidName); readUuid.payload_size = uuid.payload_size; @@ -2912,7 +2912,7 @@ TEST_F(DebugApiLinuxTest, GivenAllNecessaryEventsWhenIncorrectModuleDebugAreaRea uuidDebugArea.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuidDebugArea.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuidDebugArea.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuidDebugArea.client_handle = MockDebugSessionLinux::mockClientHandle; + uuidDebugArea.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuidDebugArea.handle = 3; uuidDebugArea.class_handle = 2; @@ -2923,7 +2923,7 @@ TEST_F(DebugApiLinuxTest, GivenAllNecessaryEventsWhenIncorrectModuleDebugAreaRea vmBindDebugArea->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindDebugArea->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindDebugArea->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + sizeof(typeOfUUID); - vmBindDebugArea->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindDebugArea->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindDebugArea->va_start = moduleDebugAddress; vmBindDebugArea->va_length = 0x1000; vmBindDebugArea->vm_handle = vmId; @@ -2946,7 +2946,7 @@ TEST_F(DebugApiLinuxTest, GivenAllNecessaryEventsWhenIncorrectModuleDebugAreaRea handler->pollRetVal = 1; session->ioctlHandler.reset(handler); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[0] = 0; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[0] = 0; session->synchronousInternalEventRead = true; ze_result_t result = session->initialize(); @@ -2958,9 +2958,9 @@ TEST_F(DebugApiLinuxTest, GivenNoClientHandleSetWhenCheckingEventsCollectedThenF zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::invalidClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::invalidClientHandle; EXPECT_FALSE(session->checkAllEventsCollected()); } @@ -2969,9 +2969,9 @@ TEST_F(DebugApiLinuxTest, GivenClientHandleSetButNoModuleDebugAreaWhenCheckingEv zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; EXPECT_FALSE(session->checkAllEventsCollected()); } @@ -2980,7 +2980,7 @@ TEST_F(DebugApiLinuxTest, GivenTwoClientEventsWithTheSameHandleWhenInitializingT zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); const uint64_t clientHandle = 2; session->synchronousInternalEventRead = true; @@ -3015,7 +3015,7 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionWhenClientCreateAndDestroyEventsReadO zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); prelim_drm_i915_debug_event_client clientCreate = {}; @@ -3048,7 +3048,7 @@ TEST_F(DebugApiLinuxTest, GivenEventWithInvalidFlagsWhenReadingEventThenUnknownE zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); prelim_drm_i915_debug_event_client clientInvalidFlag = {}; @@ -3064,11 +3064,11 @@ TEST_F(DebugApiLinuxTest, GivenEventWithInvalidFlagsWhenReadingEventThenUnknownE session->ioctlHandler.reset(handler); - auto memory = std::make_unique(MockDebugSessionLinux::maxEventSize / sizeof(uint64_t)); + auto memory = std::make_unique(MockDebugSessionLinuxi915::maxEventSize / sizeof(uint64_t)); prelim_drm_i915_debug_event *event = reinterpret_cast(memory.get()); event->type = PRELIM_DRM_I915_DEBUG_EVENT_READ; event->flags = 0x8000; - event->size = MockDebugSessionLinux::maxEventSize; + event->size = MockDebugSessionLinuxi915::maxEventSize; ze_result_t result = session->readEventImp(event); EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, result); @@ -3079,7 +3079,7 @@ TEST_F(DebugApiLinuxTest, GivenDebugSessionInitializationWhenNoValidEventsAreRea zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); prelim_drm_i915_debug_event_client clientInvalidFlag = {}; @@ -3102,22 +3102,22 @@ TEST_F(DebugApiLinuxTest, GivenValidFlagsWhenReadingEventThenEventIsNotProcessed zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); uint64_t ctxHandle = 2; uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; prelim_drm_i915_debug_event_eu_attention attEvent = {}; attEvent.base.type = PRELIM_DRM_I915_DEBUG_EVENT_EU_ATTENTION; attEvent.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attEvent.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention); attEvent.bitmask_size = 0; - attEvent.client_handle = MockDebugSessionLinux::mockClientHandle; + attEvent.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attEvent.lrc_handle = lrcHandle; attEvent.flags = 0; @@ -3141,7 +3141,7 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerLogsAndUnhandledEventTypeWhenHandlingEven zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); prelim_drm_i915_debug_event event = {}; @@ -3173,7 +3173,7 @@ TEST_F(DebugApiLinuxTest, GivenContextCreateAndDestroyEventsWhenInitializingThen zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); uint64_t clientHandle = 2; @@ -3226,7 +3226,7 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventForClassWhenHandlingEventThenClassHandle zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto uuidName = NEO::classNamesToUuid[0].first; @@ -3265,9 +3265,9 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventWithPayloadWhenHandlingEventThenReadEven zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); @@ -3278,7 +3278,7 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventWithPayloadWhenHandlingEventThenReadEven uuidElf.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuidElf.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuidElf.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuidElf.client_handle = MockDebugSessionLinux::mockClientHandle; + uuidElf.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuidElf.handle = 3; uuidElf.class_handle = 2; @@ -3292,17 +3292,17 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventWithPayloadWhenHandlingEventThenReadEven handler->returnUuid = &readUuidElf; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[2] = {"ELF", static_cast(NEO::DrmResourceClass::Elf)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[2] = {"ELF", static_cast(NEO::DrmResourceClass::Elf)}; session->handleEvent(&uuidElf.base); - EXPECT_EQ(uuidElf.handle, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuidElf.handle].handle); - EXPECT_EQ(uuidElf.class_handle, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuidElf.handle].classHandle); - EXPECT_NE(nullptr, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuidElf.handle].data); - EXPECT_EQ(elf.size(), session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuidElf.handle].dataSize); - EXPECT_EQ(0x55742d6ea000u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuidElf.handle].ptr); + EXPECT_EQ(uuidElf.handle, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuidElf.handle].handle); + EXPECT_EQ(uuidElf.class_handle, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuidElf.handle].classHandle); + EXPECT_NE(nullptr, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuidElf.handle].data); + EXPECT_EQ(elf.size(), session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuidElf.handle].dataSize); + EXPECT_EQ(0x55742d6ea000u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuidElf.handle].ptr); - std::string registeredElf(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuidElf.handle].data.get(), session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuidElf.handle].dataSize); + std::string registeredElf(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuidElf.handle].data.get(), session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuidElf.handle].dataSize); EXPECT_EQ(elf, registeredElf); EXPECT_EQ(1, handler->ioctlCalled); @@ -3312,16 +3312,16 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventWhenHandlingThenUuidIsInsertedToMap) { zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; prelim_drm_i915_debug_event_uuid uuid = {}; uuid.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuid.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuid.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuid.handle = 2; uuid.payload_size = 0; @@ -3344,9 +3344,9 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventForL0ZebinModuleWhenHandlingEventThenKer zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); @@ -3357,7 +3357,7 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventForL0ZebinModuleWhenHandlingEventThenKer l0ModuleUuid.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; l0ModuleUuid.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; l0ModuleUuid.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - l0ModuleUuid.client_handle = MockDebugSessionLinux::mockClientHandle; + l0ModuleUuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; l0ModuleUuid.handle = 3; l0ModuleUuid.class_handle = 2; @@ -3371,41 +3371,41 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventForL0ZebinModuleWhenHandlingEventThenKer handler->returnUuid = &readUuidElf; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[2] = {"L0_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[2] = {"L0_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; session->handleEvent(&l0ModuleUuid.base); - EXPECT_NE(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.end(), - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.find(l0ModuleUuid.handle)); + EXPECT_NE(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.end(), + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.find(l0ModuleUuid.handle)); - EXPECT_EQ(kernelCount, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[l0ModuleUuid.handle].segmentCount); + EXPECT_EQ(kernelCount, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[l0ModuleUuid.handle].segmentCount); - EXPECT_EQ(l0ModuleUuid.handle, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[l0ModuleUuid.handle].handle); - EXPECT_EQ(l0ModuleUuid.class_handle, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[l0ModuleUuid.handle].classHandle); - EXPECT_NE(nullptr, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[l0ModuleUuid.handle].data); - EXPECT_EQ(sizeof(kernelCount), session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[l0ModuleUuid.handle].dataSize); + EXPECT_EQ(l0ModuleUuid.handle, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[l0ModuleUuid.handle].handle); + EXPECT_EQ(l0ModuleUuid.class_handle, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[l0ModuleUuid.handle].classHandle); + EXPECT_NE(nullptr, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[l0ModuleUuid.handle].data); + EXPECT_EQ(sizeof(kernelCount), session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[l0ModuleUuid.handle].dataSize); EXPECT_EQ(1, handler->ioctlCalled); // inject module segment - auto &module = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[l0ModuleUuid.handle]; + auto &module = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[l0ModuleUuid.handle]; module.loadAddresses[0].insert(0x12340000); l0ModuleUuid.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_DESTROY; l0ModuleUuid.payload_size = 0; session->handleEvent(&l0ModuleUuid.base); - EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.end(), - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.find(l0ModuleUuid.handle)); + EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.end(), + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.find(l0ModuleUuid.handle)); } TEST_F(DebugApiLinuxTest, GivenUuidEventWithNonElfClassHandleWhenHandlingEventThenUuidDataPtrIsNotSet) { zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); @@ -3416,7 +3416,7 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventWithNonElfClassHandleWhenHandlingEventTh uuidElf.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuidElf.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuidElf.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuidElf.client_handle = MockDebugSessionLinux::mockClientHandle; + uuidElf.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuidElf.handle = 3; uuidElf.class_handle = 2; @@ -3429,11 +3429,11 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventWithNonElfClassHandleWhenHandlingEventTh readUuidElf.handle = 3; handler->returnUuid = &readUuidElf; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex.erase(2); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex.erase(2); session->handleEvent(&uuidElf.base); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuidElf.handle].ptr); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuidElf.handle].ptr); EXPECT_EQ(1, handler->ioctlCalled); } @@ -3441,9 +3441,9 @@ TEST_F(DebugApiLinuxTest, GivenVmBindEventWithUnknownUUIDWhenHandlingEventThenEv zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); @@ -3452,7 +3452,7 @@ TEST_F(DebugApiLinuxTest, GivenVmBindEventWithUnknownUUIDWhenHandlingEventThenEv uint64_t sbaHandle = 4; uint64_t sbaAddress = 0x1234000; - DebugSessionLinux::UuidData sbaUuidData = { + DebugSessionLinuxi915::UuidData sbaUuidData = { .handle = sbaHandle, .classHandle = sbaClassHandle, .classIndex = NEO::DrmResourceClass::SbaTrackingBuffer}; @@ -3463,7 +3463,7 @@ TEST_F(DebugApiLinuxTest, GivenVmBindEventWithUnknownUUIDWhenHandlingEventThenEv vmBindSba->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindSba->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindSba->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + sizeof(typeOfUUID); - vmBindSba->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindSba->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindSba->va_start = sbaAddress; vmBindSba->va_length = 0x1000; vmBindSba->vm_handle = 0; @@ -3474,19 +3474,19 @@ TEST_F(DebugApiLinuxTest, GivenVmBindEventWithUnknownUUIDWhenHandlingEventThenEv session->handleEvent(&vmBindSba->base); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToStateBaseAreaBindInfo.size()); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToModuleDebugAreaBindInfo.size()); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo.size()); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToStateBaseAreaBindInfo.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToModuleDebugAreaBindInfo.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.size()); } TEST_F(DebugApiLinuxTest, GivenVmBindEventWithUuidOfUnknownClassWhenHandlingEventThenNoBindInfoIsStored) { zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); @@ -3495,12 +3495,12 @@ TEST_F(DebugApiLinuxTest, GivenVmBindEventWithUuidOfUnknownClassWhenHandlingEven uint64_t sbaHandle = 4; uint64_t sbaAddress = 0x1234000; - DebugSessionLinux::UuidData sbaUuidData = { + DebugSessionLinuxi915::UuidData sbaUuidData = { .handle = sbaHandle, .classHandle = sbaClassHandle, .classIndex = NEO::DrmResourceClass::SbaTrackingBuffer}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(sbaHandle, std::move(sbaUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(sbaHandle, std::move(sbaUuidData)); uint64_t vmBindSbaData[sizeof(prelim_drm_i915_debug_event_vm_bind) / sizeof(uint64_t) + sizeof(typeOfUUID)]; prelim_drm_i915_debug_event_vm_bind *vmBindSba = reinterpret_cast(&vmBindSbaData); @@ -3508,7 +3508,7 @@ TEST_F(DebugApiLinuxTest, GivenVmBindEventWithUuidOfUnknownClassWhenHandlingEven vmBindSba->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindSba->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindSba->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + sizeof(typeOfUUID); - vmBindSba->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindSba->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindSba->va_start = sbaAddress; vmBindSba->va_length = 0x1000; vmBindSba->vm_handle = 0; @@ -3519,19 +3519,19 @@ TEST_F(DebugApiLinuxTest, GivenVmBindEventWithUuidOfUnknownClassWhenHandlingEven session->handleEvent(&vmBindSba->base); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToStateBaseAreaBindInfo.size()); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToModuleDebugAreaBindInfo.size()); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToStateBaseAreaBindInfo.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToModuleDebugAreaBindInfo.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo.size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.size()); } TEST_F(DebugApiLinuxTest, GivenUuidEventOfKnownClassWhenHandlingEventThenGpuAddressIsSavedFromPayload) { zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); @@ -3543,15 +3543,15 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventOfKnownClassWhenHandlingEventThenGpuAddr uint64_t sbaAddress = 0x1234000; uint64_t moduleDebugAddress = 0x34567000; uint64_t contextSaveAddress = 0x56789000; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[sbaClassHandle] = {"SBA AREA", static_cast(NEO::DrmResourceClass::SbaTrackingBuffer)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[moduleDebugClassHandle] = {"DEBUG AREA", static_cast(NEO::DrmResourceClass::ModuleHeapDebugArea)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[contextSaveClassHandle] = {"CONTEXT SAVE AREA", static_cast(NEO::DrmResourceClass::ContextSaveArea)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[sbaClassHandle] = {"SBA AREA", static_cast(NEO::DrmResourceClass::SbaTrackingBuffer)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[moduleDebugClassHandle] = {"DEBUG AREA", static_cast(NEO::DrmResourceClass::ModuleHeapDebugArea)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[contextSaveClassHandle] = {"CONTEXT SAVE AREA", static_cast(NEO::DrmResourceClass::ContextSaveArea)}; prelim_drm_i915_debug_event_uuid uuidSba = {}; uuidSba.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuidSba.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuidSba.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuidSba.client_handle = MockDebugSessionLinux::mockClientHandle; + uuidSba.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuidSba.handle = 4; uuidSba.class_handle = sbaClassHandle; uuidSba.payload_size = sizeof(sbaAddress); @@ -3568,7 +3568,7 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventOfKnownClassWhenHandlingEventThenGpuAddr uuidModule.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuidModule.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuidModule.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuidModule.client_handle = MockDebugSessionLinux::mockClientHandle; + uuidModule.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuidModule.handle = 5; uuidModule.class_handle = moduleDebugClassHandle; uuidModule.payload_size = sizeof(moduleDebugAddress); @@ -3586,7 +3586,7 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventOfKnownClassWhenHandlingEventThenGpuAddr uuidContextSave.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuidContextSave.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuidContextSave.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuidContextSave.client_handle = MockDebugSessionLinux::mockClientHandle, + uuidContextSave.client_handle = MockDebugSessionLinuxi915::mockClientHandle, uuidContextSave.handle = 6, uuidContextSave.class_handle = contextSaveClassHandle; uuidContextSave.payload_size = sizeof(contextSaveAddress); @@ -3599,26 +3599,26 @@ TEST_F(DebugApiLinuxTest, GivenUuidEventOfKnownClassWhenHandlingEventThenGpuAddr handler->returnUuid = &readUuid; session->handleEvent(&uuidContextSave.base); - EXPECT_EQ(moduleDebugAddress, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->moduleDebugAreaGpuVa); - EXPECT_EQ(sbaAddress, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->stateBaseAreaGpuVa); - EXPECT_EQ(contextSaveAddress, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextStateSaveAreaGpuVa); + EXPECT_EQ(moduleDebugAddress, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->moduleDebugAreaGpuVa); + EXPECT_EQ(sbaAddress, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->stateBaseAreaGpuVa); + EXPECT_EQ(contextSaveAddress, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextStateSaveAreaGpuVa); } -struct DebugApiLinuxVmBindFixture : public DebugApiLinuxFixture, public MockDebugSessionLinuxHelper { +struct DebugApiLinuxVmBindFixture : public DebugApiLinuxFixture, public MockDebugSessionLinuxi915Helper { void setUp() { DebugApiLinuxFixture::setUp(); zet_debug_config_t config = {}; config.pid = 0x1234; - session = std::make_unique(config, device, 10); + session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[vmHandleForVmBind] = 0; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[vmHandleForVmBind] = 0; setupSessionClassHandlesAndUuidMap(session.get()); } @@ -3632,7 +3632,7 @@ struct DebugApiLinuxVmBindFixture : public DebugApiLinuxFixture, public MockDebu const uint64_t zebinModuleUUID = 9; MockIoctlHandler *handler = nullptr; - std::unique_ptr session; + std::unique_ptr session; }; using DebugApiLinuxVmBindTest = Test; @@ -3653,7 +3653,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventWithKnownUuidClassWhenHandlingEv vmBindSba->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindSba->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindSba->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + sizeof(decltype(prelim_drm_i915_debug_event_vm_bind::uuids[0])); - vmBindSba->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindSba->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindSba->va_start = sbaAddress; vmBindSba->va_length = 0x1000; vmBindSba->vm_handle = vmHandleForVmBind; @@ -3665,7 +3665,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventWithKnownUuidClassWhenHandlingEv vmBindDebugArea->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindDebugArea->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindDebugArea->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + sizeof(decltype(prelim_drm_i915_debug_event_vm_bind::uuids[0])); - vmBindDebugArea->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindDebugArea->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindDebugArea->va_start = moduleDebugAddress; vmBindDebugArea->va_length = 0x1000; vmBindDebugArea->vm_handle = 4; @@ -3677,7 +3677,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventWithKnownUuidClassWhenHandlingEv vmBindContextArea->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindContextArea->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindContextArea->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + sizeof(decltype(prelim_drm_i915_debug_event_vm_bind::uuids[0])); - vmBindContextArea->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindContextArea->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindContextArea->va_start = contextSaveAddress; vmBindContextArea->va_length = 0x1000; vmBindContextArea->vm_handle = 5; @@ -3686,21 +3686,21 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventWithKnownUuidClassWhenHandlingEv temp = static_cast(stateSaveUUID); memcpy(uuids, &temp, sizeof(typeOfUUID)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[4] = 0; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[5] = 0; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[4] = 0; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[5] = 0; session->handleEvent(&vmBindSba->base); session->handleEvent(&vmBindDebugArea->base); session->handleEvent(&vmBindContextArea->base); - EXPECT_EQ(moduleDebugAddress, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToModuleDebugAreaBindInfo[4].gpuVa); - EXPECT_EQ(0x1000u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToModuleDebugAreaBindInfo[4].size); + EXPECT_EQ(moduleDebugAddress, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToModuleDebugAreaBindInfo[4].gpuVa); + EXPECT_EQ(0x1000u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToModuleDebugAreaBindInfo[4].size); - EXPECT_EQ(sbaAddress, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToStateBaseAreaBindInfo[3].gpuVa); - EXPECT_EQ(0x1000u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToStateBaseAreaBindInfo[3].size); + EXPECT_EQ(sbaAddress, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToStateBaseAreaBindInfo[3].gpuVa); + EXPECT_EQ(0x1000u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToStateBaseAreaBindInfo[3].size); - EXPECT_EQ(contextSaveAddress, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[5].gpuVa); - EXPECT_EQ(0x1000u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[5].size); + EXPECT_EQ(contextSaveAddress, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[5].gpuVa); + EXPECT_EQ(0x1000u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[5].size); } TEST_F(DebugApiLinuxVmBindTest, GivenZeruNumUuidsWhenHandlingVmBindEventThenNoBindInfoIsStored) { @@ -3713,14 +3713,14 @@ TEST_F(DebugApiLinuxVmBindTest, GivenZeruNumUuidsWhenHandlingVmBindEventThenNoBi vmBindSba.base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindSba.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindSba.base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + sizeof(typeOfUUID); - vmBindSba.client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindSba.client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindSba.va_start = sbaAddress; vmBindSba.va_length = 0x1000; vmBindSba.num_uuids = 0; session->handleVmBindEvent(&vmBindSba); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToStateBaseAreaBindInfo.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToStateBaseAreaBindInfo.size()); } TEST_F(DebugApiLinuxVmBindTest, GivenNeedsAckFlagWhenHandlingVmBindEventThenAckIsSent) { @@ -3734,7 +3734,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenNeedsAckFlagWhenHandlingVmBindEventThenAckI vmBind.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBind.base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + sizeof(typeOfUUID); vmBind.base.seqno = 45; - vmBind.client_handle = MockDebugSessionLinux::mockClientHandle; + vmBind.client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBind.va_start = address; vmBind.va_length = 0x1000; vmBind.num_uuids = 0; @@ -3756,7 +3756,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventWithAckFlagWhenHandlingEventForISAThen vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 20u; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -3782,8 +3782,8 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventWithAckFlagWhenHandlingEventForISAThen EXPECT_EQ(ZET_DEBUG_EVENT_FLAG_NEED_ACK, event.flags); EXPECT_EQ(ZET_DEBUG_EVENT_TYPE_MODULE_LOAD, event.type); - auto isaIter = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0].find(isaGpuVa); - ASSERT_NE(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0].end(), isaIter); + auto isaIter = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0].find(isaGpuVa); + ASSERT_NE(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0].end(), isaIter); EXPECT_EQ(1u, isaIter->second->ackEvents.size()); auto ackedEvent = isaIter->second->ackEvents[0]; @@ -3803,7 +3803,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenUnknownVmAndEventWithAckFlagForIsaWhenHandl vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 20u; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = 5678; @@ -3823,8 +3823,8 @@ TEST_F(DebugApiLinuxVmBindTest, GivenUnknownVmAndEventWithAckFlagForIsaWhenHandl EXPECT_EQ(0u, session->apiEvents.size()); EXPECT_EQ(0u, session->eventsToAck.size()); - auto isaIter = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0].find(isaGpuVa); - ASSERT_EQ(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0].end(), isaIter); + auto isaIter = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0].find(isaGpuVa); + ASSERT_EQ(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0].end(), isaIter); EXPECT_EQ(0u, session->processPendingVmBindEventsCalled); EXPECT_EQ(20u, handler->debugEventAcked.seqno); @@ -3839,7 +3839,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenUnknownVmAndEventWithoutUuidsWhenHandlingVm vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind); vmBindIsa->base.seqno = 20u; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = 0x1000; vmBindIsa->va_length = 0x1000; vmBindIsa->vm_handle = 5678; @@ -3861,7 +3861,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventForISAWhenModuleLoadEventAlreadyAckedT vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 20u; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->num_uuids = 3; @@ -3885,8 +3885,8 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventForISAWhenModuleLoadEventAlreadyAckedT vmBindIsa->vm_handle = vmHandleForVmBind; session->handleEvent(&vmBindIsa->base); - auto isaIter = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0].find(isaGpuVa); - ASSERT_NE(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0].end(), isaIter); + auto isaIter = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0].find(isaGpuVa); + ASSERT_NE(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0].end(), isaIter); EXPECT_EQ(1u, isaIter->second->ackEvents.size()); auto event = session->apiEvents.front(); @@ -3900,7 +3900,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventForISAWhenModuleLoadEventAlreadyAckedT EXPECT_EQ(0u, isaIter->second->ackEvents.size()); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap->clear(); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap->clear(); } } @@ -3915,7 +3915,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventForIsaWithoutAckTriggeredBeforeAttachW vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 20u; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -3932,8 +3932,8 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventForIsaWithoutAckTriggeredBeforeAttachW session->handleEvent(&vmBindIsa->base); - auto isaIter = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0].find(isaGpuVa); - ASSERT_NE(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0].end(), isaIter); + auto isaIter = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0].find(isaGpuVa); + ASSERT_NE(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0].end(), isaIter); EXPECT_EQ(0u, isaIter->second->ackEvents.size()); // Auto-acked event EXPECT_TRUE(isaIter->second->moduleLoadEventAck); @@ -3959,13 +3959,13 @@ TEST_F(DebugApiLinuxVmBindTest, GivenTwoPendingEventsWhenAcknowledgeEventCalledT addZebinVmBindEvent(session.get(), vm0, true, true, 0); addZebinVmBindEvent(session.get(), vm0, true, true, 1); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); // second module addZebinVmBindEvent(session.get(), vm0, true, true, 0, 1); addZebinVmBindEvent(session.get(), vm0, true, true, 1, 1); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID1].ackEvents[0].size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID1].ackEvents[0].size()); EXPECT_EQ(2u, session->apiEvents.size()); zet_debug_event_t event0 = {}; @@ -3981,9 +3981,9 @@ TEST_F(DebugApiLinuxVmBindTest, GivenTwoPendingEventsWhenAcknowledgeEventCalledT handler->ackCount = 0; session->acknowledgeEvent(&event1); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID1].ackEvents[0].size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID1].ackEvents[0].size()); EXPECT_NE(0u, handler->ackCount); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); // 1 module needs ack EXPECT_EQ(1u, session->eventsToAck.size()); @@ -4000,18 +4000,18 @@ TEST_F(DebugApiLinuxVmBindTest, GivenNoIsaUUIDAndZebinModuleForDataSegmentWhenHa vmBindIsa->base.flags |= PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 2 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 10; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; - DebugSessionLinux::UuidData zebinModuleUuidData = { + DebugSessionLinuxi915::UuidData zebinModuleUuidData = { .handle = zebinModuleUUID, .classHandle = zebinModuleClassHandle, .classIndex = NEO::DrmResourceClass::L0ZebinModule, .data = std::make_unique(sizeof(1)), .dataSize = sizeof(1)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = 1; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = 1; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vm0; @@ -4024,7 +4024,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenNoIsaUUIDAndZebinModuleForDataSegmentWhenHa memcpy_s(uuids, 2 * sizeof(typeOfUUID), uuidsTemp, sizeof(uuidsTemp)); session->handleEvent(&vmBindIsa->base); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); EXPECT_EQ(1u, session->apiEvents.size()); EXPECT_EQ(1u, session->eventsToAck.size()); @@ -4049,13 +4049,13 @@ TEST_F(DebugApiLinuxVmBindTest, GivenBlockOnFenceAndTwoPendingEventsWhenAcknowle addZebinVmBindEvent(session.get(), vm0, true, true, 0); addZebinVmBindEvent(session.get(), vm0, true, true, 1); - EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); // second module addZebinVmBindEvent(session.get(), vm0, true, true, 0, 1); addZebinVmBindEvent(session.get(), vm0, true, true, 1, 1); - EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID1].ackEvents[0].size()); + EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID1].ackEvents[0].size()); EXPECT_EQ(2u, session->apiEvents.size()); @@ -4072,9 +4072,9 @@ TEST_F(DebugApiLinuxVmBindTest, GivenBlockOnFenceAndTwoPendingEventsWhenAcknowle handler->ackCount = 0; session->acknowledgeEvent(&event1); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID1].ackEvents[0].size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID1].ackEvents[0].size()); EXPECT_EQ(2u, handler->ackCount); - EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); // 1 module needs ack EXPECT_EQ(1u, session->eventsToAck.size()); @@ -4090,7 +4090,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenIsaRemovedWhenModuleLoadEventIsAckedThenErr vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 20u; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4107,15 +4107,15 @@ TEST_F(DebugApiLinuxVmBindTest, GivenIsaRemovedWhenModuleLoadEventIsAckedThenErr session->handleEvent(&vmBindIsa->base); - auto isaIter = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0].find(isaGpuVa); - ASSERT_NE(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0].end(), isaIter); + auto isaIter = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0].find(isaGpuVa); + ASSERT_NE(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0].end(), isaIter); EXPECT_EQ(1u, isaIter->second->ackEvents.size()); zet_debug_event_t event = {}; auto result = session->readEvent(0, &event); EXPECT_EQ(ZE_RESULT_SUCCESS, result); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0].clear(); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0].clear(); result = session->acknowledgeEvent(&event); EXPECT_EQ(ZE_RESULT_ERROR_UNINITIALIZED, result); @@ -4128,14 +4128,14 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventWithInvalidNumUUIDsWhenHandlingE vmBindSba.base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindSba.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindSba.base.size = sizeof(prelim_drm_i915_debug_event_vm_bind); - vmBindSba.client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindSba.client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindSba.va_start = sbaAddress; vmBindSba.va_length = 0x1000; vmBindSba.num_uuids = 10; session->handleEvent(&vmBindSba.base); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToStateBaseAreaBindInfo.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToStateBaseAreaBindInfo.size()); } TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventWithAckNeededForIsaWhenHandlingEventThenIsaAllocationIsSavedWithEventToAck) { @@ -4148,7 +4148,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventWithAckNeededForIsaWhenHandlingE vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 3; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4167,7 +4167,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventWithAckNeededForIsaWhenHandlingE session->handleEvent(&vmBindIsa->base); - auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0]; + auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0]; EXPECT_EQ(1u, isaMap.size()); EXPECT_NE(isaMap.end(), isaMap.find(isaGpuVa)); @@ -4196,7 +4196,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenCookieWhenHandlingVmBindForIsaThenIsaAlloca vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 3; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4211,7 +4211,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenCookieWhenHandlingVmBindForIsaThenIsaAlloca session->handleEvent(&vmBindIsa->base); - auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0]; + auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0]; EXPECT_EQ(1u, isaMap.size()); EXPECT_NE(isaMap.end(), isaMap.find(isaGpuVa)); @@ -4234,7 +4234,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenNoCookieWhenHandlingVmBindForIsaThenIsaAllo vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 3; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4249,7 +4249,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenNoCookieWhenHandlingVmBindForIsaThenIsaAllo session->handleEvent(&vmBindIsa->base); - auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0]; + auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0]; EXPECT_EQ(1u, isaMap.size()); EXPECT_NE(isaMap.end(), isaMap.find(isaGpuVa)); @@ -4271,7 +4271,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenTwoVmBindEventForTheSameIsaInDifferentVMWhe vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4286,7 +4286,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenTwoVmBindEventForTheSameIsaInDifferentVMWhe session->handleEvent(&vmBindIsa->base); - auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0]; + auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0]; EXPECT_EQ(1u, isaMap.size()); EXPECT_NE(isaMap.end(), isaMap.find(isaGpuVa)); auto isaAllocation = isaMap[isaGpuVa].get(); @@ -4310,7 +4310,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindDestroyEventForIsaWhenHandlingEventTh vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_DESTROY; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4325,7 +4325,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindDestroyEventForIsaWhenHandlingEventTh session->handleEvent(&vmBindIsa->base); - auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0]; + auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0]; EXPECT_EQ(0u, isaMap.size()); } @@ -4338,7 +4338,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventForIsaWhenReadingEventThenModule vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4351,7 +4351,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventForIsaWhenReadingEventThenModule memcpy(uuids, uuidsTemp, sizeof(uuidsTemp)); - auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0]; + auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0]; EXPECT_EQ(0u, isaMap.size()); session->handleEvent(&vmBindIsa->base); @@ -4374,8 +4374,8 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventForIsaWhenReadingEventThenModule if (Math::log2(device->getHwInfo().capabilityTable.gpuAddressSpace + 1) >= 48) { EXPECT_NE(isaGpuVa, event.info.module.load); } - auto elf = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr; - auto elfSize = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].dataSize; + auto elf = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr; + auto elfSize = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].dataSize; EXPECT_EQ(elf, event.info.module.moduleBegin); EXPECT_EQ(elf + elfSize, event.info.module.moduleEnd); } @@ -4389,7 +4389,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindCreateAndDestroyEventsForIsaWhenReadi vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4402,7 +4402,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindCreateAndDestroyEventsForIsaWhenReadi memcpy(uuids, uuidsTemp, sizeof(uuidsTemp)); - auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0]; + auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0]; EXPECT_EQ(0u, isaMap.size()); session->handleEvent(&vmBindIsa->base); @@ -4430,8 +4430,8 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindCreateAndDestroyEventsForIsaWhenReadi EXPECT_EQ(gmmHelper->canonize(isaGpuVa), event.info.module.load); - auto elf = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr; - auto elfSize = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].dataSize; + auto elf = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr; + auto elfSize = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].dataSize; EXPECT_EQ(elf, event.info.module.moduleBegin); EXPECT_EQ(elf + elfSize, event.info.module.moduleEnd); } @@ -4442,12 +4442,12 @@ TEST_F(DebugApiLinuxVmBindTest, GivenIsaBoundMultipleTimesWhenHandlingVmBindDest uint64_t vmBindIsaData[sizeof(prelim_drm_i915_debug_event_vm_bind) / sizeof(uint64_t) + 3 * sizeof(typeOfUUID)]; prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); - auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0]; + auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0]; - auto isa = std::make_unique(); + auto isa = std::make_unique(); isa->bindInfo = {isaGpuVa, isaSize}; isa->vmHandle = 3; - isa->elfUuidHandle = DebugSessionLinux::invalidHandle; + isa->elfUuidHandle = DebugSessionLinuxi915::invalidHandle; isa->moduleBegin = 0; isa->moduleEnd = 0; isa->vmBindCounter = 5; @@ -4456,7 +4456,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenIsaBoundMultipleTimesWhenHandlingVmBindDest vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_DESTROY; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4483,7 +4483,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenVmBindEventForIsaWithInvalidElfWhenReadingE vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4516,7 +4516,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventWithL0ZebinModuleWhenHandlingEventThen prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); const uint32_t kernelCount = 2; - DebugSessionLinux::UuidData zebinModuleUuidData = { + DebugSessionLinuxi915::UuidData zebinModuleUuidData = { .handle = zebinModuleUUID, .classHandle = zebinModuleClassHandle, .classIndex = NEO::DrmResourceClass::L0ZebinModule, @@ -4525,17 +4525,17 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventWithL0ZebinModuleWhenHandlingEventThen memcpy(zebinModuleUuidData.data.get(), &kernelCount, sizeof(kernelCount)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = 2; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = 2; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr = 0x1000; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr = 0x1000; vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 10; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4551,11 +4551,11 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventWithL0ZebinModuleWhenHandlingEventThen session->handleEvent(&vmBindIsa->base); EXPECT_EQ(0u, session->apiEvents.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); // event not pushed to ack - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0][isaGpuVa]->ackEvents.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0][isaGpuVa]->ackEvents.size()); EXPECT_EQ(1, handler->ioctlCalled); // ACK EXPECT_EQ(vmBindIsa->base.seqno, handler->debugEventAcked.seqno); @@ -4567,16 +4567,16 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventWithL0ZebinModuleWhenHandlingEventThen session->handleEvent(&vmBindIsa->base); EXPECT_EQ(1u, session->apiEvents.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.size()); - EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); - EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.size()); + EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); + EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount); // event not pushed to ack - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0][isaGpuVa2]->ackEvents.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0][isaGpuVa2]->ackEvents.size()); EXPECT_EQ(0, handler->ioctlCalled); EXPECT_EQ(0u, handler->debugEventAcked.seqno); - auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0]; + auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0]; EXPECT_EQ(2u, isaMap.size()); EXPECT_FALSE(isaMap[isaGpuVa]->moduleLoadEventAck); @@ -4589,8 +4589,8 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventWithL0ZebinModuleWhenHandlingEventThen EXPECT_EQ(ZET_DEBUG_EVENT_FLAG_NEED_ACK, event.flags & ZET_DEBUG_EVENT_FLAG_NEED_ACK); EXPECT_EQ(isaGpuVa2, event.info.module.load); - auto elfAddress = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr; - auto elfSize = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].dataSize; + auto elfAddress = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr; + auto elfSize = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].dataSize; EXPECT_EQ(elfAddress, event.info.module.moduleBegin); EXPECT_EQ(elfAddress + elfSize, event.info.module.moduleEnd); @@ -4625,9 +4625,9 @@ TEST_F(DebugApiLinuxVmBindTest, GivenEventWithL0ZebinModuleWhenHandlingEventThen EXPECT_EQ(isaGpuVa2, event.info.module.load); EXPECT_EQ(0u, event.flags & ZET_DEBUG_EVENT_FLAG_NEED_ACK); - EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr, event.info.module.moduleBegin); - EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr + - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].dataSize, + EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr, event.info.module.moduleBegin); + EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr + + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].dataSize, event.info.module.moduleEnd); } @@ -4639,7 +4639,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenAttachAfterModuleCreateWhenHandlingEventWit prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); const uint32_t kernelCount = 2; - DebugSessionLinux::UuidData zebinModuleUuidData = { + DebugSessionLinuxi915::UuidData zebinModuleUuidData = { .handle = zebinModuleUUID, .classHandle = zebinModuleClassHandle, .classIndex = NEO::DrmResourceClass::L0ZebinModule, @@ -4648,17 +4648,17 @@ TEST_F(DebugApiLinuxVmBindTest, GivenAttachAfterModuleCreateWhenHandlingEventWit memcpy(zebinModuleUuidData.data.get(), &kernelCount, sizeof(kernelCount)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = 2; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr = 0x1000; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = 2; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr = 0x1000; vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; // No ACK flag - vm bind called before debugger attached vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 20; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4674,11 +4674,11 @@ TEST_F(DebugApiLinuxVmBindTest, GivenAttachAfterModuleCreateWhenHandlingEventWit session->handleEvent(&vmBindIsa->base); EXPECT_EQ(0u, session->apiEvents.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); // event not pushed to ack - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0][isaGpuVa]->ackEvents.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0][isaGpuVa]->ackEvents.size()); EXPECT_EQ(0, handler->ioctlCalled); EXPECT_EQ(0u, handler->debugEventAcked.seqno); @@ -4689,16 +4689,16 @@ TEST_F(DebugApiLinuxVmBindTest, GivenAttachAfterModuleCreateWhenHandlingEventWit session->handleEvent(&vmBindIsa->base); EXPECT_EQ(1u, session->apiEvents.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.size()); - EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); - EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.size()); + EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); + EXPECT_EQ(2u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount); // event not pushed to ack - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0][isaGpuVa]->ackEvents.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0][isaGpuVa]->ackEvents.size()); EXPECT_EQ(0, handler->ioctlCalled); EXPECT_EQ(0u, handler->debugEventAcked.seqno); // Not acked - auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0]; + auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0]; EXPECT_EQ(2u, isaMap.size()); EXPECT_TRUE(isaMap[isaGpuVa2]->moduleLoadEventAck); @@ -4712,8 +4712,8 @@ TEST_F(DebugApiLinuxVmBindTest, GivenAttachAfterModuleCreateWhenHandlingEventWit EXPECT_EQ(isaGpuVa2, event.info.module.load); - auto elfAddress = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr; - auto elfSize = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].dataSize; + auto elfAddress = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr; + auto elfSize = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].dataSize; EXPECT_EQ(elfAddress, event.info.module.moduleBegin); EXPECT_EQ(elfAddress + elfSize, event.info.module.moduleEnd); @@ -4740,9 +4740,9 @@ TEST_F(DebugApiLinuxVmBindTest, GivenAttachAfterModuleCreateWhenHandlingEventWit EXPECT_EQ(isaGpuVa2, event.info.module.load); EXPECT_EQ(0u, event.flags & ZET_DEBUG_EVENT_FLAG_NEED_ACK); - EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr, event.info.module.moduleBegin); - EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr + - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].dataSize, + EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr, event.info.module.moduleBegin); + EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr + + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].dataSize, event.info.module.moduleEnd); } @@ -4755,7 +4755,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenMultipleSegmentsInL0ZebinModuleWhenLoadAddr prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); const uint32_t segmentCount = 2; - DebugSessionLinux::UuidData zebinModuleUuidData = { + DebugSessionLinuxi915::UuidData zebinModuleUuidData = { .handle = zebinModuleUUID, .classHandle = zebinModuleClassHandle, .classIndex = NEO::DrmResourceClass::L0ZebinModule, @@ -4764,16 +4764,16 @@ TEST_F(DebugApiLinuxVmBindTest, GivenMultipleSegmentsInL0ZebinModuleWhenLoadAddr memcpy(zebinModuleUuidData.data.get(), &segmentCount, sizeof(segmentCount)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = segmentCount; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = segmentCount; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr = 0x1000; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr = 0x1000; vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4810,7 +4810,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenMultipleSegmentsInL0ZebinModuleWhenLoadAddr prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); const uint32_t segmentCount = 2; - DebugSessionLinux::UuidData zebinModuleUuidData = { + DebugSessionLinuxi915::UuidData zebinModuleUuidData = { .handle = zebinModuleUUID, .classHandle = zebinModuleClassHandle, .classIndex = NEO::DrmResourceClass::L0ZebinModule, @@ -4819,15 +4819,15 @@ TEST_F(DebugApiLinuxVmBindTest, GivenMultipleSegmentsInL0ZebinModuleWhenLoadAddr memcpy(zebinModuleUuidData.data.get(), &segmentCount, sizeof(segmentCount)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = segmentCount; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr = 0x1000; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = segmentCount; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr = 0x1000; vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4863,7 +4863,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenMultipleBindEventsWithZebinModuleWhenHandli prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); const uint32_t kernelCount = 2; - DebugSessionLinux::UuidData zebinModuleUuidData = { + DebugSessionLinuxi915::UuidData zebinModuleUuidData = { .handle = zebinModuleUUID, .classHandle = zebinModuleClassHandle, .classIndex = NEO::DrmResourceClass::L0ZebinModule, @@ -4872,14 +4872,14 @@ TEST_F(DebugApiLinuxVmBindTest, GivenMultipleBindEventsWithZebinModuleWhenHandli memcpy(zebinModuleUuidData.data.get(), &kernelCount, sizeof(kernelCount)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = 1; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[zebinModuleClassHandle] = {"L0_ZEBIN_MODULE", static_cast(NEO::DrmResourceClass::L0ZebinModule)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.emplace(zebinModuleUUID, std::move(zebinModuleUuidData)); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount = 1; vmBindIsa->base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND; vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandleForVmBind; @@ -4896,19 +4896,19 @@ TEST_F(DebugApiLinuxVmBindTest, GivenMultipleBindEventsWithZebinModuleWhenHandli session->handleEvent(&vmBindIsa->base); EXPECT_EQ(1u, session->apiEvents.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount); vmBindIsa->vm_handle = vmHandleForVmBind + 1000; session->handleEvent(&vmBindIsa->base); EXPECT_EQ(1u, session->apiEvents.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount); - auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0]; + auto &isaMap = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0]; EXPECT_EQ(1u, isaMap.size()); zet_debug_event_t event = {}; @@ -4924,7 +4924,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenPendingEventsWhenCloseConnectionCalledThenE addZebinVmBindEvent(session.get(), vm0, true, true, 0); addZebinVmBindEvent(session.get(), vm0, true, true, 1); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); handler->ackCount = 0; bool result = session->closeConnection(); @@ -4936,7 +4936,7 @@ TEST_F(DebugApiLinuxVmBindTest, GivenPendingEventsWhenCloseConnectionCalledThenE TEST_F(DebugApiLinuxVmBindTest, GivenNoClientHandleWhenCloseConnectionCalledThenCleanupIsNotCalled) { - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; handler->ackCount = 0; bool result = session->closeConnection(); EXPECT_TRUE(result); @@ -4949,39 +4949,39 @@ TEST_F(DebugApiLinuxTest, GivenVmEventWithCreateAndDestroyFlagsWhenHandlingEvent zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; prelim_drm_i915_debug_event_vm vmEvent = {}; vmEvent.base.type = PRELIM_DRM_I915_DEBUG_EVENT_VM; vmEvent.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; vmEvent.base.size = sizeof(prelim_drm_i915_debug_event_vm); - vmEvent.client_handle = MockDebugSessionLinux::mockClientHandle; + vmEvent.client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmEvent.handle = 4; session->handleEvent(&vmEvent.base); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.count(4)); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmIds.size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmIds.count(4)); vmEvent.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_DESTROY; session->handleEvent(&vmEvent.base); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.size()); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.count(4)); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmIds.size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmIds.count(4)); } TEST_F(DebugApiLinuxTest, GivenNonClassUuidEventWithoutPayloadWhenHandlingEventThenReadEventIoctlIsNotCalledAndUuidIsSaved) { zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); prelim_drm_i915_debug_event_uuid uuid = {}; uuid.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuid.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuid.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuid.handle = 2; uuid.payload_size = 0; uuid.class_handle = 50; @@ -4989,7 +4989,7 @@ TEST_F(DebugApiLinuxTest, GivenNonClassUuidEventWithoutPayloadWhenHandlingEventT const char uuidString[] = "00000000-0000-0000-0000-000000000001"; prelim_drm_i915_debug_read_uuid readUuid = {}; - readUuid.client_handle = MockDebugSessionLinux::mockClientHandle; + readUuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; memcpy(readUuid.uuid, uuidString, 36); readUuid.payload_ptr = 0; readUuid.payload_size = 0; @@ -5001,11 +5001,11 @@ TEST_F(DebugApiLinuxTest, GivenNonClassUuidEventWithoutPayloadWhenHandlingEventT session->handleEvent(reinterpret_cast(&uuid)); - EXPECT_EQ(50u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuid.handle].classHandle); - EXPECT_EQ(uuid.handle, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuid.handle].handle); - EXPECT_EQ(uuid.class_handle, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuid.handle].classHandle); - EXPECT_EQ(nullptr, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuid.handle].data); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[uuid.handle].dataSize); + EXPECT_EQ(50u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuid.handle].classHandle); + EXPECT_EQ(uuid.handle, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuid.handle].handle); + EXPECT_EQ(uuid.class_handle, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuid.handle].classHandle); + EXPECT_EQ(nullptr, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuid.handle].data); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[uuid.handle].dataSize); EXPECT_EQ(0, handler->ioctlCalled); } @@ -5017,7 +5017,7 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerLogsAndFailingReadUuidEventIoctlWhenHandl zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto uuidName = NEO::classNamesToUuid[0].first; @@ -5051,10 +5051,10 @@ TEST_F(DebugApiLinuxTest, GivenEventsAvailableWhenReadingEventThenEventsAreRetur zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; zet_debug_event_t debugEvent = {}; debugEvent.type = ZET_DEBUG_EVENT_TYPE_PROCESS_ENTRY; @@ -5094,21 +5094,21 @@ TEST_F(DebugApiLinuxTest, GivenContextParamEventWhenTypeIsParamVmThenVmIdIsStore zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; uint64_t vmId = 10; uint64_t contextHandle = 20; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.insert(vmId); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmIds.insert(vmId); prelim_drm_i915_debug_event_context_param contextParamEvent = {}; contextParamEvent.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent.base.flags = 0; contextParamEvent.base.size = sizeof(prelim_drm_i915_debug_event_context_param); - contextParamEvent.client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent.client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent.ctx_handle = contextHandle; contextParamEvent.param = {.ctx_id = 3, .size = 8, .param = I915_CONTEXT_PARAM_VM, .value = vmId}; @@ -5123,16 +5123,16 @@ TEST_F(DebugApiLinuxTest, GivenContextParamEventWhenTypeIsParamEngineThenEventIs zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; uint64_t vmId = 10; uint32_t contextHandle = 20; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].vm = vmId; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.insert(vmId); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].vm = vmId; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmIds.insert(vmId); constexpr auto size = sizeof(prelim_drm_i915_debug_event_context_param) + sizeof(i915_context_param_engines) + sizeof(i915_engine_class_instance); @@ -5143,7 +5143,7 @@ TEST_F(DebugApiLinuxTest, GivenContextParamEventWhenTypeIsParamEngineThenEventIs contextParamEvent->base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent->base.flags = 0; contextParamEvent->base.size = size; - contextParamEvent->client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent->client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent->ctx_handle = contextHandle; } @@ -5171,13 +5171,13 @@ TEST_F(DebugApiLinuxTest, GivenContextParamEventWhenTypeIsParamEngineThenEventIs session->handleEvent(&contextParamEvent->base); alignedFree(memory); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines.size()); - EXPECT_EQ(static_cast(drm_i915_gem_engine_class::I915_ENGINE_CLASS_RENDER), session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_class); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_instance); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].engines.size()); + EXPECT_EQ(static_cast(drm_i915_gem_engine_class::I915_ENGINE_CLASS_RENDER), session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_class); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_instance); - EXPECT_NE(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.end(), - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.find(vmId)); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[vmId]); + EXPECT_NE(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile.end(), + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile.find(vmId)); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[vmId]); auto infoMessage = ::testing::internal::GetCapturedStdout(); EXPECT_TRUE(hasSubstr(infoMessage, std::string("I915_CONTEXT_PARAM_ENGINES ctx_id = 20 param = 10 value = 0"))); @@ -5187,16 +5187,16 @@ TEST_F(DebugApiLinuxTest, GivenNoVmIdWhenOrZeroEnginesContextParamEventIsHandled zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; uint64_t vmId = 10; uint32_t contextHandle = 20; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].vm = MockDebugSessionLinux::invalidHandle; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.insert(vmId); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].vm = MockDebugSessionLinuxi915::invalidHandle; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmIds.insert(vmId); constexpr auto size = sizeof(prelim_drm_i915_debug_event_context_param) + sizeof(i915_context_param_engines) + sizeof(i915_engine_class_instance); @@ -5207,7 +5207,7 @@ TEST_F(DebugApiLinuxTest, GivenNoVmIdWhenOrZeroEnginesContextParamEventIsHandled contextParamEvent->base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent->base.flags = 0; contextParamEvent->base.size = size; - contextParamEvent->client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent->client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent->ctx_handle = contextHandle; } @@ -5233,21 +5233,21 @@ TEST_F(DebugApiLinuxTest, GivenNoVmIdWhenOrZeroEnginesContextParamEventIsHandled session->handleEvent(&contextParamEvent->base); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines.size()); - EXPECT_EQ(static_cast(drm_i915_gem_engine_class::I915_ENGINE_CLASS_RENDER), session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_class); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_instance); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].engines.size()); + EXPECT_EQ(static_cast(drm_i915_gem_engine_class::I915_ENGINE_CLASS_RENDER), session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_class); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].engines[0].engine_instance); - EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.end(), - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.find(MockDebugSessionLinux::invalidHandle)); + EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile.end(), + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile.find(MockDebugSessionLinuxi915::invalidHandle)); paramToCopy.size = sizeof(i915_context_param_engines); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].vm = vmId; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].vm = vmId; memcpy(ptrOffset(memory, offset), ¶mToCopy, sizeof(GemContextParam)); session->handleEvent(&contextParamEvent->base); - EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.end(), - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile.find(vmId)); + EXPECT_EQ(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile.end(), + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile.find(vmId)); alignedFree(memory); } @@ -5259,21 +5259,21 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerErrorLogsWhenContextParamWithInvalidConte zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; uint64_t vmId = 10; uint64_t contextHandle = 20; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.insert(vmId); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmIds.insert(vmId); prelim_drm_i915_debug_event_context_param contextParamEvent = {}; contextParamEvent.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent.base.flags = 0; contextParamEvent.base.size = sizeof(prelim_drm_i915_debug_event_context_param); - contextParamEvent.client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent.client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent.ctx_handle = 77; contextParamEvent.param = {.ctx_id = 3, .size = 8, .param = I915_CONTEXT_PARAM_VM, .value = vmId}; @@ -5294,21 +5294,21 @@ TEST_F(DebugApiLinuxTest, GivenDebuggerInfoLogsWhenHandlingContextParamEventWith zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = DebugSessionLinux::invalidClientHandle; + session->clientHandle = DebugSessionLinuxi915::invalidClientHandle; uint64_t vmId = 10; uint64_t contextHandle = 20; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmIds.insert(vmId); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle].handle = contextHandle; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmIds.insert(vmId); prelim_drm_i915_debug_event_context_param contextParamEvent = {}; contextParamEvent.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent.base.flags = 0; contextParamEvent.base.size = sizeof(prelim_drm_i915_debug_event_context_param); - contextParamEvent.client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent.client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent.ctx_handle = contextHandle; contextParamEvent.param = {.ctx_id = 3, .size = 8, .param = I915_CONTEXT_PARAM_BAN_PERIOD, .value = vmId}; @@ -5326,7 +5326,7 @@ TEST_F(DebugApiLinuxTest, WhenCallingThreadControlForInterruptThenProperIoctlsIs zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; @@ -5336,7 +5336,7 @@ TEST_F(DebugApiLinuxTest, WhenCallingThreadControlForInterruptThenProperIoctlsIs std::unique_ptr bitmaskOut; size_t bitmaskSizeOut = 0; - auto result = sessionMock->threadControl(threads, 0, MockDebugSessionLinux::ThreadControlCmd::Interrupt, bitmaskOut, bitmaskSizeOut); + auto result = sessionMock->threadControl(threads, 0, MockDebugSessionLinuxi915::ThreadControlCmd::Interrupt, bitmaskOut, bitmaskSizeOut); EXPECT_EQ(result, ZE_RESULT_SUCCESS); EXPECT_EQ(1, handler->ioctlCalled); @@ -5350,7 +5350,7 @@ TEST_F(DebugApiLinuxTest, WhenCallingThreadControlForInterruptThenProperIoctlsIs handler->euControlOutputSeqno = handler->euControlOutputSeqno + 3; handler->ioctlCalled = 0; - result = sessionMock->threadControl(threads, 0, MockDebugSessionLinux::ThreadControlCmd::InterruptAll, bitmaskOut, bitmaskSizeOut); + result = sessionMock->threadControl(threads, 0, MockDebugSessionLinuxi915::ThreadControlCmd::InterruptAll, bitmaskOut, bitmaskSizeOut); EXPECT_EQ(result, ZE_RESULT_SUCCESS); EXPECT_EQ(1, handler->ioctlCalled); @@ -5367,7 +5367,7 @@ TEST_F(DebugApiLinuxTest, GivenErrorFromIoctlWhenCallingThreadControlForInterrup zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; @@ -5379,7 +5379,7 @@ TEST_F(DebugApiLinuxTest, GivenErrorFromIoctlWhenCallingThreadControlForInterrup handler->ioctlRetVal = -1; - auto result = sessionMock->threadControl(threads, 0, MockDebugSessionLinux::ThreadControlCmd::InterruptAll, bitmaskOut, bitmaskSizeOut); + auto result = sessionMock->threadControl(threads, 0, MockDebugSessionLinuxi915::ThreadControlCmd::InterruptAll, bitmaskOut, bitmaskSizeOut); EXPECT_NE(0, result); EXPECT_EQ(1, handler->ioctlCalled); @@ -5391,7 +5391,7 @@ TEST_F(DebugApiLinuxTest, WhenCallingThreadControlForResumeThenProperIoctlsIsCal zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; @@ -5401,7 +5401,7 @@ TEST_F(DebugApiLinuxTest, WhenCallingThreadControlForResumeThenProperIoctlsIsCal std::unique_ptr bitmaskOut; size_t bitmaskSizeOut = 0; - auto result = sessionMock->threadControl(threads, 0, MockDebugSessionLinux::ThreadControlCmd::Resume, bitmaskOut, bitmaskSizeOut); + auto result = sessionMock->threadControl(threads, 0, MockDebugSessionLinuxi915::ThreadControlCmd::Resume, bitmaskOut, bitmaskSizeOut); EXPECT_EQ(result, ZE_RESULT_SUCCESS); EXPECT_EQ(1, handler->ioctlCalled); @@ -5417,7 +5417,7 @@ TEST_F(DebugApiLinuxTest, GivenStoppedAndRunningThreadWhenCheckStoppedThreadsAnd zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; @@ -5473,7 +5473,7 @@ TEST_F(DebugApiLinuxTest, GivenNoAttentionBitsWhenMultipleThreadsPassedToCheckSt zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; @@ -5522,7 +5522,7 @@ TEST_F(DebugApiLinuxTest, GivenNoAttentionBitsWhenSingleThreadPassedToCheckStopp zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; @@ -5577,7 +5577,7 @@ TEST_F(DebugApiLinuxTest, GivenErrorFromSynchronousAttScanWhenMultipleThreadsPas zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; @@ -5627,7 +5627,7 @@ TEST_F(DebugApiLinuxTest, GivenResumeWARequiredWhenCallingResumeThenWaIsAppliedT auto &l0GfxCoreHelper = neoDevice->getRootDeviceEnvironment().getHelper(); auto &compilerProductHelper = neoDevice->getRootDeviceEnvironment().getHelper(); auto numBytesPerThread = Math::divideAndRoundUp(compilerProductHelper.getNumThreadsPerEu(), 8u); - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); SIP::version version = {2, 0, 0}; initStateSaveArea(sessionMock->stateSaveAreaHeader, version, device); @@ -5677,7 +5677,7 @@ TEST_F(DebugApiLinuxTest, GivenSliceALLWhenCallingResumeThenSliceIdIsNotRemapped zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; @@ -5704,7 +5704,7 @@ TEST_F(DebugApiLinuxTest, GivenErrorFromIoctlWhenCallingResumeThenErrorUnknownIs zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; @@ -5723,7 +5723,7 @@ TEST_F(DebugApiLinuxTest, GivenErrorFromIoctlWhenCallingInterruptImpThenErrorNot zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; @@ -5738,7 +5738,7 @@ TEST_F(DebugApiLinuxTest, WhenCallingThreadControlForThreadStoppedThenProperIoct zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); auto handler = new MockIoctlHandler; @@ -5749,7 +5749,7 @@ TEST_F(DebugApiLinuxTest, WhenCallingThreadControlForThreadStoppedThenProperIoct std::unique_ptr bitmaskOut; size_t bitmaskSizeOut = 0; - auto result = sessionMock->threadControl(threads, 0, MockDebugSessionLinux::ThreadControlCmd::Stopped, bitmaskOut, bitmaskSizeOut); + auto result = sessionMock->threadControl(threads, 0, MockDebugSessionLinuxi915::ThreadControlCmd::Stopped, bitmaskOut, bitmaskSizeOut); EXPECT_EQ(result, ZE_RESULT_SUCCESS); EXPECT_EQ(1, handler->ioctlCalled); @@ -5765,9 +5765,9 @@ TEST_F(DebugApiLinuxTest, givenEnginesEventHandledThenLrcToContextHandleMapIsFil zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t clientHandle = 34; prelim_drm_i915_debug_event_client client = {}; @@ -5834,9 +5834,9 @@ TEST_F(DebugApiLinuxTest, givenTileAttachEnabledWhenDeviceDoesNotHaveTilesThenTi zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; session->createTileSessionsIfEnabled(); EXPECT_FALSE(session->tileSessionsEnabled); @@ -5897,7 +5897,7 @@ TEST_F(DebugApiLinuxPageFaultEventTest, GivenPageFaultEventWIthInvalidClientHand l0GfxCoreHelper.getAttentionBitmaskForSingleThreads(threads, hwInfo, bitmaskResolved, bitmaskSize); bitmaskSize = std::min(size_t(128), bitmaskSize); - buildPfi915Event(MockDebugSessionLinux::invalidClientHandle); + buildPfi915Event(MockDebugSessionLinuxi915::invalidClientHandle); sessionMock->handleEvent(reinterpret_cast(data)); EXPECT_EQ(0u, sessionMock->newlyStoppedThreads.size()); @@ -5973,9 +5973,9 @@ TEST_F(DebugApiLinuxAttentionTest, GivenEuAttentionEventForThreadsWhenHandlingEv zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t ctxHandle = 2; uint64_t vmHandle = 7; @@ -5987,11 +5987,11 @@ TEST_F(DebugApiLinuxAttentionTest, GivenEuAttentionEventForThreadsWhenHandlingEv initStateSaveArea(sessionMock->stateSaveAreaHeader, version, device); handler->setPreadMemory(sessionMock->stateSaveAreaHeader.data(), sessionMock->stateSaveAreaHeader.size(), 0x1000); - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; - DebugSessionLinux::BindInfo cssaInfo = {0x1000, sessionMock->stateSaveAreaHeader.size()}; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; + DebugSessionLinuxi915::BindInfo cssaInfo = {0x1000, sessionMock->stateSaveAreaHeader.size()}; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; uint8_t data[sizeof(prelim_drm_i915_debug_event_eu_attention) + 128]; std::unique_ptr bitmask; @@ -6018,7 +6018,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenEuAttentionEventForThreadsWhenHandlingEv attention.base.type = PRELIM_DRM_I915_DEBUG_EVENT_EU_ATTENTION; attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention) + std::min(uint32_t(128), static_cast(bitmaskSize)); - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = 0; @@ -6037,9 +6037,9 @@ TEST_F(DebugApiLinuxAttentionTest, GivenEuAttentionEventWithInvalidClientWhenHan zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint8_t data[sizeof(prelim_drm_i915_debug_event_eu_attention) + 128]; std::unique_ptr bitmask; @@ -6064,7 +6064,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenEuAttentionEventWithInvalidClientWhenHan attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention) + std::min(uint32_t(128), static_cast(bitmaskSize)); - attention.client_handle = MockDebugSessionLinux::invalidClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::invalidClientHandle; attention.flags = 0; attention.ci.engine_class = 0; attention.ci.engine_instance = 0; @@ -6083,16 +6083,16 @@ TEST_F(DebugApiLinuxAttentionTest, GivenEuAttentionEventEmptyBitmaskWhenHandling zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t ctxHandle = 2; uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; uint8_t data[sizeof(prelim_drm_i915_debug_event_eu_attention) + sizeof(uint64_t)]; prelim_drm_i915_debug_event_eu_attention attention = {}; @@ -6100,7 +6100,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenEuAttentionEventEmptyBitmaskWhenHandling attention.base.type = PRELIM_DRM_I915_DEBUG_EVENT_EU_ATTENTION; attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention) + sizeof(uint64_t); - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = 0; @@ -6122,9 +6122,9 @@ TEST_F(DebugApiLinuxAttentionTest, GivenInterruptedThreadsWhenOnlySomeThreadsRai zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto handler = new MockIoctlHandler; sessionMock->ioctlHandler.reset(handler); @@ -6132,9 +6132,9 @@ TEST_F(DebugApiLinuxAttentionTest, GivenInterruptedThreadsWhenOnlySomeThreadsRai uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {0x1000, 0x1000}; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {0x1000, 0x1000}; uint8_t data[sizeof(prelim_drm_i915_debug_event_eu_attention) + 128]; std::unique_ptr bitmask; @@ -6165,7 +6165,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenInterruptedThreadsWhenOnlySomeThreadsRai attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention) + std::min(uint32_t(128), static_cast(bitmaskSize)); attention.base.seqno = 2; - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = 0; @@ -6225,9 +6225,9 @@ TEST_F(DebugApiLinuxAttentionTest, GivenSentInterruptWhenHandlingAttEventThenAtt zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto handler = new MockIoctlHandler; sessionMock->ioctlHandler.reset(handler); SIP::version version = {2, 0, 0}; @@ -6238,9 +6238,9 @@ TEST_F(DebugApiLinuxAttentionTest, GivenSentInterruptWhenHandlingAttEventThenAtt uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {0x1000, 0x1000}; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {0x1000, 0x1000}; uint8_t data[sizeof(prelim_drm_i915_debug_event_eu_attention) + 128]; auto &hwInfo = neoDevice->getHardwareInfo(); @@ -6270,7 +6270,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenSentInterruptWhenHandlingAttEventThenAtt attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention) + std::min(uint32_t(128), static_cast(bitmaskSize)); attention.base.seqno = 2; - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = 0; @@ -6293,9 +6293,9 @@ TEST_F(DebugApiLinuxAttentionTest, GivenSentInterruptWhenSynchronouslyScannedAtt zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto handler = new MockIoctlHandler; sessionMock->ioctlHandler.reset(handler); SIP::version version = {2, 0, 0}; @@ -6306,10 +6306,10 @@ TEST_F(DebugApiLinuxAttentionTest, GivenSentInterruptWhenSynchronouslyScannedAtt uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; - DebugSessionLinux::BindInfo cssaInfo = {0x1000, sessionMock->stateSaveAreaHeader.size()}; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + DebugSessionLinuxi915::BindInfo cssaInfo = {0x1000, sessionMock->stateSaveAreaHeader.size()}; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; uint8_t data[sizeof(prelim_drm_i915_debug_event_eu_attention) + 128]; auto &hwInfo = neoDevice->getHardwareInfo(); @@ -6339,7 +6339,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenSentInterruptWhenSynchronouslyScannedAtt attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention) + std::min(uint32_t(128), static_cast(bitmaskSize)); attention.base.seqno = 2; - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = 0; @@ -6375,16 +6375,16 @@ TEST_F(DebugApiLinuxAttentionTest, GivenInterruptedThreadsWhenAttentionEventRece zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t ctxHandle = 2; uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; uint8_t data[sizeof(prelim_drm_i915_debug_event_eu_attention) + 128]; ze_device_thread_t thread{0, 0, 0, 0}; @@ -6400,7 +6400,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenInterruptedThreadsWhenAttentionEventRece attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention); attention.base.seqno = 2; - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = 0; @@ -6426,9 +6426,9 @@ TEST_F(DebugApiLinuxAttentionTest, GivenEventSeqnoLowerEqualThanSentInterruptWhe zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint8_t data[sizeof(prelim_drm_i915_debug_event_eu_attention) + 128]; std::unique_ptr bitmask; @@ -6457,7 +6457,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenEventSeqnoLowerEqualThanSentInterruptWhe attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.seqno = 3; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention) + std::min(uint32_t(128), static_cast(bitmaskSize)); - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.flags = 0; attention.ci.engine_class = 0; attention.ci.engine_instance = 0; @@ -6478,21 +6478,21 @@ TEST_F(DebugApiLinuxAttentionTest, GivenLrcToContextMapEmptyWhenHandlingAttentio zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t ctxHandle = 2; uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; prelim_drm_i915_debug_event_eu_attention attention = {}; attention.base.type = PRELIM_DRM_I915_DEBUG_EVENT_EU_ATTENTION; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention); attention.base.seqno = 2; - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = 0; @@ -6510,20 +6510,20 @@ TEST_F(DebugApiLinuxAttentionTest, GivenContextHandleNotFoundWhenHandlingAttenti zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t ctxHandle = 2; uint64_t lrcHandle = 8; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; prelim_drm_i915_debug_event_eu_attention attention = {}; attention.base.type = PRELIM_DRM_I915_DEBUG_EVENT_EU_ATTENTION; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention); attention.base.seqno = 2; - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = 0; @@ -6541,22 +6541,22 @@ TEST_F(DebugApiLinuxAttentionTest, GivenInvalidVmHandleWhenHandlingAttentionEven zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t ctxHandle = 2; - uint64_t vmHandle = DebugSessionLinux::invalidHandle; + uint64_t vmHandle = DebugSessionLinuxi915::invalidHandle; uint64_t lrcHandle = 8; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; prelim_drm_i915_debug_event_eu_attention attention = {}; attention.base.type = PRELIM_DRM_I915_DEBUG_EVENT_EU_ATTENTION; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention); attention.base.seqno = 2; - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = 0; @@ -6574,16 +6574,16 @@ TEST_F(DebugApiLinuxAttentionTest, GivenNoStateSaveAreaOrInvalidSizeWhenHandling zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t ctxHandle = 2; uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; uint8_t data[sizeof(prelim_drm_i915_debug_event_eu_attention) + 128]; std::unique_ptr bitmask; @@ -6601,7 +6601,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenNoStateSaveAreaOrInvalidSizeWhenHandling attention.base.type = PRELIM_DRM_I915_DEBUG_EVENT_EU_ATTENTION; attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention) + std::min(uint32_t(128), static_cast(bitmaskSize)); - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = 0; @@ -6616,7 +6616,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenNoStateSaveAreaOrInvalidSizeWhenHandling EXPECT_EQ(0u, sessionMock->newlyStoppedThreads.size()); EXPECT_EQ(0u, sessionMock->readSystemRoutineIdentFromMemoryCallCount); - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {0x1234000, 0}; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {0x1234000, 0}; sessionMock->handleEvent(reinterpret_cast(data)); EXPECT_EQ(0u, sessionMock->newlyStoppedThreads.size()); @@ -6627,9 +6627,9 @@ TEST_F(DebugApiLinuxAttentionTest, GivenAlreadyStoppedThreadsWhenHandlingAttEven zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, device, 10); + auto sessionMock = std::make_unique(config, device, 10); ASSERT_NE(nullptr, sessionMock); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto handler = new MockIoctlHandler; sessionMock->ioctlHandler.reset(handler); SIP::version version = {2, 0, 0}; @@ -6640,10 +6640,10 @@ TEST_F(DebugApiLinuxAttentionTest, GivenAlreadyStoppedThreadsWhenHandlingAttEven uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; - DebugSessionLinux::BindInfo cssaInfo = {0x1000, sessionMock->stateSaveAreaHeader.size()}; - sessionMock->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + DebugSessionLinuxi915::BindInfo cssaInfo = {0x1000, sessionMock->stateSaveAreaHeader.size()}; + sessionMock->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; uint8_t data[sizeof(prelim_drm_i915_debug_event_eu_attention) + 128]; auto &hwInfo = neoDevice->getHardwareInfo(); @@ -6668,7 +6668,7 @@ TEST_F(DebugApiLinuxAttentionTest, GivenAlreadyStoppedThreadsWhenHandlingAttEven attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention) + std::min(uint32_t(128), static_cast(bitmaskSize)); attention.base.seqno = 2; - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = 0; @@ -6693,13 +6693,13 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenPollReturnsErrorAndEinvalWhenReadingIn zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; handler->pollRetVal = -1; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; errno = EINVAL; session->readInternalEventsAsync(); @@ -6717,13 +6717,13 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenPollReturnsErrorAndEBusyWhenReadingInt zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; handler->pollRetVal = -1; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; errno = EBUSY; session->readInternalEventsAsync(); @@ -6736,13 +6736,13 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenPollReturnsZeroWhenReadingInternalEven zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; handler->pollRetVal = 0; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; session->readInternalEventsAsync(); EXPECT_EQ(0, handler->ioctlCalled); @@ -6755,13 +6755,13 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenPollReturnsNonZeroWhenReadingInternalE zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; handler->pollRetVal = 1; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; session->synchronousInternalEventRead = true; uint64_t clientHandle = 2; @@ -6779,7 +6779,7 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenPollReturnsNonZeroWhenReadingInternalE constexpr int dummyReadEventCount = 1; EXPECT_EQ(clientEventCount + dummyReadEventCount, handler->ioctlCalled); - EXPECT_EQ(DebugSessionLinux::maxEventSize, handler->debugEventInput.size); + EXPECT_EQ(DebugSessionLinuxi915::maxEventSize, handler->debugEventInput.size); EXPECT_EQ(static_cast(PRELIM_DRM_I915_DEBUG_EVENT_READ), handler->debugEventInput.type); } @@ -6787,13 +6787,13 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenEventsAvailableWhenHandlingEventsAsync zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; handler->pollRetVal = 1; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; session->synchronousInternalEventRead = true; uint64_t clientHandle = 2; @@ -6817,13 +6817,13 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenOutOfOrderEventsForIsaWithoutAckNeeded zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; handler->pollRetVal = 1; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; session->synchronousInternalEventRead = true; uint64_t isaUUID = 10; @@ -6831,7 +6831,7 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenOutOfOrderEventsForIsaWithoutAckNeeded uint32_t devices = static_cast(device->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -6839,8 +6839,8 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenOutOfOrderEventsForIsaWithoutAckNeeded .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->classHandleToIndex[isaClassHandle] = {"ISA", static_cast(NEO::DrmResourceClass::Isa)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->classHandleToIndex[isaClassHandle] = {"ISA", static_cast(NEO::DrmResourceClass::Isa)}; uint64_t vmBindIsaData[sizeof(prelim_drm_i915_debug_event_vm_bind) / sizeof(uint64_t) + 3 * sizeof(typeOfUUID)]; prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); @@ -6850,7 +6850,7 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenOutOfOrderEventsForIsaWithoutAckNeeded vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 1 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 20u; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = 0x1234000; vmBindIsa->va_length = 0x1000; vmBindIsa->vm_handle = 10; @@ -6863,13 +6863,13 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenOutOfOrderEventsForIsaWithoutAckNeeded memcpy(uuids, uuidsTemp, sizeof(uuidsTemp)); uint64_t contextHandle = 12; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[contextHandle]; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[contextHandle]; prelim_drm_i915_debug_event_context_param contextParamEvent = {}; contextParamEvent.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; contextParamEvent.base.size = sizeof(prelim_drm_i915_debug_event_context_param); - contextParamEvent.client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent.client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent.ctx_handle = contextHandle; contextParamEvent.param = {.ctx_id = static_cast(contextHandle), .size = 8, .param = I915_CONTEXT_PARAM_VM, .value = 10}; @@ -6879,7 +6879,7 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenOutOfOrderEventsForIsaWithoutAckNeeded contextParamEvent2->base.type = PRELIM_DRM_I915_DEBUG_EVENT_CONTEXT_PARAM; contextParamEvent2->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; contextParamEvent2->base.size = size; - contextParamEvent2->client_handle = MockDebugSessionLinux::mockClientHandle; + contextParamEvent2->client_handle = MockDebugSessionLinuxi915::mockClientHandle; contextParamEvent2->ctx_handle = contextHandle; auto offset = offsetof(prelim_drm_i915_debug_event_context_param, param); @@ -6920,13 +6920,13 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenPollReturnsNonZeroWhenReadingEventsAsy zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; handler->pollRetVal = 1; session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; uint64_t clientHandle = 2; prelim_drm_i915_debug_event_client client = {}; @@ -6943,7 +6943,7 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenPollReturnsNonZeroWhenReadingEventsAsy session->readInternalEventsAsync(); EXPECT_EQ(3, handler->ioctlCalled); - EXPECT_EQ(DebugSessionLinux::maxEventSize, handler->debugEventInput.size); + EXPECT_EQ(DebugSessionLinuxi915::maxEventSize, handler->debugEventInput.size); EXPECT_EQ(static_cast(PRELIM_DRM_I915_DEBUG_EVENT_READ), handler->debugEventInput.type); EXPECT_EQ(3u, session->internalEventQueue.size()); } @@ -6952,10 +6952,10 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenDebugSessionWhenStartingAndClosingAsyn zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); @@ -6978,10 +6978,10 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenDebugSessionWhenStartingAndClosingInte zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); @@ -7002,10 +7002,10 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenDebugSessionWithAsyncThreadWhenClosing zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); @@ -7028,10 +7028,10 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenNoEventsAvailableWithinTimeoutWhenRead zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; zet_debug_event_t outputEvent = {}; outputEvent.type = ZET_DEBUG_EVENT_TYPE_PROCESS_ENTRY; @@ -7046,14 +7046,14 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenInterruptedThreadsWhenNoAttentionEvent zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); - session->returnTimeDiff = DebugSessionLinux::interruptTimeout * 10; + session->returnTimeDiff = DebugSessionLinuxi915::interruptTimeout * 10; session->synchronousInternalEventRead = true; ze_device_thread_t thread = {0, 0, 0, UINT32_MAX}; @@ -7080,10 +7080,10 @@ TEST_F(DebugApiLinuxAsyncThreadTest, GivenInterruptedThreadsWhenNoAttentionEvent zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, device, 10); + auto session = std::make_unique(config, device, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; auto handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); @@ -7113,12 +7113,12 @@ struct DebugApiRegistersAccessFixture : public DebugApiLinuxFixture { mockBuiltins = new MockBuiltins(); mockBuiltins->stateSaveAreaHeader = MockSipData::createStateSaveAreaHeader(1); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->builtins.reset(mockBuiltins); - session = std::make_unique(zet_debug_config_t{}, device, 0); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + session = std::make_unique(zet_debug_config_t{}, device, 0); + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; auto &gfxCoreHelper = device->getGfxCoreHelper(); maxDbgSurfaceSize = gfxCoreHelper.getSipKernelMaxDbgSurfaceSize(hwInfo); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {stateSaveAreaGpuVa, maxDbgSurfaceSize}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = {stateSaveAreaGpuVa, maxDbgSurfaceSize}; session->allThreadsStopped = true; session->allThreads[stoppedThreadId]->stopThread(1u); session->allThreads[stoppedThreadId]->reportAsStopped(); @@ -7128,7 +7128,7 @@ struct DebugApiRegistersAccessFixture : public DebugApiLinuxFixture { DebugApiLinuxFixture::tearDown(); } NEO::HardwareInfo hwInfo; - std::unique_ptr session; + std::unique_ptr session; MockBuiltins *mockBuiltins = nullptr; MockIoctlHandler *ioctlHandler = nullptr; uint64_t ctxHandle = 2; @@ -7142,7 +7142,7 @@ struct DebugApiRegistersAccessFixture : public DebugApiLinuxFixture { using DebugApiRegistersAccessTest = Test; TEST_F(DebugApiRegistersAccessTest, givenInvalidClientHandleWhenReadRegistersCalledThenErrorIsReturned) { - session->clientHandle = MockDebugSessionLinux::invalidClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::invalidClientHandle; EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, zetDebugReadRegisters(session->toHandle(), {0, 0, 0, 0}, ZET_DEBUG_REGSET_TYPE_GRF_INTEL_GPU, 0, 1, nullptr)); } @@ -7174,12 +7174,12 @@ TEST_F(DebugApiRegistersAccessTest, givenInvalidRegistersIndicesWhenReadRegister } TEST_F(DebugApiRegistersAccessTest, givenStateSaveAreaNotCapturedWhenReadRegistersIsCalledThenErrorUnknownIsReturned) { - auto bindInfoSave = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle]; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo.clear(); + auto bindInfoSave = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle]; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo.clear(); char r0[32]; EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, zetDebugReadRegisters(session->toHandle(), {0, 0, 0, 0}, ZET_DEBUG_REGSET_TYPE_GRF_INTEL_GPU, 0, 1, r0)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = bindInfoSave; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = bindInfoSave; } TEST_F(DebugApiRegistersAccessTest, givenReadGpuMemoryFailedWhenReadRegistersCalledThenErrorUnknownIsReturned) { @@ -7247,7 +7247,7 @@ TEST_F(DebugApiRegistersAccessTest, givenReadRegistersCalledCorrectValuesRead) { } TEST_F(DebugApiRegistersAccessTest, givenInvalidClientHandleWhenWriteRegistersCalledThenErrorIsReturned) { - session->clientHandle = MockDebugSessionLinux::invalidClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::invalidClientHandle; EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, zetDebugWriteRegisters(session->toHandle(), {0, 0, 0, 0}, ZET_DEBUG_REGSET_TYPE_GRF_INTEL_GPU, 0, 1, nullptr)); } @@ -7273,12 +7273,12 @@ TEST_F(DebugApiRegistersAccessTest, givenInvalidRegistersIndicesWhenWriteRegiste } TEST_F(DebugApiRegistersAccessTest, givenStateSaveAreaNotCapturedWhenWriteRegistersIsCalledThenErrorUnknownIsReturned) { - auto bindInfoSave = session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle]; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo.clear(); + auto bindInfoSave = session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle]; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo.clear(); char r0[32]; EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, zetDebugWriteRegisters(session->toHandle(), stoppedThread, ZET_DEBUG_REGSET_TYPE_GRF_INTEL_GPU, 0, 1, r0)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = bindInfoSave; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = bindInfoSave; } TEST_F(DebugApiRegistersAccessTest, givenWriteGpuMemoryFailedWhenWriteRegistersCalledThenErrorUnknownIsReturned) { @@ -7415,7 +7415,7 @@ TEST_F(DebugApiRegistersAccessTest, GivenSipNotUpdatingSipCmdThenAccessToSlmFail session->ioctlHandler.reset(ioctlHandler); session->vmHandle = 7; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToStateBaseAreaBindInfo[vmHandle] = {stateSaveAreaGpuVa + maxDbgSurfaceSize, sizeof(SbaTrackedAddresses)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToStateBaseAreaBindInfo[vmHandle] = {stateSaveAreaGpuVa + maxDbgSurfaceSize, sizeof(SbaTrackedAddresses)}; ze_device_thread_t thread; thread.slice = 0; @@ -7449,7 +7449,7 @@ TEST_F(DebugApiRegistersAccessTest, GivenNoVmHandleWhenReadingSystemRoutineIdent EuThread thread({0, 0, 0, 0, 0}); SIP::sr_ident srIdent = {{0}}; - auto result = session->readSystemRoutineIdent(&thread, DebugSessionLinux::invalidHandle, srIdent); + auto result = session->readSystemRoutineIdent(&thread, DebugSessionLinuxi915::invalidHandle, srIdent); EXPECT_FALSE(result); } @@ -7493,7 +7493,7 @@ TEST_F(DebugApiRegistersAccessTest, GivenCSSANotBoundWhenReadingSystemRoutineIde ioctlHandler->mmapBase = stateSaveAreaGpuVa; session->ioctlHandler.reset(ioctlHandler); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo.clear(); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo.clear(); EuThread thread({0, 0, 0, 0, 0}); @@ -7504,7 +7504,7 @@ TEST_F(DebugApiRegistersAccessTest, GivenCSSANotBoundWhenReadingSystemRoutineIde } TEST_F(DebugApiRegistersAccessTest, GivenThreadWithInvalidVmIdWhenReadSbaBufferCalledThenErrorNotAvailableIsReturned) { - session->vmHandle = L0::DebugSessionLinux::invalidHandle; + session->vmHandle = L0::DebugSessionLinuxi915::invalidHandle; ze_device_thread_t thread{0, 0, 0, 0}; session->ensureThreadStopped(thread); SbaTrackedAddresses sba; @@ -7515,7 +7515,7 @@ TEST_F(DebugApiRegistersAccessTest, GivenVmHandleNotFoundWhenReadSbaBufferCalled session->vmHandle = 7; ze_device_thread_t thread{0, 0, 0, 0}; session->ensureThreadStopped(thread); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToStateBaseAreaBindInfo.clear(); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToStateBaseAreaBindInfo.clear(); SbaTrackedAddresses sba; EXPECT_EQ(ZE_RESULT_ERROR_UNKNOWN, session->readSbaBuffer(session->convertToThreadId(thread), sba)); } @@ -7564,7 +7564,7 @@ TEST_F(DebugApiRegistersAccessTest, GivenReadSbaBufferCalledThenSbaBufferIsRead) session->ioctlHandler.reset(ioctlHandler); session->vmHandle = 7; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToStateBaseAreaBindInfo[vmHandle] = {stateSaveAreaGpuVa + maxDbgSurfaceSize, sizeof(SbaTrackedAddresses)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToStateBaseAreaBindInfo[vmHandle] = {stateSaveAreaGpuVa + maxDbgSurfaceSize, sizeof(SbaTrackedAddresses)}; ze_device_thread_t thread{0, 0, 0, 0}; session->ensureThreadStopped(thread); @@ -7603,7 +7603,7 @@ TEST_F(DebugApiRegistersAccessTest, GivenReadSbaRegistersCalledThenSbaRegistersA session->ioctlHandler.reset(ioctlHandler); session->vmHandle = 7; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToStateBaseAreaBindInfo[vmHandle] = {stateSaveAreaGpuVa + maxDbgSurfaceSize, sizeof(SbaTrackedAddresses)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToStateBaseAreaBindInfo[vmHandle] = {stateSaveAreaGpuVa + maxDbgSurfaceSize, sizeof(SbaTrackedAddresses)}; ze_device_thread_t thread{0, 0, 0, 0}; session->ensureThreadStopped(thread); @@ -7650,7 +7650,7 @@ TEST_F(DebugApiRegistersAccessTest, GivenScarcthPointerAndZeroAddressInSurfaceSt session->ioctlHandler.reset(ioctlHandler); session->vmHandle = 7; - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToStateBaseAreaBindInfo[vmHandle] = {stateSaveAreaGpuVa + maxDbgSurfaceSize, sizeof(SbaTrackedAddresses)}; + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToStateBaseAreaBindInfo[vmHandle] = {stateSaveAreaGpuVa + maxDbgSurfaceSize, sizeof(SbaTrackedAddresses)}; ze_device_thread_t thread{0, 3, 7, 3}; session->ensureThreadStopped(thread); @@ -7698,7 +7698,7 @@ TEST_F(DebugApiLinuxMultitileTest, GivenRootDeviceAndTileAttachDisabledWhenDebug zet_debug_config_t config = {}; - auto session = std::make_unique(config, deviceImp, 1); + auto session = std::make_unique(config, deviceImp, 1); auto handler = new MockIoctlHandler; handler->pollRetVal = 1; session->ioctlHandler.reset(handler); @@ -7723,7 +7723,7 @@ TEST_F(DebugApiLinuxMultitileTest, GivenRootDeviceAndTileAttachDisabledWhenDebug TEST_F(DebugApiLinuxMultitileTest, GivenRootDeviceAndRootAttachModeWhenDebugSessionInitializedThenEuThreadsAreCreated) { zet_debug_config_t config = {}; - auto session = std::make_unique(config, deviceImp, 1); + auto session = std::make_unique(config, deviceImp, 1); auto handler = new MockIoctlHandler; handler->pollRetVal = 1; session->ioctlHandler.reset(handler); @@ -7752,7 +7752,7 @@ TEST_F(DebugApiLinuxMultitileTest, GivenRootDeviceWhenDebugAttachCalledThenRootS zet_debug_session_handle_t debugSession = nullptr; VariableBackup mockCreateDebugSessionBackup(&L0::ult::createDebugSessionFunc, [](const zet_debug_config_t &config, L0::Device *device, int debugFd, void *params) -> DebugSession * { - auto session = new MockDebugSessionLinux(config, device, debugFd); + auto session = new MockDebugSessionLinuxi915(config, device, debugFd); session->initializeRetVal = ZE_RESULT_SUCCESS; return session; }); @@ -7763,7 +7763,7 @@ TEST_F(DebugApiLinuxMultitileTest, GivenRootDeviceWhenDebugAttachCalledThenRootS EXPECT_TRUE(deviceImp->getDebugSession(config)->isAttached()); - auto session = static_cast(deviceImp->getDebugSession(config)); + auto session = static_cast(deviceImp->getDebugSession(config)); EXPECT_FALSE(session->tileAttachEnabled); result = zetDebugAttach(deviceImp->subDevices[0]->toHandle(), &config, &debugSession); @@ -7779,7 +7779,7 @@ TEST_F(DebugApiLinuxMultitileTest, GivenSubDeviceWhenDebugAttachCalledThenTileSe zet_debug_session_handle_t debugSessionRoot = nullptr; VariableBackup mockCreateDebugSessionBackup(&L0::ult::createDebugSessionFunc, [](const zet_debug_config_t &config, L0::Device *device, int debugFd, void *params) -> DebugSession * { - auto session = new MockDebugSessionLinux(config, device, debugFd); + auto session = new MockDebugSessionLinuxi915(config, device, debugFd); session->initializeRetVal = ZE_RESULT_SUCCESS; return session; }); @@ -7790,7 +7790,7 @@ TEST_F(DebugApiLinuxMultitileTest, GivenSubDeviceWhenDebugAttachCalledThenTileSe EXPECT_FALSE(deviceImp->getDebugSession(config)->isAttached()); - auto session = static_cast(deviceImp->getDebugSession(config)); + auto session = static_cast(deviceImp->getDebugSession(config)); EXPECT_TRUE(session->tileAttachEnabled); result = zetDebugAttach(deviceImp->toHandle(), &config, &debugSessionRoot); @@ -7804,14 +7804,14 @@ TEST_F(DebugApiLinuxMultitileTest, GivenMultitileDeviceWhenCallingResumeThenThre zet_debug_config_t config = {}; config.pid = 0x1234; - auto sessionMock = std::make_unique(config, deviceImp, 10); + auto sessionMock = std::make_unique(config, deviceImp, 10); ASSERT_NE(nullptr, sessionMock); SIP::version version = {2, 0, 0}; initStateSaveArea(sessionMock->stateSaveAreaHeader, version, deviceImp); auto handler = new MockIoctlHandler; sessionMock->ioctlHandler.reset(handler); - sessionMock->clientHandle = MockDebugSessionLinux::mockClientHandle; + sessionMock->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; sessionMock->clientHandleToConnection[sessionMock->clientHandle]->vmToContextStateSaveAreaBindInfo[1u] = {0x1000, 0x1000}; zet_debug_session_handle_t session = sessionMock->toHandle(); @@ -7850,7 +7850,7 @@ TEST_F(DebugApiLinuxMultitileTest, givenApiThreadAndMultipleTilesWhenGettingDevi zet_debug_config_t config = {}; config.pid = 0x1234; - auto debugSession = std::make_unique(config, deviceImp, 10); + auto debugSession = std::make_unique(config, deviceImp, 10); ASSERT_NE(nullptr, debugSession); ze_device_thread_t thread = {sliceCount * 2 - 1, 0, 0, 0}; @@ -7866,13 +7866,13 @@ TEST_F(DebugApiLinuxMultitileTest, givenApiThreadAndMultipleTilesWhenGettingDevi deviceIndex = debugSession->getDeviceIndexFromApiThread(thread); EXPECT_EQ(UINT32_MAX, deviceIndex); - debugSession = std::make_unique(zet_debug_config_t{0x1234}, deviceImp->subDevices[0], 10); + debugSession = std::make_unique(zet_debug_config_t{0x1234}, deviceImp->subDevices[0], 10); thread = {sliceCount - 1, 0, 0, 0}; deviceIndex = debugSession->getDeviceIndexFromApiThread(thread); EXPECT_EQ(0u, deviceIndex); - debugSession = std::make_unique(zet_debug_config_t{0x1234}, deviceImp->subDevices[1], 10); + debugSession = std::make_unique(zet_debug_config_t{0x1234}, deviceImp->subDevices[1], 10); thread = {sliceCount - 1, 0, 0, 0}; deviceIndex = debugSession->getDeviceIndexFromApiThread(thread); @@ -7880,16 +7880,16 @@ TEST_F(DebugApiLinuxMultitileTest, givenApiThreadAndMultipleTilesWhenGettingDevi } template -struct DebugApiLinuxMultiDeviceVmBindFixture : public DebugApiLinuxMultiDeviceFixture, public MockDebugSessionLinuxHelper { +struct DebugApiLinuxMultiDeviceVmBindFixture : public DebugApiLinuxMultiDeviceFixture, public MockDebugSessionLinuxi915Helper { void setUp() { DebugApiLinuxMultiDeviceFixture::setUp(); zet_debug_config_t config = {}; config.pid = 0x1234; - session = std::make_unique(config, deviceImp, 10); + session = std::make_unique(config, deviceImp, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; handler = new MockIoctlHandler; session->ioctlHandler.reset(handler); @@ -7909,7 +7909,7 @@ struct DebugApiLinuxMultiDeviceVmBindFixture : public DebugApiLinuxMultiDeviceFi uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -7917,7 +7917,7 @@ struct DebugApiLinuxMultiDeviceVmBindFixture : public DebugApiLinuxMultiDeviceFi .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); // VM BIND events for 2 kernels from zebin in vm0 - tile0 addZebinVmBindEvent(session.get(), vm0, true, true, 0); @@ -7960,7 +7960,7 @@ struct DebugApiLinuxMultiDeviceVmBindFixture : public DebugApiLinuxMultiDeviceFi } MockIoctlHandler *handler = nullptr; - std::unique_ptr session; + std::unique_ptr session; }; using DebugApiLinuxMultiDeviceVmBindTest = Test>; @@ -7972,7 +7972,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenHandlingVmBi uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -7980,7 +7980,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenHandlingVmBi .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addIsaVmBindEvent(session.get(), vm0, true, true); @@ -8008,7 +8008,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenHandlingVmBi uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8016,7 +8016,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenHandlingVmBi .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addIsaVmBindEvent(session.get(), vm0, false, true); addIsaVmBindEvent(session.get(), vm1, false, true); @@ -8054,7 +8054,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndZebinModuleWh uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8062,7 +8062,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndZebinModuleWh .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addZebinVmBindEvent(session.get(), vm0, true, true, 0); EXPECT_EQ(1u, handler->ackCount); @@ -8081,8 +8081,8 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndZebinModuleWh EXPECT_EQ(3u, handler->ackCount); EXPECT_EQ(1u, session->apiEvents.size()); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); - EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[1].size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(1u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[1].size()); zet_debug_event_t event; auto result = session->readEvent(0, &event); @@ -8107,7 +8107,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8115,7 +8115,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addZebinVmBindEvent(session.get(), vm0, true, true, 0); addZebinVmBindEvent(session.get(), vm0, true, true, 1); @@ -8131,8 +8131,8 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi // No ACK ioctl called EXPECT_EQ(0u, handler->ackCount); EXPECT_EQ(1u, session->apiEvents.size()); - EXPECT_EQ(kernelCount, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); - EXPECT_EQ(kernelCount, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[1].size()); + EXPECT_EQ(kernelCount, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(kernelCount, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[1].size()); zet_debug_event_t event; auto result = session->readEvent(0, &event); @@ -8154,7 +8154,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi handler->debugEventAcked.seqno = std::numeric_limits::max(); uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8162,7 +8162,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addZebinVmBindEvent(session.get(), vm0, true, true, 0); addZebinVmBindEvent(session.get(), vm0, true, true, 1); @@ -8185,10 +8185,10 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(4u, handler->ackCount); - EXPECT_TRUE(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].moduleLoadEventAcked[0]); - EXPECT_TRUE(session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].moduleLoadEventAcked[1]); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[1].size()); + EXPECT_TRUE(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].moduleLoadEventAcked[0]); + EXPECT_TRUE(session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].moduleLoadEventAcked[1]); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[1].size()); } TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebinModuleWhenModuleUUIDIsNotFoundThenAcknowledgeCallsDebugBreakAndReturnsSuccess) { @@ -8198,7 +8198,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi handler->debugEventAcked.seqno = std::numeric_limits::max(); uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8206,7 +8206,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addZebinVmBindEvent(session.get(), vm0, true, true, 0); addZebinVmBindEvent(session.get(), vm0, true, true, 1); @@ -8223,7 +8223,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenTileInstancedIsaAndZebi EXPECT_EQ(ZET_DEBUG_EVENT_TYPE_MODULE_LOAD, event.type); EXPECT_EQ(ZET_DEBUG_EVENT_FLAG_NEED_ACK, event.flags); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.erase(zebinModuleUUID); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.erase(zebinModuleUUID); result = zetDebugAcknowledgeEvent(session->toHandle(), &event); EXPECT_EQ(ZE_RESULT_SUCCESS, result); @@ -8239,7 +8239,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenZebinModuleForTileWitho uint32_t devices = static_cast(deviceImp->getNEODevice()->getSubDevice(0)->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8247,7 +8247,7 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenZebinModuleForTileWitho .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addZebinVmBindEvent(session.get(), vm0, false, true, 0); addZebinVmBindEvent(session.get(), vm0, false, true, 1); @@ -8256,8 +8256,8 @@ TEST_F(DebugLinuxMultiDeviceVmBindBlockOnFenceTest, givenZebinModuleForTileWitho // No ACK ioctl called EXPECT_EQ(0u, handler->ackCount); EXPECT_EQ(1u, session->apiEvents.size()); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); - EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[1].size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(0u, session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[1].size()); zet_debug_event_t event; auto result = session->readEvent(0, &event); @@ -8274,7 +8274,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingAndRe uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8282,7 +8282,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingAndRe .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addIsaVmBindEvent(session.get(), vm0, false, true); addIsaVmBindEvent(session.get(), vm1, false, true); @@ -8315,7 +8315,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingMemor uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8323,7 +8323,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingMemor .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addIsaVmBindEvent(session.get(), vm0, false, true); addIsaVmBindEvent(session.get(), vm1, false, true); @@ -8347,7 +8347,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenSingleIsaWithInvalidVmWhenReadin uint32_t devices = static_cast(neoDevice->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8355,7 +8355,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenSingleIsaWithInvalidVmWhenReadin .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); uint64_t vmBindIsaData[sizeof(prelim_drm_i915_debug_event_vm_bind) / sizeof(uint64_t) + 3 * sizeof(typeOfUUID)]; prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); @@ -8366,10 +8366,10 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenSingleIsaWithInvalidVmWhenReadin vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 20u; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; - vmBindIsa->vm_handle = MockDebugSessionLinux::invalidHandle; + vmBindIsa->vm_handle = MockDebugSessionLinuxi915::invalidHandle; vmBindIsa->num_uuids = 2; auto *uuids = reinterpret_cast(ptrOffset(vmBindIsaData, sizeof(prelim_drm_i915_debug_event_vm_bind))); @@ -8402,7 +8402,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndSingleInstanc uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8410,7 +8410,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaAndSingleInstanc .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addIsaVmBindEvent(session.get(), vm1, false, true); @@ -8449,7 +8449,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenIsaWhenGettingIsaInfoForWrongAdd uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8457,7 +8457,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenIsaWhenGettingIsaInfoForWrongAdd .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addIsaVmBindEvent(session.get(), vm0, false, true); @@ -8486,7 +8486,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingAndRe uint32_t devices = static_cast(deviceImp->getNEODevice()->getDeviceBitfield().to_ulong()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8494,7 +8494,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenTileInstancedIsaWhenWritingAndRe .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); addIsaVmBindEvent(session.get(), vm0, false, true); @@ -8524,7 +8524,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenSingleMemoryIsaWhenWritingAndRea uint32_t devices = static_cast(neoDevice->getSubDevice(1)->getDeviceBitfield().to_ulong()); EXPECT_EQ(1u, neoDevice->getSubDevice(1)->getDeviceBitfield().count()); - DebugSessionLinux::UuidData isaUuidData = { + DebugSessionLinuxi915::UuidData isaUuidData = { .handle = isaUUID, .classHandle = isaClassHandle, .classIndex = NEO::DrmResourceClass::Isa, @@ -8532,7 +8532,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenSingleMemoryIsaWhenWritingAndRea .dataSize = sizeof(devices)}; memcpy_s(isaUuidData.data.get(), sizeof(devices), &devices, sizeof(devices)); - session->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); + session->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[isaUUID] = std::move(isaUuidData); uint64_t vmBindIsaData[sizeof(prelim_drm_i915_debug_event_vm_bind) / sizeof(uint64_t) + 3 * sizeof(typeOfUUID)]; prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); @@ -8543,7 +8543,7 @@ TEST_F(DebugApiLinuxMultiDeviceVmBindTest, givenSingleMemoryIsaWhenWritingAndRea vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 20u; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vm1; @@ -8601,7 +8601,7 @@ TEST_F(AffinityMaskMultipleSubdevicesTestLinux, GivenEventWithAckFlagAndTileNotW uint64_t vmBindIsaData[sizeof(prelim_drm_i915_debug_event_vm_bind) / sizeof(uint64_t) + 3 * sizeof(typeOfUUID)]; prelim_drm_i915_debug_event_vm_bind *vmBindIsa = reinterpret_cast(&vmBindIsaData); - auto debugSession = std::make_unique(zet_debug_config_t{1234}, deviceImp, 10); + auto debugSession = std::make_unique(zet_debug_config_t{1234}, deviceImp, 10); auto handler = new MockIoctlHandler; debugSession->ioctlHandler.reset(handler); @@ -8609,7 +8609,7 @@ TEST_F(AffinityMaskMultipleSubdevicesTestLinux, GivenEventWithAckFlagAndTileNotW vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 20u; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = 5; @@ -8630,7 +8630,7 @@ TEST_F(AffinityMaskMultipleSubdevicesTestLinux, GivenEventWithAckFlagAndTileNotW } TEST_F(AffinityMaskMultipleSubdevicesTestLinux, GivenPfEventForTileNotWithinBitfieldWhenHandlingEventThenEventIsSkipped) { - auto debugSession = std::make_unique(zet_debug_config_t{1234}, deviceImp, 10); + auto debugSession = std::make_unique(zet_debug_config_t{1234}, deviceImp, 10); uint64_t ctxHandle = 2; uint64_t vmHandle = 7; @@ -8644,7 +8644,7 @@ TEST_F(AffinityMaskMultipleSubdevicesTestLinux, GivenPfEventForTileNotWithinBitf pf.base.type = PRELIM_DRM_I915_DEBUG_EVENT_PAGE_FAULT; pf.base.flags = 0; pf.base.size = sizeof(prelim_drm_i915_debug_event_page_fault); - pf.client_handle = MockDebugSessionLinux::mockClientHandle; + pf.client_handle = MockDebugSessionLinuxi915::mockClientHandle; pf.lrc_handle = lrcHandle; pf.flags = 0; @@ -8661,7 +8661,7 @@ TEST_F(AffinityMaskMultipleSubdevicesTestLinux, GivenPfEventForTileNotWithinBitf } TEST_F(AffinityMaskMultipleSubdevicesTestLinux, GivenAttEventForTileNotWithinBitfieldWhenHandlingEventThenEventIsSkipped) { - auto debugSession = std::make_unique(zet_debug_config_t{1234}, deviceImp, 10); + auto debugSession = std::make_unique(zet_debug_config_t{1234}, deviceImp, 10); uint64_t ctxHandle = 2; uint64_t vmHandle = 7; @@ -8676,7 +8676,7 @@ TEST_F(AffinityMaskMultipleSubdevicesTestLinux, GivenAttEventForTileNotWithinBit attEvent.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attEvent.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention); attEvent.bitmask_size = 0; - attEvent.client_handle = MockDebugSessionLinux::mockClientHandle; + attEvent.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attEvent.lrc_handle = lrcHandle; attEvent.flags = 0; diff --git a/level_zero/tools/test/unit_tests/sources/debug/linux/tile_debug_session_linux_tests.cpp b/level_zero/tools/test/unit_tests/sources/debug/linux/tile_debug_session_linux_tests.cpp index 8711c3fb26..453d8eff3c 100644 --- a/level_zero/tools/test/unit_tests/sources/debug/linux/tile_debug_session_linux_tests.cpp +++ b/level_zero/tools/test/unit_tests/sources/debug/linux/tile_debug_session_linux_tests.cpp @@ -29,7 +29,7 @@ extern int closeFuncRetVal; namespace L0 { namespace ult { -TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenCallingFunctionsThenImplementationIsEmpty) { +TEST(TileDebugSessionLinuxi915Test, GivenTileDebugSessionWhenCallingFunctionsThenImplementationIsEmpty) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); @@ -37,7 +37,7 @@ TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenCallingFunctionsThenImp Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); - auto session = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, nullptr); + auto session = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, nullptr); ASSERT_NE(nullptr, session); EXPECT_TRUE(session->closeConnection()); @@ -49,19 +49,19 @@ TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenCallingFunctionsThenImp EXPECT_THROW(session->cleanRootSessionAfterDetach(0), std::exception); } -TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenCallingFunctionsThenCallsAreRedirectedToRootSession) { +TEST(TileDebugSessionLinuxi915Test, GivenTileDebugSessionWhenCallingFunctionsThenCallsAreRedirectedToRootSession) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); - auto rootSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); - rootSession->clientHandle = MockDebugSessionLinux::mockClientHandle; + auto rootSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); + rootSession->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; - auto session = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, rootSession.get()); + auto session = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, rootSession.get()); ASSERT_NE(nullptr, session); - DebugSessionLinux::BindInfo cssaInfo = {0x1234000, 0x400}; + DebugSessionLinuxi915::BindInfo cssaInfo = {0x1234000, 0x400}; rootSession->clientHandleToConnection[rootSession->clientHandle]->vmToContextStateSaveAreaBindInfo[5] = cssaInfo; EXPECT_EQ(0x1234000u, session->getContextStateSaveAreaGpuVa(5)); @@ -79,7 +79,7 @@ TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenCallingFunctionsThenCal auto sbaGpuVa = session->getSbaBufferGpuVa(5); EXPECT_EQ(0u, sbaGpuVa); - DebugSessionLinux::BindInfo sbaInfo = {0x567000, 0x200}; + DebugSessionLinuxi915::BindInfo sbaInfo = {0x567000, 0x200}; rootSession->clientHandleToConnection[rootSession->clientHandle]->vmToStateBaseAreaBindInfo[5] = sbaInfo; sbaGpuVa = session->getSbaBufferGpuVa(5); @@ -94,16 +94,16 @@ TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenCallingFunctionsThenCal EXPECT_EQ(1, handler->ioctlCalled); } -TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenReadingContextStateSaveAreaHeaderThenHeaderIsCopiedFromRootSession) { +TEST(TileDebugSessionLinuxi915Test, GivenTileDebugSessionWhenReadingContextStateSaveAreaHeaderThenHeaderIsCopiedFromRootSession) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); - auto rootSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); - rootSession->clientHandle = MockDebugSessionLinux::mockClientHandle; + auto rootSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); + rootSession->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; - auto session = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, rootSession.get()); + auto session = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, rootSession.get()); ASSERT_NE(nullptr, session); session->readStateSaveAreaHeader(); @@ -119,16 +119,16 @@ TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenReadingContextStateSave EXPECT_STREQ(header, data); } -TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenReadingContextStateSaveAreaHeaderThenSlmSupportIsSetFromRootSession) { +TEST(TileDebugSessionLinuxi915Test, GivenTileDebugSessionWhenReadingContextStateSaveAreaHeaderThenSlmSupportIsSetFromRootSession) { auto hwInfo = *NEO::defaultHwInfo.get(); NEO::MockDevice *neoDevice(NEO::MockDevice::createWithNewExecutionEnvironment(&hwInfo, 0)); neoDevice->executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(new NEO::OSInterface); Mock deviceImp(neoDevice, neoDevice->getExecutionEnvironment()); - auto rootSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); - rootSession->clientHandle = MockDebugSessionLinux::mockClientHandle; + auto rootSession = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, 10); + rootSession->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; - auto session = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, rootSession.get()); + auto session = std::make_unique(zet_debug_config_t{0x1234}, &deviceImp, rootSession.get()); ASSERT_NE(nullptr, session); const char *header = "cssa"; @@ -146,7 +146,7 @@ TEST(TileDebugSessionLinuxTest, GivenTileDebugSessionWhenReadingContextStateSave } template -struct TileAttachFixture : public DebugApiLinuxMultiDeviceFixture, public MockDebugSessionLinuxHelper { +struct TileAttachFixture : public DebugApiLinuxMultiDeviceFixture, public MockDebugSessionLinuxi915Helper { void setUp() { NEO::DebugManager.flags.ExperimentalEnableTileAttach.set(1); @@ -154,15 +154,15 @@ struct TileAttachFixture : public DebugApiLinuxMultiDeviceFixture, public MockDe zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, deviceImp, 10); + auto session = std::make_unique(config, deviceImp, 10); ASSERT_NE(nullptr, session); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; session->createTileSessionsIfEnabled(); rootSession = session.get(); rootSession->blockOnFenceMode = BlockOnFence; - tileSessions[0] = static_cast(rootSession->tileSessions[0].first); - tileSessions[1] = static_cast(rootSession->tileSessions[1].first); + tileSessions[0] = static_cast(rootSession->tileSessions[0].first); + tileSessions[1] = static_cast(rootSession->tileSessions[1].first); setupSessionClassHandlesAndUuidMap(session.get()); setupVmToTile(session.get()); @@ -174,8 +174,8 @@ struct TileAttachFixture : public DebugApiLinuxMultiDeviceFixture, public MockDe DebugApiLinuxMultiDeviceFixture::tearDown(); } DebugManagerStateRestore restorer; - MockDebugSessionLinux *rootSession = nullptr; - MockTileDebugSessionLinux *tileSessions[2]; + MockDebugSessionLinuxi915 *rootSession = nullptr; + MockTileDebugSessionLinuxi915 *tileSessions[2]; }; using TileAttachTest = Test>; @@ -184,7 +184,7 @@ TEST_F(TileAttachTest, GivenTileAttachEnabledAndMultitileDeviceWhenInitializingD zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, deviceImp, 10); + auto session = std::make_unique(config, deviceImp, 10); ASSERT_NE(nullptr, session); auto handler = new MockIoctlHandler; @@ -194,11 +194,11 @@ TEST_F(TileAttachTest, GivenTileAttachEnabledAndMultitileDeviceWhenInitializingD clientCreate.base.type = PRELIM_DRM_I915_DEBUG_EVENT_CLIENT; clientCreate.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; clientCreate.base.size = sizeof(prelim_drm_i915_debug_event_client); - clientCreate.handle = MockDebugSessionLinux::mockClientHandle; + clientCreate.handle = MockDebugSessionLinuxi915::mockClientHandle; handler->eventQueue.push({reinterpret_cast(&clientCreate), static_cast(clientCreate.base.size)}); session->ioctlHandler.reset(handler); - session->clientHandle = MockDebugSessionLinux::mockClientHandle; + session->clientHandle = MockDebugSessionLinuxi915::mockClientHandle; session->clientHandleToConnection[session->clientHandle]->vmToContextStateSaveAreaBindInfo[1u] = {0x1000, 0x1000}; session->synchronousInternalEventRead = true; session->initialize(); @@ -228,7 +228,7 @@ TEST_F(TileAttachTest, GivenTileAttachDisabledAndMultitileDeviceWhenCreatingTile zet_debug_config_t config = {}; config.pid = 0x1234; - auto session = std::make_unique(config, deviceImp, 10); + auto session = std::make_unique(config, deviceImp, 10); ASSERT_NE(nullptr, session); session->tileAttachEnabled = false; @@ -325,7 +325,7 @@ TEST_F(TileAttachTest, givenCmdQsCreatedAndDestroyedWhenReadingEventsThenProcess uuid.base.type = PRELIM_DRM_I915_DEBUG_EVENT_UUID; uuid.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE; uuid.base.size = sizeof(prelim_drm_i915_debug_event_uuid); - uuid.client_handle = MockDebugSessionLinux::mockClientHandle; + uuid.client_handle = MockDebugSessionLinuxi915::mockClientHandle; uuid.handle = 2; uuid.payload_size = sizeof(NEO::DebuggerL0::CommandQueueNotification); @@ -452,8 +452,8 @@ TEST_F(TileAttachTest, GivenTileAndVmBindForIsaWithAckWhenReadingEventThenModule EXPECT_EQ(isaGpuVa, event.info.module.load); - auto elf = rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr; - auto elfSize = rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].dataSize; + auto elf = rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr; + auto elfSize = rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].dataSize; EXPECT_EQ(elf, event.info.module.moduleBegin); EXPECT_EQ(elf + elfSize, event.info.module.moduleEnd); @@ -586,7 +586,7 @@ TEST_F(TileAttachTest, GivenElfAddressWhenReadMemoryCalledTheElfMemoryIsRead) { auto handler = new MockIoctlHandler; rootSession->ioctlHandler.reset(handler); - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->elfMap[elfVa] = elfUUID; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->elfMap[elfVa] = elfUUID; ze_device_thread_t thread = {UINT32_MAX, UINT32_MAX, UINT32_MAX, UINT32_MAX}; @@ -731,9 +731,9 @@ TEST_F(TileAttachTest, givenInterruptSentWhenHandlingAttentionEventThenTriggerEv uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[vmHandle] = 1; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[vmHandle] = 1; uint8_t data[sizeof(prelim_drm_i915_debug_event_eu_attention) + 128]; @@ -747,7 +747,7 @@ TEST_F(TileAttachTest, givenInterruptSentWhenHandlingAttentionEventThenTriggerEv attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention); attention.base.seqno = 2; - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = engineInstance->engineClass; @@ -769,14 +769,14 @@ TEST_F(TileAttachTest, givenStoppedThreadsWhenHandlingAttentionEventThenStoppedT uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[vmHandle] = 1; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[vmHandle] = 1; SIP::version version = {2, 0, 0}; initStateSaveArea(rootSession->stateSaveAreaHeader, version, deviceImp); - DebugSessionLinux::BindInfo cssaInfo = {reinterpret_cast(rootSession->stateSaveAreaHeader.data()), rootSession->stateSaveAreaHeader.size()}; - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; + DebugSessionLinuxi915::BindInfo cssaInfo = {reinterpret_cast(rootSession->stateSaveAreaHeader.data()), rootSession->stateSaveAreaHeader.size()}; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; auto handler = new MockIoctlHandler; rootSession->ioctlHandler.reset(handler); @@ -802,7 +802,7 @@ TEST_F(TileAttachTest, givenStoppedThreadsWhenHandlingAttentionEventThenStoppedT attention.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; attention.base.size = sizeof(prelim_drm_i915_debug_event_eu_attention); attention.base.seqno = 2; - attention.client_handle = MockDebugSessionLinux::mockClientHandle; + attention.client_handle = MockDebugSessionLinuxi915::mockClientHandle; attention.lrc_handle = lrcHandle; attention.flags = 0; attention.ci.engine_class = engineInstance->engineClass; @@ -828,14 +828,14 @@ TEST_F(TileAttachTest, givenStoppedThreadsWhenHandlingPageFaultEventThenStoppedT uint64_t vmHandle = 7; uint64_t lrcHandle = 8; - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[vmHandle] = 1; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->contextsCreated[ctxHandle].vm = vmHandle; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->lrcToContextHandle[lrcHandle] = ctxHandle; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[vmHandle] = 1; SIP::version version = {2, 0, 0}; initStateSaveArea(rootSession->stateSaveAreaHeader, version, deviceImp); - DebugSessionLinux::BindInfo cssaInfo = {reinterpret_cast(rootSession->stateSaveAreaHeader.data()), rootSession->stateSaveAreaHeader.size()}; - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; + DebugSessionLinuxi915::BindInfo cssaInfo = {reinterpret_cast(rootSession->stateSaveAreaHeader.data()), rootSession->stateSaveAreaHeader.size()}; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToContextStateSaveAreaBindInfo[vmHandle] = cssaInfo; auto handler = new MockIoctlHandler; rootSession->ioctlHandler.reset(handler); @@ -863,7 +863,7 @@ TEST_F(TileAttachTest, givenStoppedThreadsWhenHandlingPageFaultEventThenStoppedT pf.base.flags = PRELIM_DRM_I915_DEBUG_EVENT_STATE_CHANGE; pf.base.size = sizeof(prelim_drm_i915_debug_event_page_fault); pf.base.seqno = 2; - pf.client_handle = MockDebugSessionLinux::mockClientHandle; + pf.client_handle = MockDebugSessionLinuxi915::mockClientHandle; pf.lrc_handle = lrcHandle; pf.flags = 0; pf.ci.engine_class = engineInstance->engineClass; @@ -893,7 +893,7 @@ TEST_F(TileAttachTest, GivenBlockingOnCpuDetachedTileAndZebinModulesWithEventsTo addZebinVmBindEvent(rootSession, vm0, true, true, 1); addZebinVmBindEvent(rootSession, vm1, true, true, 0); - EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); EXPECT_EQ(3u, handler->ackCount); handler->ackCount = 0; @@ -922,7 +922,7 @@ TEST_F(TileAttachTest, GivenBlockingOnCpuAttachedTileAndZebinModulesWithEventsTo EXPECT_EQ(2u, handler->ackCount); auto ackBeforeDetach = handler->ackCount; - EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); tileSessions[0]->detachTile(); EXPECT_EQ(ackBeforeDetach + 1u, handler->ackCount); EXPECT_EQ(10u, handler->debugEventAcked.seqno); @@ -945,7 +945,7 @@ TEST_F(TileAttachTest, GivenTileAttachedAndIsaWithOsEventToAckWhenDetachingTileT EXPECT_EQ(20u, handler->debugEventAcked.seqno); EXPECT_EQ(static_cast(PRELIM_DRM_I915_DEBUG_EVENT_VM_BIND), handler->debugEventAcked.type); - auto isa = rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[0][isaGpuVa].get(); + auto isa = rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[0][isaGpuVa].get(); EXPECT_EQ(0u, isa->ackEvents.size()); EXPECT_TRUE(isa->moduleLoadEventAck); } @@ -964,7 +964,7 @@ TEST_F(TileAttachTest, GivenBlockingOnCpuAndZebinModuleEventWithoutAckWhenHandli EXPECT_EQ(1u, tileSessions[0]->apiEvents.size()); EXPECT_FALSE(ZET_DEBUG_EVENT_FLAG_NEED_ACK & tileSessions[0]->apiEvents.front().flags); - EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); EXPECT_EQ(0u, handler->ackCount); } @@ -980,7 +980,7 @@ TEST_F(TileAttachBlockOnFenceTest, GivenBlockingOnFenceDetachedTileAndZebinModul addZebinVmBindEvent(rootSession, vm0, true, true, 1); addZebinVmBindEvent(rootSession, vm1, true, true, 0); - EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); EXPECT_EQ(3u, handler->ackCount); handler->ackCount = 0; @@ -1010,8 +1010,8 @@ TEST_F(TileAttachBlockOnFenceTest, GivenBlockingOnFenceAttachedTileAndZebinModul EXPECT_EQ(1u, handler->ackCount); auto ackBeforeDetach = handler->ackCount; - EXPECT_EQ(2u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); - EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[1].size()); + EXPECT_EQ(2u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[1].size()); tileSessions[0]->detachTile(); EXPECT_EQ(ackBeforeDetach + 2u, handler->ackCount); @@ -1033,9 +1033,9 @@ TEST_F(TileAttachBlockOnFenceTest, GivenBlockingOnFenceAttachedTileAndZebinModul EXPECT_EQ(0u, handler->ackCount); EXPECT_EQ(1u, tileSessions[0]->apiEvents.size()); - EXPECT_EQ(2u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); - EXPECT_FALSE(rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].moduleLoadEventAcked[0]); - EXPECT_EQ(2, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentVmBindCounter[0]); + EXPECT_EQ(2u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_FALSE(rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].moduleLoadEventAcked[0]); + EXPECT_EQ(2, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentVmBindCounter[0]); zet_debug_event_t event = {}; auto result = zetDebugReadEvent(tileSessions[0]->toHandle(), 0, &event); @@ -1046,16 +1046,16 @@ TEST_F(TileAttachBlockOnFenceTest, GivenBlockingOnFenceAttachedTileAndZebinModul EXPECT_EQ(ZE_RESULT_SUCCESS, result); EXPECT_EQ(2u, handler->ackCount); - EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[vm0 + 20] = 0; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[vm0 + 20] = 0; addZebinVmBindEvent(rootSession, vm0 + 20, true, true, 0); EXPECT_EQ(3u, handler->ackCount); - EXPECT_EQ(3, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentVmBindCounter[0]); - EXPECT_TRUE(rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].moduleLoadEventAcked[0]); + EXPECT_EQ(3, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentVmBindCounter[0]); + EXPECT_TRUE(rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].moduleLoadEventAcked[0]); - EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); + EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].ackEvents[0].size()); } TEST_F(TileAttachBlockOnFenceTest, GivenMultipleVmBindEventsForFirstZebinSegmentWhenHandlingEventThenLoadEventIsNotTriggered) { @@ -1067,24 +1067,24 @@ TEST_F(TileAttachBlockOnFenceTest, GivenMultipleVmBindEventsForFirstZebinSegment rootSession->tileSessions[0].second = true; tileSessions[0]->attachTile(); - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->vmToTile[vm0 + 20] = 0; + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->vmToTile[vm0 + 20] = 0; addZebinVmBindEvent(rootSession, vm0, true, true, 0); addZebinVmBindEvent(rootSession, vm0 + 20, true, true, 0); EXPECT_EQ(0u, tileSessions[0]->apiEvents.size()); - EXPECT_EQ(2, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentVmBindCounter[0]); - EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); + EXPECT_EQ(2, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentVmBindCounter[0]); + EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); addZebinVmBindEvent(rootSession, vm0 + 20, true, true, 1); EXPECT_EQ(1u, tileSessions[0]->apiEvents.size()); - EXPECT_EQ(2u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); + EXPECT_EQ(2u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[0].size()); } using TileAttachAsyncThreadTest = Test>; TEST_F(TileAttachAsyncThreadTest, GivenInterruptedThreadsWhenNoAttentionEventIsReadThenThreadUnavailableEventIsGenerated) { rootSession->tileSessions[0].second = true; - tileSessions[0]->returnTimeDiff = DebugSessionLinux::interruptTimeout * 10; + tileSessions[0]->returnTimeDiff = DebugSessionLinuxi915::interruptTimeout * 10; ze_device_thread_t thread = {0, 0, 0, 0}; auto result = tileSessions[0]->interrupt(thread); @@ -1138,7 +1138,7 @@ TEST_F(TileAttachTest, GivenEventWithL0ZebinModuleWhenHandlingEventThenModuleLoa vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 10; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandle; @@ -1154,11 +1154,11 @@ TEST_F(TileAttachTest, GivenEventWithL0ZebinModuleWhenHandlingEventThenModuleLoa rootSession->handleEvent(&vmBindIsa->base); EXPECT_EQ(0u, rootSession->apiEvents.size()); - EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.size()); - EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[tile].size()); + EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.size()); + EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[tile].size()); // event not pushed to ack - EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[tile][isaGpuVa]->ackEvents.size()); + EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[tile][isaGpuVa]->ackEvents.size()); EXPECT_EQ(1, handler->ioctlCalled); // ACK EXPECT_EQ(vmBindIsa->base.seqno, handler->debugEventAcked.seqno); @@ -1170,11 +1170,11 @@ TEST_F(TileAttachTest, GivenEventWithL0ZebinModuleWhenHandlingEventThenModuleLoa rootSession->handleEvent(&vmBindIsa->base); EXPECT_EQ(0u, rootSession->apiEvents.size()); - EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.size()); - EXPECT_EQ(2u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[tile].size()); - EXPECT_EQ(2u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount); + EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.size()); + EXPECT_EQ(2u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].loadAddresses[tile].size()); + EXPECT_EQ(2u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule[zebinModuleUUID].segmentCount); - auto &isaMap = rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[tile]; + auto &isaMap = rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[tile]; EXPECT_EQ(2u, isaMap.size()); bool attachedAfterModuleLoaded = false; @@ -1188,7 +1188,7 @@ TEST_F(TileAttachTest, GivenEventWithL0ZebinModuleWhenHandlingEventThenModuleLoa if (attachedAfterModuleLoaded == false) { // event not pushed to ack - EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[tile][isaGpuVa2]->ackEvents.size()); + EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[tile][isaGpuVa2]->ackEvents.size()); EXPECT_EQ(0, handler->ioctlCalled); EXPECT_EQ(0u, handler->debugEventAcked.seqno); @@ -1197,7 +1197,7 @@ TEST_F(TileAttachTest, GivenEventWithL0ZebinModuleWhenHandlingEventThenModuleLoa } else { // event not pushed to ack - EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->isaMap[tile][isaGpuVa2]->ackEvents.size()); + EXPECT_EQ(0u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->isaMap[tile][isaGpuVa2]->ackEvents.size()); // ack immediately EXPECT_EQ(1, handler->ioctlCalled); EXPECT_EQ(11u, handler->debugEventAcked.seqno); @@ -1220,8 +1220,8 @@ TEST_F(TileAttachTest, GivenEventWithL0ZebinModuleWhenHandlingEventThenModuleLoa EXPECT_EQ(isaGpuVa2, event.info.module.load); - auto elfAddress = rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr; - auto elfSize = rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].dataSize; + auto elfAddress = rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr; + auto elfSize = rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].dataSize; EXPECT_EQ(elfAddress, event.info.module.moduleBegin); EXPECT_EQ(elfAddress + elfSize, event.info.module.moduleEnd); @@ -1257,9 +1257,9 @@ TEST_F(TileAttachTest, GivenEventWithL0ZebinModuleWhenHandlingEventThenModuleLoa EXPECT_EQ(isaGpuVa2, event.info.module.load); EXPECT_EQ(0u, event.flags & ZET_DEBUG_EVENT_FLAG_NEED_ACK); - EXPECT_EQ(rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr, event.info.module.moduleBegin); - EXPECT_EQ(rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].ptr + - rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap[elfUUID].dataSize, + EXPECT_EQ(rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr, event.info.module.moduleBegin); + EXPECT_EQ(rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].ptr + + rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap[elfUUID].dataSize, event.info.module.moduleEnd); } } @@ -1268,7 +1268,7 @@ TEST_F(TileAttachTest, GivenZebinModuleVmBindForModuleFromDifferentTileThenVmBin auto handler = new MockIoctlHandler; rootSession->ioctlHandler.reset(handler); - auto &isaUuidData = rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidMap.find(isaUUID)->second; + auto &isaUuidData = rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidMap.find(isaUUID)->second; DeviceBitfield bitfield; bitfield.set(1); auto deviceBitfield = static_cast(bitfield.to_ulong()); @@ -1282,7 +1282,7 @@ TEST_F(TileAttachTest, GivenZebinModuleVmBindForModuleFromDifferentTileThenVmBin vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 10; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandle; @@ -1310,7 +1310,7 @@ TEST_F(TileAttachTest, GivenZebinModuleDestroyedBeforeAttachWhenAttachingThenMod vmBindIsa->base.flags = PRELIM_DRM_I915_DEBUG_EVENT_CREATE | PRELIM_DRM_I915_DEBUG_EVENT_NEED_ACK; vmBindIsa->base.size = sizeof(prelim_drm_i915_debug_event_vm_bind) + 3 * sizeof(typeOfUUID); vmBindIsa->base.seqno = 10; - vmBindIsa->client_handle = MockDebugSessionLinux::mockClientHandle; + vmBindIsa->client_handle = MockDebugSessionLinuxi915::mockClientHandle; vmBindIsa->va_start = isaGpuVa; vmBindIsa->va_length = isaSize; vmBindIsa->vm_handle = vmHandle; @@ -1330,7 +1330,7 @@ TEST_F(TileAttachTest, GivenZebinModuleDestroyedBeforeAttachWhenAttachingThenMod rootSession->handleEvent(&vmBindIsa->base); - EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinux::mockClientHandle]->uuidToModule.size()); + EXPECT_EQ(1u, rootSession->clientHandleToConnection[MockDebugSessionLinuxi915::mockClientHandle]->uuidToModule.size()); ASSERT_EQ(1u, tileSessions[1]->modules.size()); EXPECT_EQ(isaGpuVa2, tileSessions[1]->modules.begin()->second.load);