diff --git a/level_zero/core/source/module/module_imp.cpp b/level_zero/core/source/module/module_imp.cpp index 472c12fcc0..7dd6b4e998 100644 --- a/level_zero/core/source/module/module_imp.cpp +++ b/level_zero/core/source/module/module_imp.cpp @@ -1287,10 +1287,10 @@ void ModuleImp::registerElfInDebuggerL0() { NEO::DebugData debugData; // pass debug zebin in vIsa field debugData.vIsa = reinterpret_cast(translationUnit->debugData.get()); debugData.vIsaSize = static_cast(translationUnit->debugDataSize); + this->debugElfHandle = debuggerL0->registerElf(&debugData); StackVec segmentAllocs; for (auto &kernImmData : kernelImmDatas) { - debuggerL0->registerElf(&debugData, kernImmData->getIsaGraphicsAllocation()); segmentAllocs.push_back(kernImmData->getIsaGraphicsAllocation()); } @@ -1301,7 +1301,7 @@ void ModuleImp::registerElfInDebuggerL0() { segmentAllocs.push_back(translationUnit->globalConstBuffer); } - debuggerL0->attachZebinModuleToSegmentAllocations(segmentAllocs, debugModuleHandle); + debuggerL0->attachZebinModuleToSegmentAllocations(segmentAllocs, this->debugModuleHandle, this->debugElfHandle); } else { for (auto &kernImmData : kernelImmDatas) { if (kernImmData->getKernelInfo()->kernelDescriptor.external.debugData.get()) { @@ -1316,7 +1316,7 @@ void ModuleImp::registerElfInDebuggerL0() { notifyDebugData = &relocatedDebugData; } - debuggerL0->registerElf(notifyDebugData, kernImmData->getIsaGraphicsAllocation()); + debuggerL0->registerElfAndLinkWithAllocation(notifyDebugData, kernImmData->getIsaGraphicsAllocation()); } } } diff --git a/level_zero/core/source/module/module_imp.h b/level_zero/core/source/module/module_imp.h index 9551c9e234..e760b7efa1 100644 --- a/level_zero/core/source/module/module_imp.h +++ b/level_zero/core/source/module/module_imp.h @@ -182,6 +182,7 @@ struct ModuleImp : public Module { NEO::Linker::UnresolvedExternals unresolvedExternalsInfo{}; std::set importedSymbolAllocations{}; uint32_t debugModuleHandle = 0; + uint32_t debugElfHandle = 0; uint32_t profileFlags = 0; uint64_t moduleLoadAddress = std::numeric_limits::max(); diff --git a/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp b/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp index a301182948..1199076256 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/linux/test_l0_debugger_linux.cpp @@ -176,14 +176,14 @@ TEST(L0DebuggerLinux, givenPerContextVmNotEnabledWhenInitializingDebuggingInOsTh EXPECT_FALSE(drmMock->registerClassesCalled); } -TEST_F(L0DebuggerLinuxTest, whenRegisterElfisCalledThenItRegistersBindExtHandles) { +TEST_F(L0DebuggerLinuxTest, whenRegisterElfAndLinkWithAllocationIsCalledThenItRegistersBindExtHandles) { NEO::DebugData debugData; debugData.vIsa = "01234567890"; debugData.vIsaSize = 10; MockDrmAllocation isaAllocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); MockBufferObject bo(drmMock, 3, 0, 0, 1); isaAllocation.bufferObjects[0] = &bo; - device->getL0Debugger()->registerElf(&debugData, &isaAllocation); + device->getL0Debugger()->registerElfAndLinkWithAllocation(&debugData, &isaAllocation); EXPECT_EQ(static_cast(10), drmMock->registeredDataSize); @@ -196,31 +196,38 @@ TEST_F(L0DebuggerLinuxTest, whenRegisterElfisCalledThenItRegistersBindExtHandles } } -TEST_F(L0DebuggerLinuxTest, whenRegisterElfisCalledInAllocationWithNoBOThenItRegistersBindExtHandles) { +TEST_F(L0DebuggerLinuxTest, whenRegisterElfAndLinkWithAllocationIsCalledInAllocationWithNoBOThenItRegistersBindExtHandles) { NEO::DebugData debugData; debugData.vIsa = "01234567890"; debugData.vIsaSize = 10; MockDrmAllocation isaAllocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); - device->getL0Debugger()->registerElf(&debugData, &isaAllocation); + device->getL0Debugger()->registerElfAndLinkWithAllocation(&debugData, &isaAllocation); EXPECT_EQ(static_cast(10u), drmMock->registeredDataSize); } -TEST_F(L0DebuggerLinuxTest, givenNoOSInterfaceThenRegisterElfDoesNothing) { - NEO::OSInterface *osInterfaceTmp = neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.release(); +HWTEST_F(L0DebuggerLinuxTest, givenFailureToRegisterElfWhenRegisterElfAndLinkWithAllocationIsCalledThenBindExtHandleIsNotAdded) { NEO::DebugData debugData; debugData.vIsa = "01234567890"; debugData.vIsaSize = 10; - drmMock->registeredDataSize = 0; MockDrmAllocation isaAllocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockBufferObject bo(drmMock, 3, 0, 0, 1); + isaAllocation.bufferObjects[0] = &bo; - device->getL0Debugger()->registerElf(&debugData, &isaAllocation); + auto debuggerL0Hw = static_cast *>(device->getL0Debugger()); + debuggerL0Hw->elfHandleToReturn = 0; + device->getL0Debugger()->registerElfAndLinkWithAllocation(&debugData, &isaAllocation); - EXPECT_EQ(static_cast(0u), drmMock->registeredDataSize); - neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.reset(osInterfaceTmp); + auto &bos = isaAllocation.getBOs(); + for (auto bo : bos) { + if (bo) { + auto extBindHandles = bo->getBindExtHandles(); + EXPECT_EQ(static_cast(0), extBindHandles.size()); + } + } } -TEST_F(L0DebuggerLinuxTest, givenAllocationsWhenAttachingZebinModuleThenAllAllocationsHaveRegisteredHandle) { +TEST_F(L0DebuggerLinuxTest, givenAllocationsWhenAttachingZebinModuleThenAllAllocationsHaveRegisteredHandles) { MockDrmAllocation isaAllocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); MockBufferObject bo(drmMock, 3, 0, 0, 1); isaAllocation.bufferObjects[0] = &bo; @@ -230,6 +237,7 @@ TEST_F(L0DebuggerLinuxTest, givenAllocationsWhenAttachingZebinModuleThenAllAlloc isaAllocation2.bufferObjects[0] = &bo2; uint32_t handle = 0; + const uint32_t elfHandle = 198; StackVec kernelAllocs; kernelAllocs.push_back(&isaAllocation); @@ -238,7 +246,7 @@ TEST_F(L0DebuggerLinuxTest, givenAllocationsWhenAttachingZebinModuleThenAllAlloc drmMock->registeredDataSize = 0; drmMock->registeredClass = NEO::DrmResourceClass::MaxSize; - EXPECT_TRUE(device->getL0Debugger()->attachZebinModuleToSegmentAllocations(kernelAllocs, handle)); + EXPECT_TRUE(device->getL0Debugger()->attachZebinModuleToSegmentAllocations(kernelAllocs, handle, elfHandle)); EXPECT_EQ(sizeof(uint32_t), drmMock->registeredDataSize); EXPECT_EQ(NEO::DrmResourceClass::L0ZebinModule, drmMock->registeredClass); @@ -248,8 +256,15 @@ TEST_F(L0DebuggerLinuxTest, givenAllocationsWhenAttachingZebinModuleThenAllAlloc return std::find(bindExtHandles.begin(), bindExtHandles.end(), handle) != bindExtHandles.end(); }; + const auto containsElfHandle = [elfHandle](const auto &bufferObject) { + const auto &bindExtHandles = bufferObject.getBindExtHandles(); + return std::find(bindExtHandles.begin(), bindExtHandles.end(), elfHandle) != bindExtHandles.end(); + }; + EXPECT_TRUE(containsModuleHandle(bo)); EXPECT_TRUE(containsModuleHandle(bo2)); + EXPECT_TRUE(containsElfHandle(bo)); + EXPECT_TRUE(containsElfHandle(bo2)); } TEST_F(L0DebuggerLinuxTest, givenModuleHandleWhenRemoveZebinModuleIsCalledThenHandleIsUnregistered) { diff --git a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp index 01af6f7c8d..5f500c2162 100644 --- a/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp +++ b/level_zero/core/test/unit_tests/sources/debugger/test_module_with_debug.cpp @@ -511,7 +511,7 @@ HWTEST_F(ModuleWithDebuggerL0Test, GivenDebugDataWithRelocationsWhenInitializing EXPECT_EQ(0u, getMockDebuggerL0Hw()->registerElfCount); EXPECT_EQ(moduleMock->initialize(&moduleDesc, neoDevice), ZE_RESULT_SUCCESS); - EXPECT_EQ(1u, getMockDebuggerL0Hw()->registerElfCount); + EXPECT_EQ(1u, getMockDebuggerL0Hw()->registerElfAndLinkCount); EXPECT_EQ(1u, getMockDebuggerL0Hw()->notifyModuleCreateCount); EXPECT_NE(nullptr, kernelInfo->kernelDescriptor.external.relocatedDebugData.get()); @@ -562,7 +562,7 @@ HWTEST_F(ModuleWithDebuggerL0Test, GivenDebugDataWithoutRelocationsWhenInitializ EXPECT_EQ(0u, getMockDebuggerL0Hw()->registerElfCount); EXPECT_EQ(moduleMock->initialize(&moduleDesc, neoDevice), ZE_RESULT_SUCCESS); - EXPECT_EQ(1u, getMockDebuggerL0Hw()->registerElfCount); + EXPECT_EQ(1u, getMockDebuggerL0Hw()->registerElfAndLinkCount); EXPECT_EQ(1u, getMockDebuggerL0Hw()->notifyModuleCreateCount); EXPECT_EQ(nullptr, kernelInfo->kernelDescriptor.external.relocatedDebugData.get()); @@ -639,7 +639,7 @@ HWTEST_F(ModuleWithZebinAndL0DebuggerTest, GivenZebinDebugDataWhenInitializingMo zebin.storage.data(), zebin.storage.size()); EXPECT_EQ(0u, getMockDebuggerL0Hw()->registerElfCount); EXPECT_EQ(moduleMock->initialize(&moduleDesc, neoDevice), ZE_RESULT_SUCCESS); - EXPECT_EQ(2u, getMockDebuggerL0Hw()->registerElfCount); + EXPECT_EQ(1u, getMockDebuggerL0Hw()->registerElfCount); EXPECT_EQ(1u, getMockDebuggerL0Hw()->notifyModuleCreateCount); } diff --git a/shared/source/debugger/debugger_l0.h b/shared/source/debugger/debugger_l0.h index 5e4b9cb639..50ffdaae05 100644 --- a/shared/source/debugger/debugger_l0.h +++ b/shared/source/debugger/debugger_l0.h @@ -90,7 +90,8 @@ class DebuggerL0 : public NEO::Debugger, NEO::NonCopyableOrMovableClass { } void printTrackedAddresses(uint32_t contextId); - MOCKABLE_VIRTUAL void registerElf(NEO::DebugData *debugData, NEO::GraphicsAllocation *isaAllocation); + MOCKABLE_VIRTUAL void registerElfAndLinkWithAllocation(NEO::DebugData *debugData, NEO::GraphicsAllocation *isaAllocation); + MOCKABLE_VIRTUAL uint32_t registerElf(NEO::DebugData *debugData); MOCKABLE_VIRTUAL void notifyCommandQueueCreated(NEO::Device *device); MOCKABLE_VIRTUAL void notifyCommandQueueDestroyed(NEO::Device *device); MOCKABLE_VIRTUAL void notifyModuleLoadAllocations(Device *device, const StackVec &allocs); @@ -102,7 +103,7 @@ class DebuggerL0 : public NEO::Debugger, NEO::NonCopyableOrMovableClass { virtual size_t getSbaAddressLoadCommandsSize() = 0; virtual void programSbaAddressLoad(NEO::LinearStream &cmdStream, uint64_t sbaGpuVa) = 0; - MOCKABLE_VIRTUAL bool attachZebinModuleToSegmentAllocations(const StackVec &kernelAlloc, uint32_t &moduleHandle); + MOCKABLE_VIRTUAL bool attachZebinModuleToSegmentAllocations(const StackVec &kernelAlloc, uint32_t &moduleHandle, uint32_t elfHandle); MOCKABLE_VIRTUAL bool removeZebinModule(uint32_t moduleHandle); void setSingleAddressSpaceSbaTracking(bool value) { diff --git a/shared/source/debugger/linux/debugger_l0_linux.cpp b/shared/source/debugger/linux/debugger_l0_linux.cpp index 70ef16a810..b78adc871d 100644 --- a/shared/source/debugger/linux/debugger_l0_linux.cpp +++ b/shared/source/debugger/linux/debugger_l0_linux.cpp @@ -32,15 +32,23 @@ void DebuggerL0::initSbaTrackingMode() { void DebuggerL0::registerAllocationType(GraphicsAllocation *allocation) {} -void DebuggerL0::registerElf(NEO::DebugData *debugData, NEO::GraphicsAllocation *isaAllocation) { - if (device->getRootDeviceEnvironment().osInterface.get() != nullptr) { - auto drm = device->getRootDeviceEnvironment().osInterface->getDriverModel()->as(); - auto handle = drm->registerResource(NEO::DrmResourceClass::Elf, debugData->vIsa, debugData->vIsaSize); +void DebuggerL0::registerElfAndLinkWithAllocation(NEO::DebugData *debugData, NEO::GraphicsAllocation *isaAllocation) { + auto handle = registerElf(debugData); + if (handle != 0) { static_cast(isaAllocation)->linkWithRegisteredHandle(handle); } } -bool DebuggerL0::attachZebinModuleToSegmentAllocations(const StackVec &allocs, uint32_t &moduleHandle) { +uint32_t DebuggerL0::registerElf(NEO::DebugData *debugData) { + uint32_t handle = 0; + if (device->getRootDeviceEnvironment().osInterface.get() != nullptr) { + auto drm = device->getRootDeviceEnvironment().osInterface->getDriverModel()->as(); + handle = drm->registerResource(NEO::DrmResourceClass::Elf, debugData->vIsa, debugData->vIsaSize); + } + return handle; +} + +bool DebuggerL0::attachZebinModuleToSegmentAllocations(const StackVec &allocs, uint32_t &moduleHandle, uint32_t elfHandle) { if (device->getRootDeviceEnvironment().osInterface == nullptr) { return false; } @@ -50,6 +58,7 @@ bool DebuggerL0::attachZebinModuleToSegmentAllocations(const StackVec(allocation); + drmAllocation->linkWithRegisteredHandle(elfHandle); drmAllocation->linkWithRegisteredHandle(moduleHandle); } diff --git a/shared/source/debugger/windows/debugger_l0_windows.cpp b/shared/source/debugger/windows/debugger_l0_windows.cpp index eef0466d48..5325d66968 100644 --- a/shared/source/debugger/windows/debugger_l0_windows.cpp +++ b/shared/source/debugger/windows/debugger_l0_windows.cpp @@ -98,10 +98,14 @@ void DebuggerL0::registerAllocationType(GraphicsAllocation *allocation) { DEBUG_BREAK_IF(STATUS_SUCCESS != status); } -void DebuggerL0::registerElf(NEO::DebugData *debugData, NEO::GraphicsAllocation *allocation) { +void DebuggerL0::registerElfAndLinkWithAllocation(NEO::DebugData *debugData, NEO::GraphicsAllocation *allocation) { } -bool DebuggerL0::attachZebinModuleToSegmentAllocations(const StackVec &kernelAllocs, uint32_t &moduleHandle) { +uint32_t DebuggerL0::registerElf(NEO::DebugData *debugData) { + return 0; +} + +bool DebuggerL0::attachZebinModuleToSegmentAllocations(const StackVec &kernelAllocs, uint32_t &moduleHandle, uint32_t elfHandle) { return false; } diff --git a/shared/test/common/mocks/mock_l0_debugger.h b/shared/test/common/mocks/mock_l0_debugger.h index 4a8cf39f52..c4466d9fd5 100644 --- a/shared/test/common/mocks/mock_l0_debugger.h +++ b/shared/test/common/mocks/mock_l0_debugger.h @@ -55,19 +55,28 @@ class MockDebuggerL0Hw : public NEO::DebuggerL0Hw { return NEO::DebuggerL0Hw::getSbaTrackingCommandsSize(trackedAddressCount); } - void registerElf(NEO::DebugData *debugData, NEO::GraphicsAllocation *isaAllocation) override { - registerElfCount++; + void registerElfAndLinkWithAllocation(NEO::DebugData *debugData, NEO::GraphicsAllocation *isaAllocation) override { + registerElfAndLinkCount++; lastReceivedElf = debugData->vIsa; - NEO::DebuggerL0Hw::registerElf(debugData, isaAllocation); + NEO::DebuggerL0Hw::registerElfAndLinkWithAllocation(debugData, isaAllocation); } - bool attachZebinModuleToSegmentAllocations(const StackVec &allocs, uint32_t &moduleHandle) override { + uint32_t registerElf(NEO::DebugData *debugData) override { + if (elfHandleToReturn != std::numeric_limits::max()) { + return elfHandleToReturn; + } + registerElfCount++; + lastReceivedElf = debugData->vIsa; + return NEO::DebuggerL0Hw::registerElf(debugData); + } + + bool attachZebinModuleToSegmentAllocations(const StackVec &allocs, uint32_t &moduleHandle, uint32_t elfHandle) override { segmentCountWithAttachedModuleHandle = static_cast(allocs.size()); if (std::numeric_limits::max() != moduleHandleToReturn) { moduleHandle = moduleHandleToReturn; return true; } - return NEO::DebuggerL0Hw::attachZebinModuleToSegmentAllocations(allocs, moduleHandle); + return NEO::DebuggerL0Hw::attachZebinModuleToSegmentAllocations(allocs, moduleHandle, elfHandle); } bool removeZebinModule(uint32_t moduleHandle) override { @@ -108,6 +117,7 @@ class MockDebuggerL0Hw : public NEO::DebuggerL0Hw { uint32_t captureStateBaseAddressCount = 0; uint32_t getSbaTrackingCommandsSizeCount = 0; uint32_t registerElfCount = 0; + uint32_t registerElfAndLinkCount = 0; uint32_t commandQueueCreatedCount = 0; uint32_t commandQueueDestroyedCount = 0; uint32_t registerAllocationTypeCount = 0; @@ -118,6 +128,7 @@ class MockDebuggerL0Hw : public NEO::DebuggerL0Hw { uint32_t segmentCountWithAttachedModuleHandle = 0; uint32_t removedZebinModuleHandle = 0; uint32_t moduleHandleToReturn = std::numeric_limits::max(); + uint32_t elfHandleToReturn = std::numeric_limits::max(); NEO::Device *notifyModuleLoadAllocationsCapturedDevice = nullptr; }; diff --git a/shared/test/unit_test/debugger/CMakeLists.txt b/shared/test/unit_test/debugger/CMakeLists.txt index da8dee0963..f03fa36a55 100644 --- a/shared/test/unit_test/debugger/CMakeLists.txt +++ b/shared/test/unit_test/debugger/CMakeLists.txt @@ -9,3 +9,5 @@ target_sources(neo_shared_tests PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/test_l0_debugger.cpp ${CMAKE_CURRENT_SOURCE_DIR}/test_l0_debugger_single_address_space.cpp ) + +add_subdirectories() diff --git a/shared/test/unit_test/debugger/linux/CMakeLists.txt b/shared/test/unit_test/debugger/linux/CMakeLists.txt new file mode 100644 index 0000000000..3f0d17fffe --- /dev/null +++ b/shared/test/unit_test/debugger/linux/CMakeLists.txt @@ -0,0 +1,12 @@ +# +# Copyright (C) 2022 Intel Corporation +# +# SPDX-License-Identifier: MIT +# + +if(UNIX) + target_sources(neo_shared_tests PRIVATE + ${CMAKE_CURRENT_SOURCE_DIR}/CMakeLists.txt + ${CMAKE_CURRENT_SOURCE_DIR}/test_l0_debugger_linux.cpp + ) +endif() diff --git a/shared/test/unit_test/debugger/linux/test_l0_debugger_linux.cpp b/shared/test/unit_test/debugger/linux/test_l0_debugger_linux.cpp new file mode 100644 index 0000000000..5ca2bd6485 --- /dev/null +++ b/shared/test/unit_test/debugger/linux/test_l0_debugger_linux.cpp @@ -0,0 +1,84 @@ +/* + * Copyright (C) 2022 Intel Corporation + * + * SPDX-License-Identifier: MIT + * + */ + +#include "shared/source/debugger/debugger_l0.h" +#include "shared/source/execution_environment/root_device_environment.h" +#include "shared/source/kernel/debug_data.h" +#include "shared/source/os_interface/os_interface.h" +#include "shared/test/common/libult/linux/drm_mock.h" +#include "shared/test/common/mocks/linux/mock_drm_allocation.h" +#include "shared/test/common/mocks/mock_device.h" +#include "shared/test/common/test_macros/test.h" + +#include +#include + +using namespace NEO; + +struct L0DebuggerSharedLinuxFixture { + + void setUp() { + setUp(nullptr); + } + + void setUp(HardwareInfo *hwInfo) { + auto executionEnvironment = new NEO::ExecutionEnvironment(); + executionEnvironment->prepareRootDeviceEnvironments(1); + executionEnvironment->setDebuggingEnabled(); + executionEnvironment->rootDeviceEnvironments[0]->setHwInfo(hwInfo ? hwInfo : defaultHwInfo.get()); + executionEnvironment->initializeMemoryManager(); + auto osInterface = new OSInterface(); + drmMock = new DrmMockResources(*executionEnvironment->rootDeviceEnvironments[0]); + executionEnvironment->rootDeviceEnvironments[0]->osInterface.reset(osInterface); + executionEnvironment->rootDeviceEnvironments[0]->osInterface->setDriverModel(std::unique_ptr(drmMock)); + + neoDevice.reset(NEO::MockDevice::create(executionEnvironment, 0u)); + + auto rootDeviceEnvironment = neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0].get(); + rootDeviceEnvironment->initDebuggerL0(neoDevice.get()); + } + + void tearDown() { + drmMock = nullptr; + }; + + std::unique_ptr neoDevice = nullptr; + DrmMockResources *drmMock = nullptr; +}; + +using L0DebuggerSharedLinuxTest = Test; + +TEST_F(L0DebuggerSharedLinuxTest, givenNoOSInterfaceThenRegisterElfDoesNothing) { + NEO::OSInterface *osInterfaceTmp = neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.release(); + NEO::DebugData debugData; + debugData.vIsa = "01234567890"; + debugData.vIsaSize = 10; + drmMock->registeredDataSize = 0; + + neoDevice->getL0Debugger()->registerElf(&debugData); + + EXPECT_EQ(static_cast(0u), drmMock->registeredDataSize); + neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.reset(osInterfaceTmp); +} + +TEST_F(L0DebuggerSharedLinuxTest, givenNoOSInterfaceThenRegisterElfAndLinkWithAllocationDoesNothing) { + NEO::OSInterface *osInterfaceTmp = neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.release(); + NEO::DebugData debugData; + debugData.vIsa = "01234567890"; + debugData.vIsaSize = 10; + drmMock->registeredDataSize = 0; + + MockDrmAllocation isaAllocation(AllocationType::KERNEL_ISA, MemoryPool::System4KBPages); + MockBufferObject bo(drmMock, 3, 0, 0, 1); + isaAllocation.bufferObjects[0] = &bo; + + neoDevice->getL0Debugger()->registerElfAndLinkWithAllocation(&debugData, &isaAllocation); + + EXPECT_EQ(static_cast(0u), drmMock->registeredDataSize); + EXPECT_EQ(0u, isaAllocation.bufferObjects[0]->getBindExtHandles().size()); + neoDevice->getExecutionEnvironment()->rootDeviceEnvironments[0]->osInterface.reset(osInterfaceTmp); +}